aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 5ca181f7125d..5b420b43af5c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -276,13 +276,18 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
276 cancel_delayed_work(&priv->scan_check); 276 cancel_delayed_work(&priv->scan_check);
277 277
278 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n", 278 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n",
279 (priv->scan_bands == 2) ? "2.4" : "5.2", 279 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?
280 "2.4" : "5.2",
280 jiffies_to_msecs(elapsed_jiffies 281 jiffies_to_msecs(elapsed_jiffies
281 (priv->scan_pass_start, jiffies))); 282 (priv->scan_pass_start, jiffies)));
282 283
283 /* Remove this scanned band from the list 284 /* Remove this scanned band from the list of pending
284 * of pending bands to scan */ 285 * bands to scan, band G precedes A in order of scanning
285 priv->scan_bands--; 286 * as seen in iwl_bg_request_scan */
287 if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ))
288 priv->scan_bands &= ~BIT(IEEE80211_BAND_2GHZ);
289 else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ))
290 priv->scan_bands &= ~BIT(IEEE80211_BAND_5GHZ);
286 291
287 /* If a request to abort was given, or the scan did not succeed 292 /* If a request to abort was given, or the scan did not succeed
288 * then we reset the scan state machine and terminate, 293 * then we reset the scan state machine and terminate,
@@ -292,7 +297,7 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
292 clear_bit(STATUS_SCAN_ABORTING, &priv->status); 297 clear_bit(STATUS_SCAN_ABORTING, &priv->status);
293 } else { 298 } else {
294 /* If there are more bands on this scan pass reschedule */ 299 /* If there are more bands on this scan pass reschedule */
295 if (priv->scan_bands > 0) 300 if (priv->scan_bands)
296 goto reschedule; 301 goto reschedule;
297 } 302 }
298 303
@@ -389,7 +394,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
389 394
390 ch_info = iwl_get_channel_info(priv, band, scan_ch->channel); 395 ch_info = iwl_get_channel_info(priv, band, scan_ch->channel);
391 if (!is_channel_valid(ch_info)) { 396 if (!is_channel_valid(ch_info)) {
392 IWL_DEBUG_SCAN("Channel %d is INVALID for this SKU.\n", 397 IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n",
393 scan_ch->channel); 398 scan_ch->channel);
394 continue; 399 continue;
395 } 400 }
@@ -465,7 +470,10 @@ int iwl_scan_initiate(struct iwl_priv *priv)
465 } 470 }
466 471
467 IWL_DEBUG_INFO("Starting scan...\n"); 472 IWL_DEBUG_INFO("Starting scan...\n");
468 priv->scan_bands = 2; 473 if (priv->cfg->sku & IWL_SKU_G)
474 priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ);
475 if (priv->cfg->sku & IWL_SKU_A)
476 priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ);
469 set_bit(STATUS_SCANNING, &priv->status); 477 set_bit(STATUS_SCANNING, &priv->status);
470 priv->scan_start = jiffies; 478 priv->scan_start = jiffies;
471 priv->scan_pass_start = priv->scan_start; 479 priv->scan_pass_start = priv->scan_start;
@@ -803,8 +811,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
803 scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; 811 scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
804 812
805 813
806 switch (priv->scan_bands) { 814 if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) {
807 case 2:
808 band = IEEE80211_BAND_2GHZ; 815 band = IEEE80211_BAND_2GHZ;
809 scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK; 816 scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;
810 tx_ant = iwl_scan_tx_ant(priv, band); 817 tx_ant = iwl_scan_tx_ant(priv, band);
@@ -818,9 +825,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
818 tx_ant | 825 tx_ant |
819 RATE_MCS_CCK_MSK); 826 RATE_MCS_CCK_MSK);
820 scan->good_CRC_th = 0; 827 scan->good_CRC_th = 0;
821 break; 828 } else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ)) {
822
823 case 1:
824 band = IEEE80211_BAND_5GHZ; 829 band = IEEE80211_BAND_5GHZ;
825 tx_ant = iwl_scan_tx_ant(priv, band); 830 tx_ant = iwl_scan_tx_ant(priv, band);
826 scan->tx_cmd.rate_n_flags = 831 scan->tx_cmd.rate_n_flags =
@@ -833,9 +838,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
833 * MIMO is not used here, but value is required */ 838 * MIMO is not used here, but value is required */
834 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) 839 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965)
835 rx_chain = 0x6; 840 rx_chain = 0x6;
836 841 } else {
837 break;
838 default:
839 IWL_WARNING("Invalid scan band count\n"); 842 IWL_WARNING("Invalid scan band count\n");
840 goto done; 843 goto done;
841 } 844 }