]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/linux/linux-4.14_ath_user_regd.patch
kernel: update user regd patch from openwrt
[ipfire-2.x.git] / src / patches / linux / linux-4.14_ath_user_regd.patch
1 diff -Naur linux-4.14.103.org/drivers/net/wireless/ath/regd.c linux-4.14.103/drivers/net/wireless/ath/regd.c
2 --- linux-4.14.103.org/drivers/net/wireless/ath/regd.c 2019-02-23 09:06:44.000000000 +0100
3 +++ linux-4.14.103/drivers/net/wireless/ath/regd.c 2019-03-30 11:35:53.177299394 +0100
4 @@ -24,6 +24,7 @@
5 #include "regd_common.h"
6
7 static int __ath_regd_init(struct ath_regulatory *reg);
8 +static struct reg_dmn_pair_mapping *ath_get_regpair(int regdmn);
9
10 /*
11 * This is a set of common rules used by our world regulatory domains.
12 @@ -116,6 +117,9 @@
13
14 static bool dynamic_country_user_possible(struct ath_regulatory *reg)
15 {
16 +// if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
17 + return true;
18 +
19 if (IS_ENABLED(CONFIG_ATH_REG_DYNAMIC_USER_CERT_TESTING))
20 return true;
21
22 @@ -188,6 +192,8 @@
23
24 static bool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
25 {
26 +// if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
27 + return true;
28 if (!IS_ENABLED(CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS))
29 return false;
30 if (!dynamic_country_user_possible(reg))
31 @@ -345,6 +351,9 @@
32 struct ieee80211_channel *ch;
33 unsigned int i;
34
35 +// if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
36 + return;
37 +
38 for (band = 0; band < NUM_NL80211_BANDS; band++) {
39 if (!wiphy->bands[band])
40 continue;
41 @@ -378,6 +387,9 @@
42 {
43 struct ieee80211_supported_band *sband;
44
45 +// if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
46 + return;
47 +
48 sband = wiphy->bands[NL80211_BAND_2GHZ];
49 if (!sband)
50 return;
51 @@ -407,6 +419,9 @@
52 struct ieee80211_channel *ch;
53 unsigned int i;
54
55 +// if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
56 + return;
57 +
58 if (!wiphy->bands[NL80211_BAND_5GHZ])
59 return;
60
61 @@ -639,6 +654,10 @@
62 const struct ieee80211_regdomain *regd;
63
64 wiphy->reg_notifier = reg_notifier;
65 +
66 +// if (IS_ENABLED(CPTCFG_ATH_USER_REGD))
67 + return 0;
68 +
69 wiphy->regulatory_flags |= REGULATORY_STRICT_REG |
70 REGULATORY_CUSTOM_REG;
71