summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex/sta_ioctl.c
diff options
context:
space:
mode:
authorBing Zhao <bzhao@marvell.com>2013-12-14 06:32:59 +0400
committerJohn W. Linville <linville@tuxdriver.com>2013-12-19 00:23:06 +0400
commitdd4a9ac05c8e17f40427878f379123263333bcd7 (patch)
tree4c8a2e83b47a4d3a56a7844705d0d774f08d9976 /drivers/net/wireless/mwifiex/sta_ioctl.c
parent935d00ccf7321d704a1bf8e982dd6934165c1327 (diff)
downloadlinux-dd4a9ac05c8e17f40427878f379123263333bcd7.tar.xz
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/sta_ioctl.c')
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index a09398fe9e2a..85f419825ecf 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -205,6 +205,14 @@ static int mwifiex_process_country_ie(struct mwifiex_private *priv,
return 0;
}
+ if (!strncmp(priv->adapter->country_code, &country_ie[2], 2)) {
+ rcu_read_unlock();
+ wiphy_dbg(priv->wdev->wiphy,
+ "11D: skip setting domain info in FW\n");
+ return 0;
+ }
+ memcpy(priv->adapter->country_code, &country_ie[2], 2);
+
domain_info->country_code[0] = country_ie[2];
domain_info->country_code[1] = country_ie[3];
domain_info->country_code[2] = ' ';