diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 33 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 33 |
2 files changed, 36 insertions, 30 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 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 47cf4b997f50..92d1b2e312d4 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -2217,7 +2217,10 @@ static int iwl3945_scan_initiate(struct iwl3945_priv *priv) | |||
2217 | } | 2217 | } |
2218 | 2218 | ||
2219 | IWL_DEBUG_INFO("Starting scan...\n"); | 2219 | IWL_DEBUG_INFO("Starting scan...\n"); |
2220 | priv->scan_bands = 2; | 2220 | if (priv->cfg->sku & IWL_SKU_G) |
2221 | priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ); | ||
2222 | if (priv->cfg->sku & IWL_SKU_A) | ||
2223 | priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ); | ||
2221 | set_bit(STATUS_SCANNING, &priv->status); | 2224 | set_bit(STATUS_SCANNING, &priv->status); |
2222 | priv->scan_start = jiffies; | 2225 | priv->scan_start = jiffies; |
2223 | priv->scan_pass_start = priv->scan_start; | 2226 | priv->scan_pass_start = priv->scan_start; |
@@ -3342,13 +3345,18 @@ static void iwl3945_rx_scan_complete_notif(struct iwl3945_priv *priv, | |||
3342 | cancel_delayed_work(&priv->scan_check); | 3345 | cancel_delayed_work(&priv->scan_check); |
3343 | 3346 | ||
3344 | IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n", | 3347 | IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n", |
3345 | (priv->scan_bands == 2) ? "2.4" : "5.2", | 3348 | (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ? |
3349 | "2.4" : "5.2", | ||
3346 | jiffies_to_msecs(elapsed_jiffies | 3350 | jiffies_to_msecs(elapsed_jiffies |
3347 | (priv->scan_pass_start, jiffies))); | 3351 | (priv->scan_pass_start, jiffies))); |
3348 | 3352 | ||
3349 | /* Remove this scanned band from the list | 3353 | /* Remove this scanned band from the list of pending |
3350 | * of pending bands to scan */ | 3354 | * bands to scan, band G precedes A in order of scanning |
3351 | priv->scan_bands--; | 3355 | * as seen in iwl3945_bg_request_scan */ |
3356 | if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) | ||
3357 | priv->scan_bands &= ~BIT(IEEE80211_BAND_2GHZ); | ||
3358 | else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ)) | ||
3359 | priv->scan_bands &= ~BIT(IEEE80211_BAND_5GHZ); | ||
3352 | 3360 | ||
3353 | /* If a request to abort was given, or the scan did not succeed | 3361 | /* If a request to abort was given, or the scan did not succeed |
3354 | * then we reset the scan state machine and terminate, | 3362 | * then we reset the scan state machine and terminate, |
@@ -4961,7 +4969,7 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv, | |||
4961 | 4969 | ||
4962 | ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel); | 4970 | ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel); |
4963 | if (!is_channel_valid(ch_info)) { | 4971 | if (!is_channel_valid(ch_info)) { |
4964 | IWL_DEBUG_SCAN("Channel %d is INVALID for this SKU.\n", | 4972 | IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n", |
4965 | scan_ch->channel); | 4973 | scan_ch->channel); |
4966 | continue; | 4974 | continue; |
4967 | } | 4975 | } |
@@ -6316,21 +6324,16 @@ static void iwl3945_bg_request_scan(struct work_struct *data) | |||
6316 | 6324 | ||
6317 | /* flags + rate selection */ | 6325 | /* flags + rate selection */ |
6318 | 6326 | ||
6319 | switch (priv->scan_bands) { | 6327 | if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) { |
6320 | case 2: | ||
6321 | scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK; | 6328 | scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK; |
6322 | scan->tx_cmd.rate = IWL_RATE_1M_PLCP; | 6329 | scan->tx_cmd.rate = IWL_RATE_1M_PLCP; |
6323 | scan->good_CRC_th = 0; | 6330 | scan->good_CRC_th = 0; |
6324 | band = IEEE80211_BAND_2GHZ; | 6331 | band = IEEE80211_BAND_2GHZ; |
6325 | break; | 6332 | } else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ)) { |
6326 | |||
6327 | case 1: | ||
6328 | scan->tx_cmd.rate = IWL_RATE_6M_PLCP; | 6333 | scan->tx_cmd.rate = IWL_RATE_6M_PLCP; |
6329 | scan->good_CRC_th = IWL_GOOD_CRC_TH; | 6334 | scan->good_CRC_th = IWL_GOOD_CRC_TH; |
6330 | band = IEEE80211_BAND_5GHZ; | 6335 | band = IEEE80211_BAND_5GHZ; |
6331 | break; | 6336 | } else { |
6332 | |||
6333 | default: | ||
6334 | IWL_WARNING("Invalid scan band count\n"); | 6337 | IWL_WARNING("Invalid scan band count\n"); |
6335 | goto done; | 6338 | goto done; |
6336 | } | 6339 | } |
@@ -6770,7 +6773,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co | |||
6770 | ch_info = iwl3945_get_channel_info(priv, conf->channel->band, | 6773 | ch_info = iwl3945_get_channel_info(priv, conf->channel->band, |
6771 | conf->channel->hw_value); | 6774 | conf->channel->hw_value); |
6772 | if (!is_channel_valid(ch_info)) { | 6775 | if (!is_channel_valid(ch_info)) { |
6773 | IWL_DEBUG_SCAN("Channel %d [%d] is INVALID for this SKU.\n", | 6776 | IWL_DEBUG_SCAN("Channel %d [%d] is INVALID for this band.\n", |
6774 | conf->channel->hw_value, conf->channel->band); | 6777 | conf->channel->hw_value, conf->channel->band); |
6775 | IWL_DEBUG_MAC80211("leave - invalid channel\n"); | 6778 | IWL_DEBUG_MAC80211("leave - invalid channel\n"); |
6776 | spin_unlock_irqrestore(&priv->lock, flags); | 6779 | spin_unlock_irqrestore(&priv->lock, flags); |