summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSachin Ahuja <sahuja@codeaurora.org>2014-04-28 15:26:53 +0530
committerKyle Yan <kyan@codeaurora.org>2016-06-07 11:57:55 -0700
commita1807a0515f5508d79957921961123491daab577 (patch)
tree74a37502770aa57c34b49b32bd6f9d17ec7aee21
parent6cc2fdb17ca9960481fed5f0920a9bc5f593b12b (diff)
cfg80211: avoid restoring the regulatory during disconnect
Driver configures the default country code during bootup. When STA disconnects, cfg80211 restore the regulatory setting to world domain.cfg80211 should remain in the default country code and not restore to world reg domain. Change-Id: I01ccdc4d2831cf252a4b35f9f856f3256d9b7429 CRs-Fixed: 1023778 Signed-off-by: Sachin Ahuja <sahuja@codeaurora.org> [joshc: fixed hunk in disconnect_work() - moved cfg80211_is_all_countryie_ignore() check into new location, collapsed conditional and use upstream REGULATORY_COUNTRY_IE_IGNORE regulatory flag] Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
-rw-r--r--net/wireless/sme.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 79bd3a171caa..e9be8c3b177b 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -47,6 +47,29 @@ struct cfg80211_conn {
bool auto_auth, prev_bssid_valid;
};
+static bool cfg80211_is_all_countryie_ignore(void)
+{
+ struct cfg80211_registered_device *rdev;
+ struct wireless_dev *wdev;
+ bool is_all_countryie_ignore = true;
+
+ list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
+ list_for_each_entry(wdev, &rdev->wdev_list, list) {
+ wdev_lock(wdev);
+ if (!(wdev->wiphy->regulatory_flags &
+ REGULATORY_COUNTRY_IE_IGNORE)) {
+ is_all_countryie_ignore = false;
+ wdev_unlock(wdev);
+ goto out;
+ }
+ wdev_unlock(wdev);
+ }
+ }
+
+out:
+ return is_all_countryie_ignore;
+}
+
static void cfg80211_sme_free(struct wireless_dev *wdev)
{
if (!wdev->conn)
@@ -619,7 +642,8 @@ static bool cfg80211_is_all_idle(void)
static void disconnect_work(struct work_struct *work)
{
rtnl_lock();
- if (cfg80211_is_all_idle())
+ if (cfg80211_is_all_idle() &&
+ !cfg80211_is_all_countryie_ignore())
regulatory_hint_disconnect();
rtnl_unlock();
}