diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2011-10-01 15:13:52 +0100 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-10-02 09:41:01 +0100 |
commit | 43d8988070c6ff1f9d147224b5a91e2cb31867db (patch) | |
tree | 2d3ce2f08c5792277722ca2284757aeb14d271c3 | |
parent | 1b46de45495c046a588b86cf96b3cae176ab6a67 (diff) |
net: wireless: bcmdhd: Skip disassoc if country is not changed in country set
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | drivers/net/wireless/bcmdhd/wldev_common.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/bcmdhd/wldev_common.c b/drivers/net/wireless/bcmdhd/wldev_common.c index b01e4a2b8c9..e69561e1bf3 100644 --- a/drivers/net/wireless/bcmdhd/wldev_common.c +++ b/drivers/net/wireless/bcmdhd/wldev_common.c @@ -309,11 +309,19 @@ int wldev_set_country( if (!country_code) return error; - bzero(&scbval, sizeof(scb_val_t)); - error = wldev_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scb_val_t), 1); - if (error < 0) { - DHD_ERROR(("%s: set country failed due to Disassoc error\n", __FUNCTION__)); - return error; + error = wldev_iovar_getbuf(dev, "country", &cspec, sizeof(cspec), + smbuf, sizeof(smbuf)); + if (error < 0) + DHD_ERROR(("%s: get country failed = %d\n", __FUNCTION__, error)); + + if ((error < 0) || + (strncmp(country_code, smbuf, WLC_CNTRY_BUF_SZ) != 0)) { + bzero(&scbval, sizeof(scb_val_t)); + error = wldev_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scb_val_t), 1); + if (error < 0) { + DHD_ERROR(("%s: set country failed due to Disassoc error\n", __FUNCTION__)); + return error; + } } cspec.rev = -1; memcpy(cspec.country_abbrev, country_code, WLC_CNTRY_BUF_SZ); |