iwlwifi: allow consecutive scans in unassociated state
authorRon Rindjunsky <ron.rindjunsky@intel.com>
Wed, 3 Sep 2008 03:26:25 +0000 (11:26 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 8 Sep 2008 18:23:14 +0000 (14:23 -0400)
This patch allows consecutive scans requests when driver is in
unassociated state.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Esti Kummer <ester.kummer@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn.c

index 575c1d978288fb607ee59c2c7a4174d1fdd66953..7b8af9609e0874fec4378a7f3e6bc5c2160d3ac2 100644 (file)
@@ -3205,12 +3205,14 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t ssid_len)
        /* we don't schedule scan within next_scan_jiffies period */
        if (priv->next_scan_jiffies &&
            time_after(priv->next_scan_jiffies, jiffies)) {
+               IWL_DEBUG_SCAN("scan rejected: within next scan period\n");
                ret = -EAGAIN;
                goto out_unlock;
        }
        /* if we just finished scan ask for delay */
-       if (priv->last_scan_jiffies &&
+       if (iwl_is_associated(priv) && priv->last_scan_jiffies &&
            time_after(priv->last_scan_jiffies + IWL_DELAY_NEXT_SCAN, jiffies)) {
+               IWL_DEBUG_SCAN("scan rejected: within previous scan period\n");
                ret = -EAGAIN;
                goto out_unlock;
        }