aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
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
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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c23
5 files changed, 33 insertions, 23 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index a20adab6163a..9afecb813716 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -49,6 +49,13 @@
49static int iwl4965_send_tx_power(struct iwl_priv *priv); 49static int iwl4965_send_tx_power(struct iwl_priv *priv);
50static int iwl4965_hw_get_temperature(const struct iwl_priv *priv); 50static int iwl4965_hw_get_temperature(const struct iwl_priv *priv);
51 51
52/* Change firmware file name, using "-" and incrementing number,
53 * *only* when uCode interface or architecture changes so that it
54 * is not compatible with earlier drivers.
55 * This number will also appear in << 8 position of 1st dword of uCode file */
56#define IWL4965_UCODE_API "-2"
57
58
52/* module parameters */ 59/* module parameters */
53static struct iwl_mod_params iwl4965_mod_params = { 60static struct iwl_mod_params iwl4965_mod_params = {
54 .num_of_queues = IWL49_NUM_QUEUES, 61 .num_of_queues = IWL49_NUM_QUEUES,
@@ -2454,6 +2461,9 @@ struct iwl_cfg iwl4965_agn_cfg = {
2454 .mod_params = &iwl4965_mod_params, 2461 .mod_params = &iwl4965_mod_params,
2455}; 2462};
2456 2463
2464/* Module firmware */
2465MODULE_FIRMWARE("iwlwifi-4965" IWL4965_UCODE_API ".ucode");
2466
2457module_param_named(antenna, iwl4965_mod_params.antenna, int, 0444); 2467module_param_named(antenna, iwl4965_mod_params.antenna, int, 0444);
2458MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])"); 2468MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
2459module_param_named(disable, iwl4965_mod_params.disable, int, 0444); 2469module_param_named(disable, iwl4965_mod_params.disable, int, 0444);
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 3e96df8e8108..e9bb1de0ce3f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -2099,6 +2099,9 @@ struct iwl_ct_kill_config {
2099 * 2099 *
2100 *****************************************************************************/ 2100 *****************************************************************************/
2101 2101
2102#define SCAN_CHANNEL_TYPE_PASSIVE __constant_cpu_to_le32(0)
2103#define SCAN_CHANNEL_TYPE_ACTIVE __constant_cpu_to_le32(1)
2104
2102/** 2105/**
2103 * struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table 2106 * struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table
2104 * 2107 *
@@ -2122,12 +2125,12 @@ struct iwl_scan_channel {
2122 /* 2125 /*
2123 * type is defined as: 2126 * type is defined as:
2124 * 0:0 1 = active, 0 = passive 2127 * 0:0 1 = active, 0 = passive
2125 * 1:4 SSID direct bit map; if a bit is set, then corresponding 2128 * 1:20 SSID direct bit map; if a bit is set, then corresponding
2126 * SSID IE is transmitted in probe request. 2129 * SSID IE is transmitted in probe request.
2127 * 5:7 reserved 2130 * 21:31 reserved
2128 */ 2131 */
2129 u8 type; 2132 __le32 type;
2130 u8 channel; /* band is selected by iwl4965_scan_cmd "flags" field */ 2133 __le16 channel; /* band is selected by iwl_scan_cmd "flags" field */
2131 u8 tx_gain; /* gain for analog radio */ 2134 u8 tx_gain; /* gain for analog radio */
2132 u8 dsp_atten; /* gain for DSP */ 2135 u8 dsp_atten; /* gain for DSP */
2133 __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */ 2136 __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */
@@ -2147,9 +2150,9 @@ struct iwl_ssid_ie {
2147 u8 ssid[32]; 2150 u8 ssid[32];
2148} __attribute__ ((packed)); 2151} __attribute__ ((packed));
2149 2152
2150#define PROBE_OPTION_MAX 0x4 2153#define PROBE_OPTION_MAX 0x14
2151#define TX_CMD_LIFE_TIME_INFINITE __constant_cpu_to_le32(0xFFFFFFFF) 2154#define TX_CMD_LIFE_TIME_INFINITE __constant_cpu_to_le32(0xFFFFFFFF)
2152#define IWL_GOOD_CRC_TH __constant_cpu_to_le16(1) 2155#define IWL_GOOD_CRC_TH __constant_cpu_to_le16(1)
2153#define IWL_MAX_SCAN_SIZE 1024 2156#define IWL_MAX_SCAN_SIZE 1024
2154 2157
2155/* 2158/*
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 0293ae91c350..db66114f1e56 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -70,7 +70,7 @@ struct iwl_host_cmd;
70struct iwl_cmd; 70struct iwl_cmd;
71 71
72 72
73#define IWLWIFI_VERSION "1.2.26k" 73#define IWLWIFI_VERSION "1.3.27k"
74#define DRV_COPYRIGHT "Copyright(c) 2003-2008 Intel Corporation" 74#define DRV_COPYRIGHT "Copyright(c) 2003-2008 Intel Corporation"
75 75
76#define IWL_PCI_DEVICE(dev, subdev, cfg) \ 76#define IWL_PCI_DEVICE(dev, subdev, cfg) \
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 84a3ecfec484..4d789e353e3a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -54,12 +54,6 @@ extern struct iwl_cfg iwl5350_agn_cfg;
54extern struct iwl_cfg iwl5100_bg_cfg; 54extern struct iwl_cfg iwl5100_bg_cfg;
55extern struct iwl_cfg iwl5100_abg_cfg; 55extern struct iwl_cfg iwl5100_abg_cfg;
56 56
57/* Change firmware file name, using "-" and incrementing number,
58 * *only* when uCode interface or architecture changes so that it
59 * is not compatible with earlier drivers.
60 * This number will also appear in << 8 position of 1st dword of uCode file */
61#define IWL4965_UCODE_API "-1"
62
63/* CT-KILL constants */ 57/* CT-KILL constants */
64#define CT_KILL_THRESHOLD 110 /* in Celsius */ 58#define CT_KILL_THRESHOLD 110 /* in Celsius */
65 59
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++;