summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUjjal Roy <royujjal@gmail.com>2014-07-17 18:49:55 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2014-07-18 17:45:26 (GMT)
commit71954f24c93fd569314985e9a7319b68e0b918e6 (patch)
tree978043e58789675247c4846ced7a8bb304e77e5a
parent9435d09146b3ab31e399e6c6ff2cf225dd0955d8 (diff)
downloadlinux-71954f24c93fd569314985e9a7319b68e0b918e6.tar.xz
mwifiex: do not re-associate when already connected
In managed mode if the driver is getting a re-associate command from cfg80211, driver deauthenticates with the AP internally and sends a disconnected event to cfg80211 before completion of its association process. The disconnected event then modifies the SSID length as wdev->ssid_len = 0. So, upon receiving the connect result event from driver, cfg80211 is unable to get that BSS from the device's BSS list and generates the following WARN_ON message. WARNING: CPU: 0 PID: 857 at net/wireless/sme.c:658 __cfg80211_connect_result+0x3a6/0x3e0 [cfg80211]() Avoid re-association while the device is already associated to a network. Also remove the internal deauthentication from the association path. Signed-off-by: Ujjal Roy <royujjal@gmail.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c8
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c10
2 files changed, 5 insertions, 13 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 6af135f..a738cc9 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1604,9 +1604,6 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len,
return -EINVAL;
}
- /* disconnect before try to associate */
- mwifiex_deauthenticate(priv, NULL);
-
/* As this is new association, clear locally stored
* keys and security related flags */
priv->sec_info.wpa_enabled = false;
@@ -1744,6 +1741,11 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
return -EINVAL;
}
+ if (priv->wdev && priv->wdev->current_bss) {
+ wiphy_warn(wiphy, "%s: already connected\n", dev->name);
+ return -EALREADY;
+ }
+
wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n",
(char *) sme->ssid, sme->bssid);
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 1a03d4d..caae973 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -283,10 +283,6 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
u8 config_bands;
- ret = mwifiex_deauthenticate(priv, NULL);
- if (ret)
- goto done;
-
if (!bss_desc)
return -1;
@@ -345,12 +341,6 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
goto done;
}
- /* Exit Adhoc mode first */
- dev_dbg(adapter->dev, "info: Sending Adhoc Stop\n");
- ret = mwifiex_deauthenticate(priv, NULL);
- if (ret)
- goto done;
-
priv->adhoc_is_link_sensed = false;
ret = mwifiex_check_network_compatibility(priv, bss_desc);