~xdavidwu/linux-xdavidwu-xps

ref: 3efac9c8047bdd068b0d0d379843751b26b9a4c2 linux-xdavidwu-xps/openwrt-402-ath_regd_optional.patch -rw-r--r-- 1.5 KiB
3efac9c8Pinghao Wu 6.14 14 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff -aur linux-4.8/drivers/net/wireless/ath/Kconfig linux-4.8.patch1/drivers/net/wireless/ath/Kconfig
--- linux-4.8/drivers/net/wireless/ath/Kconfig	2016-10-02 19:24:33.000000000 -0400
+++ linux-4.8.patch1/drivers/net/wireless/ath/Kconfig	2016-11-05 13:38:21.340772527 -0400
@@ -22,6 +22,9 @@
 
 if WLAN_VENDOR_ATH
 
+config ATH_USER_REGD
+	bool "Do not enforce EEPROM regulatory restrictions"
+
 config ATH_DEBUG
 	bool "Atheros wireless debugging"
 	---help---
diff -aur linux-4.8/drivers/net/wireless/ath/regd.c linux-4.8.patch1/drivers/net/wireless/ath/regd.c
--- linux-4.8/drivers/net/wireless/ath/regd.c	2016-10-02 19:24:33.000000000 -0400
+++ linux-4.8.patch1/drivers/net/wireless/ath/regd.c	2016-11-05 13:28:58.914116936 -0400
@@ -341,6 +341,10 @@
 	struct ieee80211_channel *ch;
 	unsigned int i;
 
+#ifdef CONFIG_ATH_USER_REGD
+	return;
+#endif
+
 	for (band = 0; band < NUM_NL80211_BANDS; band++) {
 		if (!wiphy->bands[band])
 			continue;
@@ -374,6 +378,10 @@
 {
 	struct ieee80211_supported_band *sband;
 
+#ifdef CONFIG_ATH_USER_REGD
+	return;
+#endif
+
 	sband = wiphy->bands[NL80211_BAND_2GHZ];
 	if (!sband)
 		return;
@@ -402,6 +410,10 @@
 	struct ieee80211_channel *ch;
 	unsigned int i;
 
+#ifdef CONFIG_ATH_USER_REGD
+	return;
+#endif
+
 	if (!wiphy->bands[NL80211_BAND_5GHZ])
 		return;
 
@@ -633,6 +645,11 @@
 	const struct ieee80211_regdomain *regd;
 
 	wiphy->reg_notifier = reg_notifier;
+
+#ifdef CONFIG_ATH_USER_REGD
+	return 0;
+#endif
+
 	wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
 				   REGULATORY_CUSTOM_REG;