aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2011-05-03 23:11:45 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-05 14:59:15 -0400
commit57f16b5da03784d1660133fbec7281ea5735da69 (patch)
tree33635aa591d5ab0332dea61cdf6f64dc6b3b0ca6
parent85e09b40405b44b049500702beb6856646b4be46 (diff)
mwifiex: fix simultaneous assoc and scan issue
When scan and assoc (infra/ibss) commands are simultaneously given in two terminals, association response is erroneously served while serving the scan response. mwifiex_cfg80211_results() is the common routine for sending ioctl (scan, assoc etc.) results to cfg80211 stack. In above scenario even if the common routine is called for scan ioctl context, it also tries to send information about assoc ioctl to cfg80211 because "priv->assoc_request/priv->ibss_join_request" flag is on at that time. Fix the issue by updating request variable after assoc handling and modifying the variable check in mwifiex_cfg80211_results. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c11
-rw-r--r--drivers/net/wireless/mwifiex/main.h4
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 98009e2194c5..77a80296b6cb 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1044,7 +1044,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
1044 goto done; 1044 goto done;
1045 } 1045 }
1046 1046
1047 priv->assoc_request = 1; 1047 priv->assoc_request = -EINPROGRESS;
1048 1048
1049 wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n", 1049 wiphy_dbg(wiphy, "info: Trying to associate to %s and bssid %pM\n",
1050 (char *) sme->ssid, sme->bssid); 1050 (char *) sme->ssid, sme->bssid);
@@ -1052,6 +1052,7 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
1052 ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid, 1052 ret = mwifiex_cfg80211_assoc(priv, sme->ssid_len, sme->ssid, sme->bssid,
1053 priv->bss_mode, sme->channel, sme, 0); 1053 priv->bss_mode, sme->channel, sme, 0);
1054 1054
1055 priv->assoc_request = 1;
1055done: 1056done:
1056 priv->assoc_result = ret; 1057 priv->assoc_result = ret;
1057 queue_work(priv->workqueue, &priv->cfg_workqueue); 1058 queue_work(priv->workqueue, &priv->cfg_workqueue);
@@ -1080,7 +1081,7 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
1080 goto done; 1081 goto done;
1081 } 1082 }
1082 1083
1083 priv->ibss_join_request = 1; 1084 priv->ibss_join_request = -EINPROGRESS;
1084 1085
1085 wiphy_dbg(wiphy, "info: trying to join to %s and bssid %pM\n", 1086 wiphy_dbg(wiphy, "info: trying to join to %s and bssid %pM\n",
1086 (char *) params->ssid, params->bssid); 1087 (char *) params->ssid, params->bssid);
@@ -1088,6 +1089,8 @@ mwifiex_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
1088 ret = mwifiex_cfg80211_assoc(priv, params->ssid_len, params->ssid, 1089 ret = mwifiex_cfg80211_assoc(priv, params->ssid_len, params->ssid,
1089 params->bssid, priv->bss_mode, 1090 params->bssid, priv->bss_mode,
1090 params->channel, NULL, params->privacy); 1091 params->channel, NULL, params->privacy);
1092
1093 priv->ibss_join_request = 1;
1091done: 1094done:
1092 priv->ibss_join_result = ret; 1095 priv->ibss_join_result = ret;
1093 queue_work(priv->workqueue, &priv->cfg_workqueue); 1096 queue_work(priv->workqueue, &priv->cfg_workqueue);
@@ -1380,7 +1383,7 @@ done:
1380 kfree(scan_req); 1383 kfree(scan_req);
1381 } 1384 }
1382 1385
1383 if (priv->assoc_request) { 1386 if (priv->assoc_request == 1) {
1384 if (!priv->assoc_result) { 1387 if (!priv->assoc_result) {
1385 cfg80211_connect_result(priv->netdev, priv->cfg_bssid, 1388 cfg80211_connect_result(priv->netdev, priv->cfg_bssid,
1386 NULL, 0, NULL, 0, 1389 NULL, 0, NULL, 0,
@@ -1399,7 +1402,7 @@ done:
1399 priv->assoc_result = 0; 1402 priv->assoc_result = 0;
1400 } 1403 }
1401 1404
1402 if (priv->ibss_join_request) { 1405 if (priv->ibss_join_request == 1) {
1403 if (!priv->ibss_join_result) { 1406 if (!priv->ibss_join_result) {
1404 cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid, 1407 cfg80211_ibss_joined(priv->netdev, priv->cfg_bssid,
1405 GFP_KERNEL); 1408 GFP_KERNEL);
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 5043fcd22565..b4bb5ec4723e 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -479,9 +479,9 @@ struct mwifiex_private {
479 u8 report_scan_result; 479 u8 report_scan_result;
480 struct cfg80211_scan_request *scan_request; 480 struct cfg80211_scan_request *scan_request;
481 int scan_result_status; 481 int scan_result_status;
482 bool assoc_request; 482 int assoc_request;
483 u16 assoc_result; 483 u16 assoc_result;
484 bool ibss_join_request; 484 int ibss_join_request;
485 u16 ibss_join_result; 485 u16 ibss_join_result;
486 bool disconnect; 486 bool disconnect;
487 u8 cfg_bssid[6]; 487 u8 cfg_bssid[6];