diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 63 |
1 files changed, 21 insertions, 42 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 1527dec7a267..a805e97b89af 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include "iwl-trans.h" | 45 | #include "iwl-trans.h" |
46 | #include "iwl-shared.h" | 46 | #include "iwl-shared.h" |
47 | #include "iwl-cfg.h" | 47 | #include "iwl-cfg.h" |
48 | #include "iwl-prph.h" | ||
48 | 49 | ||
49 | /* Highest firmware API version supported */ | 50 | /* Highest firmware API version supported */ |
50 | #define IWL5000_UCODE_API_MAX 5 | 51 | #define IWL5000_UCODE_API_MAX 5 |
@@ -63,12 +64,8 @@ | |||
63 | /* NIC configuration for 5000 series */ | 64 | /* NIC configuration for 5000 series */ |
64 | static void iwl5000_nic_config(struct iwl_priv *priv) | 65 | static void iwl5000_nic_config(struct iwl_priv *priv) |
65 | { | 66 | { |
66 | unsigned long flags; | ||
67 | |||
68 | iwl_rf_config(priv); | 67 | iwl_rf_config(priv); |
69 | 68 | ||
70 | spin_lock_irqsave(&priv->shrd->lock, flags); | ||
71 | |||
72 | /* W/A : NIC is stuck in a reset state after Early PCIe power off | 69 | /* W/A : NIC is stuck in a reset state after Early PCIe power off |
73 | * (PCIe power is lost before PERST# is asserted), | 70 | * (PCIe power is lost before PERST# is asserted), |
74 | * causing ME FW to lose ownership and not being able to obtain it back. | 71 | * causing ME FW to lose ownership and not being able to obtain it back. |
@@ -76,14 +73,10 @@ static void iwl5000_nic_config(struct iwl_priv *priv) | |||
76 | iwl_set_bits_mask_prph(trans(priv), APMG_PS_CTRL_REG, | 73 | iwl_set_bits_mask_prph(trans(priv), APMG_PS_CTRL_REG, |
77 | APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, | 74 | APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, |
78 | ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); | 75 | ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); |
79 | |||
80 | |||
81 | spin_unlock_irqrestore(&priv->shrd->lock, flags); | ||
82 | } | 76 | } |
83 | 77 | ||
84 | static struct iwl_sensitivity_ranges iwl5000_sensitivity = { | 78 | static const struct iwl_sensitivity_ranges iwl5000_sensitivity = { |
85 | .min_nrg_cck = 100, | 79 | .min_nrg_cck = 100, |
86 | .max_nrg_cck = 0, /* not used, set to 0 */ | ||
87 | .auto_corr_min_ofdm = 90, | 80 | .auto_corr_min_ofdm = 90, |
88 | .auto_corr_min_ofdm_mrc = 170, | 81 | .auto_corr_min_ofdm_mrc = 170, |
89 | .auto_corr_min_ofdm_x1 = 105, | 82 | .auto_corr_min_ofdm_x1 = 105, |
@@ -108,7 +101,6 @@ static struct iwl_sensitivity_ranges iwl5000_sensitivity = { | |||
108 | 101 | ||
109 | static struct iwl_sensitivity_ranges iwl5150_sensitivity = { | 102 | static struct iwl_sensitivity_ranges iwl5150_sensitivity = { |
110 | .min_nrg_cck = 95, | 103 | .min_nrg_cck = 95, |
111 | .max_nrg_cck = 0, /* not used, set to 0 */ | ||
112 | .auto_corr_min_ofdm = 90, | 104 | .auto_corr_min_ofdm = 90, |
113 | .auto_corr_min_ofdm_mrc = 170, | 105 | .auto_corr_min_ofdm_mrc = 170, |
114 | .auto_corr_min_ofdm_x1 = 105, | 106 | .auto_corr_min_ofdm_x1 = 105, |
@@ -164,20 +156,13 @@ static void iwl5000_set_ct_threshold(struct iwl_priv *priv) | |||
164 | 156 | ||
165 | static void iwl5000_hw_set_hw_params(struct iwl_priv *priv) | 157 | static void iwl5000_hw_set_hw_params(struct iwl_priv *priv) |
166 | { | 158 | { |
167 | if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES && | ||
168 | iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES) | ||
169 | cfg(priv)->base_params->num_of_queues = | ||
170 | iwlagn_mod_params.num_of_queues; | ||
171 | |||
172 | hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues; | ||
173 | |||
174 | hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | | 159 | hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | |
175 | BIT(IEEE80211_BAND_5GHZ); | 160 | BIT(IEEE80211_BAND_5GHZ); |
176 | 161 | ||
177 | hw_params(priv).tx_chains_num = num_of_ant(cfg(priv)->valid_tx_ant); | 162 | hw_params(priv).tx_chains_num = |
178 | hw_params(priv).rx_chains_num = num_of_ant(cfg(priv)->valid_rx_ant); | 163 | num_of_ant(hw_params(priv).valid_tx_ant); |
179 | hw_params(priv).valid_tx_ant = cfg(priv)->valid_tx_ant; | 164 | hw_params(priv).rx_chains_num = |
180 | hw_params(priv).valid_rx_ant = cfg(priv)->valid_rx_ant; | 165 | num_of_ant(hw_params(priv).valid_rx_ant); |
181 | 166 | ||
182 | iwl5000_set_ct_threshold(priv); | 167 | iwl5000_set_ct_threshold(priv); |
183 | 168 | ||
@@ -187,20 +172,13 @@ static void iwl5000_hw_set_hw_params(struct iwl_priv *priv) | |||
187 | 172 | ||
188 | static void iwl5150_hw_set_hw_params(struct iwl_priv *priv) | 173 | static void iwl5150_hw_set_hw_params(struct iwl_priv *priv) |
189 | { | 174 | { |
190 | if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES && | ||
191 | iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES) | ||
192 | cfg(priv)->base_params->num_of_queues = | ||
193 | iwlagn_mod_params.num_of_queues; | ||
194 | |||
195 | hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues; | ||
196 | |||
197 | hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | | 175 | hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | |
198 | BIT(IEEE80211_BAND_5GHZ); | 176 | BIT(IEEE80211_BAND_5GHZ); |
199 | 177 | ||
200 | hw_params(priv).tx_chains_num = num_of_ant(cfg(priv)->valid_tx_ant); | 178 | hw_params(priv).tx_chains_num = |
201 | hw_params(priv).rx_chains_num = num_of_ant(cfg(priv)->valid_rx_ant); | 179 | num_of_ant(hw_params(priv).valid_tx_ant); |
202 | hw_params(priv).valid_tx_ant = cfg(priv)->valid_tx_ant; | 180 | hw_params(priv).rx_chains_num = |
203 | hw_params(priv).valid_rx_ant = cfg(priv)->valid_rx_ant; | 181 | num_of_ant(hw_params(priv).valid_rx_ant); |
204 | 182 | ||
205 | iwl5150_set_ct_threshold(priv); | 183 | iwl5150_set_ct_threshold(priv); |
206 | 184 | ||
@@ -288,7 +266,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv, | |||
288 | return -EFAULT; | 266 | return -EFAULT; |
289 | } | 267 | } |
290 | 268 | ||
291 | return iwl_trans_send_cmd(trans(priv), &hcmd); | 269 | return iwl_dvm_send_cmd(priv, &hcmd); |
292 | } | 270 | } |
293 | 271 | ||
294 | static struct iwl_lib_ops iwl5000_lib = { | 272 | static struct iwl_lib_ops iwl5000_lib = { |
@@ -327,7 +305,7 @@ static struct iwl_lib_ops iwl5150_lib = { | |||
327 | .temperature = iwl5150_temperature, | 305 | .temperature = iwl5150_temperature, |
328 | }; | 306 | }; |
329 | 307 | ||
330 | static struct iwl_base_params iwl5000_base_params = { | 308 | static const struct iwl_base_params iwl5000_base_params = { |
331 | .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, | 309 | .eeprom_size = IWLAGN_EEPROM_IMG_SIZE, |
332 | .num_of_queues = IWLAGN_NUM_QUEUES, | 310 | .num_of_queues = IWLAGN_NUM_QUEUES, |
333 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, | 311 | .num_of_ampdu_queues = IWLAGN_NUM_AMPDU_QUEUES, |
@@ -340,7 +318,8 @@ static struct iwl_base_params iwl5000_base_params = { | |||
340 | .no_idle_support = true, | 318 | .no_idle_support = true, |
341 | .wd_disable = true, | 319 | .wd_disable = true, |
342 | }; | 320 | }; |
343 | static struct iwl_ht_params iwl5000_ht_params = { | 321 | |
322 | static const struct iwl_ht_params iwl5000_ht_params = { | ||
344 | .ht_greenfield_support = true, | 323 | .ht_greenfield_support = true, |
345 | }; | 324 | }; |
346 | 325 | ||
@@ -356,7 +335,7 @@ static struct iwl_ht_params iwl5000_ht_params = { | |||
356 | .base_params = &iwl5000_base_params, \ | 335 | .base_params = &iwl5000_base_params, \ |
357 | .led_mode = IWL_LED_BLINK | 336 | .led_mode = IWL_LED_BLINK |
358 | 337 | ||
359 | struct iwl_cfg iwl5300_agn_cfg = { | 338 | const struct iwl_cfg iwl5300_agn_cfg = { |
360 | .name = "Intel(R) Ultimate N WiFi Link 5300 AGN", | 339 | .name = "Intel(R) Ultimate N WiFi Link 5300 AGN", |
361 | IWL_DEVICE_5000, | 340 | IWL_DEVICE_5000, |
362 | /* at least EEPROM 0x11A has wrong info */ | 341 | /* at least EEPROM 0x11A has wrong info */ |
@@ -365,7 +344,7 @@ struct iwl_cfg iwl5300_agn_cfg = { | |||
365 | .ht_params = &iwl5000_ht_params, | 344 | .ht_params = &iwl5000_ht_params, |
366 | }; | 345 | }; |
367 | 346 | ||
368 | struct iwl_cfg iwl5100_bgn_cfg = { | 347 | const struct iwl_cfg iwl5100_bgn_cfg = { |
369 | .name = "Intel(R) WiFi Link 5100 BGN", | 348 | .name = "Intel(R) WiFi Link 5100 BGN", |
370 | IWL_DEVICE_5000, | 349 | IWL_DEVICE_5000, |
371 | .valid_tx_ant = ANT_B, /* .cfg overwrite */ | 350 | .valid_tx_ant = ANT_B, /* .cfg overwrite */ |
@@ -373,14 +352,14 @@ struct iwl_cfg iwl5100_bgn_cfg = { | |||
373 | .ht_params = &iwl5000_ht_params, | 352 | .ht_params = &iwl5000_ht_params, |
374 | }; | 353 | }; |
375 | 354 | ||
376 | struct iwl_cfg iwl5100_abg_cfg = { | 355 | const struct iwl_cfg iwl5100_abg_cfg = { |
377 | .name = "Intel(R) WiFi Link 5100 ABG", | 356 | .name = "Intel(R) WiFi Link 5100 ABG", |
378 | IWL_DEVICE_5000, | 357 | IWL_DEVICE_5000, |
379 | .valid_tx_ant = ANT_B, /* .cfg overwrite */ | 358 | .valid_tx_ant = ANT_B, /* .cfg overwrite */ |
380 | .valid_rx_ant = ANT_AB, /* .cfg overwrite */ | 359 | .valid_rx_ant = ANT_AB, /* .cfg overwrite */ |
381 | }; | 360 | }; |
382 | 361 | ||
383 | struct iwl_cfg iwl5100_agn_cfg = { | 362 | const struct iwl_cfg iwl5100_agn_cfg = { |
384 | .name = "Intel(R) WiFi Link 5100 AGN", | 363 | .name = "Intel(R) WiFi Link 5100 AGN", |
385 | IWL_DEVICE_5000, | 364 | IWL_DEVICE_5000, |
386 | .valid_tx_ant = ANT_B, /* .cfg overwrite */ | 365 | .valid_tx_ant = ANT_B, /* .cfg overwrite */ |
@@ -388,7 +367,7 @@ struct iwl_cfg iwl5100_agn_cfg = { | |||
388 | .ht_params = &iwl5000_ht_params, | 367 | .ht_params = &iwl5000_ht_params, |
389 | }; | 368 | }; |
390 | 369 | ||
391 | struct iwl_cfg iwl5350_agn_cfg = { | 370 | const struct iwl_cfg iwl5350_agn_cfg = { |
392 | .name = "Intel(R) WiMAX/WiFi Link 5350 AGN", | 371 | .name = "Intel(R) WiMAX/WiFi Link 5350 AGN", |
393 | .fw_name_pre = IWL5000_FW_PRE, | 372 | .fw_name_pre = IWL5000_FW_PRE, |
394 | .ucode_api_max = IWL5000_UCODE_API_MAX, | 373 | .ucode_api_max = IWL5000_UCODE_API_MAX, |
@@ -418,14 +397,14 @@ struct iwl_cfg iwl5350_agn_cfg = { | |||
418 | .led_mode = IWL_LED_BLINK, \ | 397 | .led_mode = IWL_LED_BLINK, \ |
419 | .internal_wimax_coex = true | 398 | .internal_wimax_coex = true |
420 | 399 | ||
421 | struct iwl_cfg iwl5150_agn_cfg = { | 400 | const struct iwl_cfg iwl5150_agn_cfg = { |
422 | .name = "Intel(R) WiMAX/WiFi Link 5150 AGN", | 401 | .name = "Intel(R) WiMAX/WiFi Link 5150 AGN", |
423 | IWL_DEVICE_5150, | 402 | IWL_DEVICE_5150, |
424 | .ht_params = &iwl5000_ht_params, | 403 | .ht_params = &iwl5000_ht_params, |
425 | 404 | ||
426 | }; | 405 | }; |
427 | 406 | ||
428 | struct iwl_cfg iwl5150_abg_cfg = { | 407 | const struct iwl_cfg iwl5150_abg_cfg = { |
429 | .name = "Intel(R) WiMAX/WiFi Link 5150 ABG", | 408 | .name = "Intel(R) WiMAX/WiFi Link 5150 ABG", |
430 | IWL_DEVICE_5150, | 409 | IWL_DEVICE_5150, |
431 | }; | 410 | }; |