diff options
author | Ben Cahill <ben.m.cahill@intel.com> | 2009-10-23 16:42:21 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:49:59 -0400 |
commit | fadb3582a38c33d0f7c58ab7905d4dbc67f4c4d9 (patch) | |
tree | ff8f1bfc9aca5e200b0387069a2500850e9891eb /drivers/net/wireless/iwlwifi/iwl-4965.c | |
parent | 065e63b00cf13919010bbeff48f7a120033be448 (diff) |
iwlwifi: consolidate apm_init() functions
Consolidate most iwlXXXX_apm_init() functions into single iwl_apm_init().
Keep iwl3945_apm_init(), but leverage iwl_apm_init() for most functionality.
Update 4965 init sequence to follow most recent factory recommendations.
Add following members to struct iwl_cfg to guide the init sequence:
pll_cfg_val (replaces needs_pll_cfg), set_l0s, use_bsm
Move L0S enable/disable from nic_config() functions to iwl_apm_init().
This satisifies the "FIXME: put here L1A -L0S w/a" notice, and complies
with factory-recommended sequence.
Add debug info message in iwl_apm_init(), and symmetrical message
in iwl_apm_stop().
Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 56 |
1 files changed, 4 insertions, 52 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 1a622aa5a16..32d5f3de429 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -317,64 +317,13 @@ static void iwl4965_txq_set_sched(struct iwl_priv *priv, u32 mask) | |||
317 | iwl_write_prph(priv, IWL49_SCD_TXFACT, mask); | 317 | iwl_write_prph(priv, IWL49_SCD_TXFACT, mask); |
318 | } | 318 | } |
319 | 319 | ||
320 | static int iwl4965_apm_init(struct iwl_priv *priv) | ||
321 | { | ||
322 | int ret = 0; | ||
323 | |||
324 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, | ||
325 | CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); | ||
326 | |||
327 | /* disable L0s without affecting L1 :don't wait for ICH L0s bug W/A) */ | ||
328 | iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, | ||
329 | CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX); | ||
330 | |||
331 | /* set "initialization complete" bit to move adapter | ||
332 | * D0U* --> D0A* state */ | ||
333 | iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | ||
334 | |||
335 | /* wait for clock stabilization */ | ||
336 | ret = iwl_poll_bit(priv, CSR_GP_CNTRL, | ||
337 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, | ||
338 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); | ||
339 | if (ret < 0) { | ||
340 | IWL_DEBUG_INFO(priv, "Failed to init the card\n"); | ||
341 | goto out; | ||
342 | } | ||
343 | |||
344 | /* enable DMA */ | ||
345 | iwl_write_prph(priv, APMG_CLK_CTRL_REG, APMG_CLK_VAL_DMA_CLK_RQT | | ||
346 | APMG_CLK_VAL_BSM_CLK_RQT); | ||
347 | |||
348 | udelay(20); | ||
349 | |||
350 | /* disable L1-Active */ | ||
351 | iwl_set_bits_prph(priv, APMG_PCIDEV_STT_REG, | ||
352 | APMG_PCIDEV_STT_VAL_L1_ACT_DIS); | ||
353 | |||
354 | out: | ||
355 | return ret; | ||
356 | } | ||
357 | |||
358 | |||
359 | static void iwl4965_nic_config(struct iwl_priv *priv) | 320 | static void iwl4965_nic_config(struct iwl_priv *priv) |
360 | { | 321 | { |
361 | unsigned long flags; | 322 | unsigned long flags; |
362 | u16 radio_cfg; | 323 | u16 radio_cfg; |
363 | u16 lctl; | ||
364 | 324 | ||
365 | spin_lock_irqsave(&priv->lock, flags); | 325 | spin_lock_irqsave(&priv->lock, flags); |
366 | 326 | ||
367 | lctl = iwl_pcie_link_ctl(priv); | ||
368 | |||
369 | /* HW bug W/A - negligible power consumption */ | ||
370 | /* L1-ASPM is enabled by BIOS */ | ||
371 | if ((lctl & PCI_CFG_LINK_CTRL_VAL_L1_EN) == PCI_CFG_LINK_CTRL_VAL_L1_EN) | ||
372 | /* L1-ASPM enabled: disable L0S */ | ||
373 | iwl_set_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | ||
374 | else | ||
375 | /* L1-ASPM disabled: enable L0S */ | ||
376 | iwl_clear_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | ||
377 | |||
378 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); | 327 | radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); |
379 | 328 | ||
380 | /* write radio config values to register */ | 329 | /* write radio config values to register */ |
@@ -2223,7 +2172,7 @@ static struct iwl_lib_ops iwl4965_lib = { | |||
2223 | .dump_nic_event_log = iwl_dump_nic_event_log, | 2172 | .dump_nic_event_log = iwl_dump_nic_event_log, |
2224 | .dump_nic_error_log = iwl_dump_nic_error_log, | 2173 | .dump_nic_error_log = iwl_dump_nic_error_log, |
2225 | .apm_ops = { | 2174 | .apm_ops = { |
2226 | .init = iwl4965_apm_init, | 2175 | .init = iwl_apm_init, |
2227 | .stop = iwl_apm_stop, | 2176 | .stop = iwl_apm_stop, |
2228 | .config = iwl4965_nic_config, | 2177 | .config = iwl4965_nic_config, |
2229 | .set_pwr_src = iwl_set_pwr_src, | 2178 | .set_pwr_src = iwl_set_pwr_src, |
@@ -2276,6 +2225,9 @@ struct iwl_cfg iwl4965_agn_cfg = { | |||
2276 | .num_of_queues = IWL49_NUM_QUEUES, | 2225 | .num_of_queues = IWL49_NUM_QUEUES, |
2277 | .num_of_ampdu_queues = IWL49_NUM_AMPDU_QUEUES, | 2226 | .num_of_ampdu_queues = IWL49_NUM_AMPDU_QUEUES, |
2278 | .mod_params = &iwl4965_mod_params, | 2227 | .mod_params = &iwl4965_mod_params, |
2228 | .pll_cfg_val = 0, | ||
2229 | .set_l0s = true, | ||
2230 | .use_bsm = true, | ||
2279 | .use_isr_legacy = true, | 2231 | .use_isr_legacy = true, |
2280 | .ht_greenfield_support = false, | 2232 | .ht_greenfield_support = false, |
2281 | .broken_powersave = true, | 2233 | .broken_powersave = true, |