mwifiex: abort remaining scan commands when association started
authorBing Zhao <bzhao@marvell.com>
Thu, 9 May 2013 18:57:11 +0000 (11:57 -0700)
committerChromeBot <chrome-bot@google.com>
Fri, 10 May 2013 23:37:00 +0000 (16:37 -0700)
A full-channel scan is split to multiple scan commands in driver
before they are sent to firmware. When each scan result is back
the SSID entries are parsed and informed to cfg80211 directly.

It's observed that sometimes userspace may initiate association
as soon as the target AP is found. During the 4-way handshake
firmware may go off-channel to scan the remaining channels.
This causes the 4-way handshake to fail.

Fix it by checking 'scan_block' flag and aborting the remaining
scan in this case. 'scan_block' flag is set after association
and before 4-way handshake. It gets cleared after 4-way handshake
is completed.

BUG=chrome-os-partner:18188
TEST=autotest against CrOS_chaos_WesternDigital_5 (Jason Abele)

Change-Id: Ibda61178f2aee7228989bedb511eb2abc5a40343
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/50687
Reviewed-by: Paul Stewart <pstew@chromium.org>
drivers/net/wireless/mwifiex/scan.c

index 5ff33b4..b36950b 100644 (file)
@@ -1752,7 +1752,8 @@ check_next_scan:
                        dev_dbg(adapter->dev, "info: scan already aborted\n");
                }
        } else {
-               if (priv->scan_aborting && !priv->scan_request) {
+               if ((priv->scan_aborting && !priv->scan_request) ||
+                   priv->scan_block) {
                        spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
                                               flags);
                        adapter->scan_delay_cnt = MWIFIEX_MAX_SCAN_DELAY_CNT;