iwlwifi: use scan while idle
authorJohannes Berg <johannes.berg@intel.com>
Thu, 15 Mar 2012 20:26:51 +0000 (13:26 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 9 Apr 2012 20:37:21 +0000 (16:37 -0400)
As idle is just a deep powersave mode for
the device, it will easily scan while idle
since that turns off powersave.

This reduces the number of commands sent
to the device when scanning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-mac80211.c
drivers/net/wireless/iwlwifi/iwl-scan.c

index b6805f8e9a014553cca088e4992aa09c421897f7..d2be4b60488da1698d4e8418e4b73167ca816d3d 100644 (file)
@@ -157,7 +157,8 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
         */
 
        hw->flags |= IEEE80211_HW_SUPPORTS_PS |
-                    IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
+                    IEEE80211_HW_SUPPORTS_DYNAMIC_PS |
+                    IEEE80211_HW_SCAN_WHILE_IDLE;
 
        if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE)
                hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
index 863ad0c4d50fdd4283c386b70fb39548b32cb0a6..4338d4942ed217811c64c254b9ef1e00d4b00b8f 100644 (file)
@@ -806,8 +806,12 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
        rate_flags |= iwl_ant_idx_to_flags(priv->scan_tx_ant[band]);
        scan->tx_cmd.rate_n_flags = iwl_hw_set_rate_n_flags(rate, rate_flags);
 
-       /* In power save mode use one chain, otherwise use all chains */
-       if (test_bit(STATUS_POWER_PMI, &priv->shrd->status)) {
+       /*
+        * In power save mode while associated use one chain,
+        * otherwise use all chains
+        */
+       if (test_bit(STATUS_POWER_PMI, &priv->shrd->status) &&
+           !(priv->hw->conf.flags & IEEE80211_CONF_IDLE)) {
                /* rx_ant has been set to all valid chains previously */
                active_chains = rx_ant &
                                ((u8)(priv->chain_noise_data.active_chains));