2015-07-02 17:42:46

by Wei Zhong

[permalink] [raw]
Subject: [PATCH] wireless: regulatory: save user-specified alpha2 when request is dropped

In the case that user-initiated request is dropped because it has the
same alpha2 as last request, which could be from driver, save
user_alpah2[2], so that correct user_alpha2 can be restored in the
case of disassociation.

Signed-off-by: Wei Zhong <[email protected]>
---
net/wireless/reg.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 91ef82b..9019617 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1534,6 +1534,11 @@ static int __regulatory_hint(struct wiphy *wiphy,
}
intersect = true;
} else if (r) {
+ /* Save alpha2 if initiated from user in case the request is dropped. */
+ if (pending_request->initiator == NL80211_REGDOM_SET_BY_USER) {
+ user_alpha2[0] = pending_request->alpha2[0];
+ user_alpha2[1] = pending_request->alpha2[1];
+ }
/*
* If the regulatory domain being requested by the
* driver has already been set just copy it to the
--
2.4.3.573.g4eafbef