mwifiex: fix 5G association failure after leaving 2.4G IBSS
authorXinming Hu <huxm@marvell.com>
Fri, 12 Sep 2014 14:38:50 +0000 (20:08 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 15 Sep 2014 19:00:51 +0000 (15:00 -0400)
When assocaiting to an AP , mwifiex set supported data rates
based on target AP's capability. For 5G AP(11a mode), a/n/ac mode
would possibly be set.
However, for some chips which dont support 11AC mode current config_bands
will be used instead.

For example, if we join an IBSS in 11b mode ,adapter->config_bands
will be set to 1(11b mode). Then we leave IBSS ,and try to connect
5G a/n mode AP. At this time , only 11b mode data rates will be
supported in assoc request , which result in assoc failure with
reason code 18: Association denied due to requesting station not
supporting all rates.

This patch fix such a cornel case, by adding additional check for
current chip's 11ac capability.

Reported-by: Andreas Fenkart <afenkart@gmail.com>
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/sta_ioctl.c

index b95a29b..92f3eb8 100644 (file)
@@ -287,10 +287,13 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
                        return -1;
 
                if (mwifiex_band_to_radio_type(bss_desc->bss_band) ==
-                                               HostCmd_SCAN_RADIO_TYPE_BG)
+                                               HostCmd_SCAN_RADIO_TYPE_BG) {
                        config_bands = BAND_B | BAND_G | BAND_GN;
-               else
-                       config_bands = BAND_A | BAND_AN | BAND_AAC;
+               } else {
+                       config_bands = BAND_A | BAND_AN;
+                       if (adapter->fw_bands & BAND_AAC)
+                               config_bands |= BAND_AAC;
+               }
 
                if (!((config_bands | adapter->fw_bands) & ~adapter->fw_bands))
                        adapter->config_bands = config_bands;