diff options
author | Bing Zhao <bzhao@marvell.com> | 2012-10-05 23:21:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-08 15:06:02 -0400 |
commit | c2476335313e618c0368ffbe73e05bba4d0f5f89 (patch) | |
tree | e3f699424d9767e98ce9d2cb4605a59ad918c385 /drivers/net/wireless/mwifiex/scan.c | |
parent | 55fabefe3695241e6ccfa0cd4974f3fa497693dc (diff) |
mwifiex: return -EBUSY if scan request cannot be honored
There are cases we cannot scan when request is received.
For example, during WPA group key negociation the scan request
will be blocked. We should return an error code to cfg80211
because cfg80211_scan_done will never be called.
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/scan.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index e36a75988f87..bfb90a55117a 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -1296,7 +1296,7 @@ mwifiex_radio_type_to_band(u8 radio_type) | |||
1296 | int mwifiex_scan_networks(struct mwifiex_private *priv, | 1296 | int mwifiex_scan_networks(struct mwifiex_private *priv, |
1297 | const struct mwifiex_user_scan_cfg *user_scan_in) | 1297 | const struct mwifiex_user_scan_cfg *user_scan_in) |
1298 | { | 1298 | { |
1299 | int ret = 0; | 1299 | int ret; |
1300 | struct mwifiex_adapter *adapter = priv->adapter; | 1300 | struct mwifiex_adapter *adapter = priv->adapter; |
1301 | struct cmd_ctrl_node *cmd_node; | 1301 | struct cmd_ctrl_node *cmd_node; |
1302 | union mwifiex_scan_cmd_config_tlv *scan_cfg_out; | 1302 | union mwifiex_scan_cmd_config_tlv *scan_cfg_out; |
@@ -1309,20 +1309,20 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, | |||
1309 | unsigned long flags; | 1309 | unsigned long flags; |
1310 | 1310 | ||
1311 | if (adapter->scan_processing) { | 1311 | if (adapter->scan_processing) { |
1312 | dev_dbg(adapter->dev, "cmd: Scan already in process...\n"); | 1312 | dev_err(adapter->dev, "cmd: Scan already in process...\n"); |
1313 | return ret; | 1313 | return -EBUSY; |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); | ||
1317 | adapter->scan_processing = true; | ||
1318 | spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); | ||
1319 | |||
1320 | if (priv->scan_block) { | 1316 | if (priv->scan_block) { |
1321 | dev_dbg(adapter->dev, | 1317 | dev_err(adapter->dev, |
1322 | "cmd: Scan is blocked during association...\n"); | 1318 | "cmd: Scan is blocked during association...\n"); |
1323 | return ret; | 1319 | return -EBUSY; |
1324 | } | 1320 | } |
1325 | 1321 | ||
1322 | spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); | ||
1323 | adapter->scan_processing = true; | ||
1324 | spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); | ||
1325 | |||
1326 | scan_cfg_out = kzalloc(sizeof(union mwifiex_scan_cmd_config_tlv), | 1326 | scan_cfg_out = kzalloc(sizeof(union mwifiex_scan_cmd_config_tlv), |
1327 | GFP_KERNEL); | 1327 | GFP_KERNEL); |
1328 | if (!scan_cfg_out) { | 1328 | if (!scan_cfg_out) { |