aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c33
1 files changed, 18 insertions, 15 deletions
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);