aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-scan.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-07-10 23:53:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-14 14:53:00 -0400
commitd16dc48a2ea14af9980d0ea79d041f4b53e47b62 (patch)
tree618b7beca13838cd448412b1b501df6117eca1dc /drivers/net/wireless/iwlwifi/iwl-scan.c
parentec1a746042ea4c1c93065185897d6e8d3e7de894 (diff)
iwlwifi: unify 4965 and 5000 scanning code
This patch unifies 4965 and 5000 scanning code. We increases the version number to 1.3.27. Since new uCode iwlwifi-4965-2.ucode is required for 4965 cards. 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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 5b420b43af5c..cf24c2703c9b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -375,6 +375,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
375 u16 passive_dwell = 0; 375 u16 passive_dwell = 0;
376 u16 active_dwell = 0; 376 u16 active_dwell = 0;
377 int added, i; 377 int added, i;
378 u16 channel;
378 379
379 sband = iwl_get_hw_mode(priv, band); 380 sband = iwl_get_hw_mode(priv, band);
380 if (!sband) 381 if (!sband)
@@ -389,24 +390,25 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
389 if (channels[i].flags & IEEE80211_CHAN_DISABLED) 390 if (channels[i].flags & IEEE80211_CHAN_DISABLED)
390 continue; 391 continue;
391 392
392 scan_ch->channel = 393 channel =
393 ieee80211_frequency_to_channel(channels[i].center_freq); 394 ieee80211_frequency_to_channel(channels[i].center_freq);
395 scan_ch->channel = cpu_to_le16(channel);
394 396
395 ch_info = iwl_get_channel_info(priv, band, scan_ch->channel); 397 ch_info = iwl_get_channel_info(priv, band, channel);
396 if (!is_channel_valid(ch_info)) { 398 if (!is_channel_valid(ch_info)) {
397 IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n", 399 IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n",
398 scan_ch->channel); 400 channel);
399 continue; 401 continue;
400 } 402 }
401 403
402 if (!is_active || is_channel_passive(ch_info) || 404 if (!is_active || is_channel_passive(ch_info) ||
403 (channels[i].flags & IEEE80211_CHAN_PASSIVE_SCAN)) 405 (channels[i].flags & IEEE80211_CHAN_PASSIVE_SCAN))
404 scan_ch->type = 0; 406 scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
405 else 407 else
406 scan_ch->type = 1; 408 scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE;
407 409
408 if (scan_ch->type & 1) 410 if (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE)
409 scan_ch->type |= (direct_mask << 1); 411 scan_ch->type |= cpu_to_le32(direct_mask << 1);
410 412
411 scan_ch->active_dwell = cpu_to_le16(active_dwell); 413 scan_ch->active_dwell = cpu_to_le16(active_dwell);
412 scan_ch->passive_dwell = cpu_to_le16(passive_dwell); 414 scan_ch->passive_dwell = cpu_to_le16(passive_dwell);
@@ -425,9 +427,10 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv,
425 } 427 }
426 428
427 IWL_DEBUG_SCAN("Scanning %d [%s %d]\n", 429 IWL_DEBUG_SCAN("Scanning %d [%s %d]\n",
428 scan_ch->channel, 430 channel,
429 (scan_ch->type & 1) ? "ACTIVE" : "PASSIVE", 431 (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) ?
430 (scan_ch->type & 1) ? 432 "ACTIVE" : "PASSIVE",
433 (scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) ?
431 active_dwell : passive_dwell); 434 active_dwell : passive_dwell);
432 435
433 scan_ch++; 436 scan_ch++;