[wireless-regdb] [PATCH] cfg80211: reg: setup correct alpha2 after intersection
Janusz Dziedzic
janusz.dziedzic at tieto.com
Tue Jun 10 22:00:35 PDT 2014
Setup correct alfa2 in last request after intersection.
In other case after intersection we could not change/set
new country using eg. iw reg set
Failed scenario:
- insmod cfg80211.ko
- iw reg set FR
- modprobe ath10k_pci (US hint)
- intersection and country set as "98"
- no way to setup new country using iw reg set
Signed-off-by: Janusz Dziedzic <janusz.dziedzic at tieto.com>
---
@Luis I am not sure this is the best way to fix it, please review.
net/wireless/reg.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 82948c8..8fd82b2 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -271,6 +271,7 @@ static void reset_regdomains(bool full_reset,
const struct ieee80211_regdomain *new_regdom)
{
const struct ieee80211_regdomain *r;
+ struct regulatory_request *lr;
ASSERT_RTNL();
@@ -284,6 +285,12 @@ static void reset_regdomains(bool full_reset,
if (r == &world_regdom)
r = NULL;
+ lr = get_last_request();
+ if (lr && new_regdom) {
+ lr->alpha2[0] = new_regdom->alpha2[0];
+ lr->alpha2[1] = new_regdom->alpha2[1];
+ }
+
rcu_free_regdom(r);
rcu_free_regdom(cfg80211_world_regdom);
--
1.7.9.5
More information about the wireless-regdb
mailing list