summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/cfg80211.c
diff options
context:
space:
mode:
authorBing Zhao2013-12-14 03:32:59 +0100
committerJohn W. Linville2013-12-18 21:23:06 +0100
commitdd4a9ac05c8e17f40427878f379123263333bcd7 (patch)
tree4c8a2e83b47a4d3a56a7844705d0d774f08d9976 /drivers/net/wireless/mwifiex/cfg80211.c
parentath9k: fix 5/10MHz channel width initialization on ar9003 (diff)
downloadkernel-qcow2-linux-dd4a9ac05c8e17f40427878f379123263333bcd7.tar.gz
kernel-qcow2-linux-dd4a9ac05c8e17f40427878f379123263333bcd7.tar.xz
kernel-qcow2-linux-dd4a9ac05c8e17f40427878f379123263333bcd7.zip
mwifiex: send regulatory domain info to firmware only if alpha2 changed
On cfg80211 regulatory domain change, drivers gets alpha2 country code or "00" in driver's notification handler. In most cases, the pattern will be US, 00, US, 00, US, 00, US, ... There is no need to send domain info to firmware in case of "00" or with the same alpha2 country code. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/cfg80211.c')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 3ff28c2149ce..ae12aaa793a1 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -542,19 +542,26 @@ static void mwifiex_reg_notifier(struct wiphy *wiphy,
wiphy_dbg(wiphy, "info: cfg80211 regulatory domain callback for %c%c\n",
request->alpha2[0], request->alpha2[1]);
- memcpy(adapter->country_code, request->alpha2, sizeof(request->alpha2));
-
switch (request->initiator) {
case NL80211_REGDOM_SET_BY_DRIVER:
case NL80211_REGDOM_SET_BY_CORE:
case NL80211_REGDOM_SET_BY_USER:
- break;
- /* Todo: apply driver specific changes in channel flags based
- on the request initiator if necessary. */
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
break;
+ default:
+ wiphy_err(wiphy, "unknown regdom initiator: %d\n",
+ request->initiator);
+ return;
+ }
+
+ /* Don't send world or same regdom info to firmware */
+ if (strncmp(request->alpha2, "00", 2) &&
+ strncmp(request->alpha2, adapter->country_code,
+ sizeof(request->alpha2))) {
+ memcpy(adapter->country_code, request->alpha2,
+ sizeof(request->alpha2));
+ mwifiex_send_domain_info_cmd_fw(wiphy);
}
- mwifiex_send_domain_info_cmd_fw(wiphy);
}
/*