aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2009-02-10 18:19:02 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-13 13:46:04 -0500
commit3fdb68de22c9881691c485b05ed3204bdc431a18 (patch)
tree6a898270c086aa90c7f9716504a73376c811c63b /drivers/net/wireless/iwlwifi/iwl-4965.c
parentfe3d2c3fe32dd4d0a421ba39caba1cf87402314e (diff)
iwlwifi: use pci registers defined in pci_regs.h
This patch replaces where possible usage of pci register defined in the driver by ones defined in pci_regs.h Signed-off-by: Tomas Winkler <tomas.winkler@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.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 0638f3e37602..ead947b4d303 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -381,27 +381,30 @@ out:
381static void iwl4965_nic_config(struct iwl_priv *priv) 381static void iwl4965_nic_config(struct iwl_priv *priv)
382{ 382{
383 unsigned long flags; 383 unsigned long flags;
384 u32 val; 384 u16 dctl;
385 u16 radio_cfg; 385 u16 radio_cfg;
386 u16 link; 386 u16 lctl;
387 387
388 spin_lock_irqsave(&priv->lock, flags); 388 spin_lock_irqsave(&priv->lock, flags);
389 389
390 if ((priv->rev_id & 0x80) == 0x80 && (priv->rev_id & 0x7f) < 8) { 390 if ((priv->rev_id & 0x80) == 0x80 && (priv->rev_id & 0x7f) < 8) {
391 pci_read_config_dword(priv->pci_dev, PCI_REG_WUM8, &val); 391 int pos = pci_find_capability(priv->pci_dev, PCI_CAP_ID_EXP);
392 pci_read_config_word(priv->pci_dev, pos + PCI_EXP_DEVCTL, &dctl);
393
392 /* Enable No Snoop field */ 394 /* Enable No Snoop field */
393 pci_write_config_dword(priv->pci_dev, PCI_REG_WUM8, 395 pci_write_config_word(priv->pci_dev, pos + PCI_EXP_DEVCTL,
394 val & ~(1 << 11)); 396 dctl & ~PCI_EXP_DEVCTL_NOSNOOP_EN);
395 } 397 }
396 398
397 pci_read_config_word(priv->pci_dev, PCI_CFG_LINK_CTRL, &link); 399 lctl = iwl_pcie_link_ctl(priv);
398 400
399 /* L1 is enabled by BIOS */ 401 /* HW bug W/A - negligible power consumption */
400 if ((link & PCI_CFG_LINK_CTRL_VAL_L1_EN) == PCI_CFG_LINK_CTRL_VAL_L1_EN) 402 /* L1-ASPM is enabled by BIOS */
401 /* disable L0S disabled L1A enabled */ 403 if ((lctl & PCI_CFG_LINK_CTRL_VAL_L1_EN) == PCI_CFG_LINK_CTRL_VAL_L1_EN)
404 /* L1-ASPM enabled: disable L0S */
402 iwl_set_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); 405 iwl_set_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED);
403 else 406 else
404 /* L0S enabled L1A disabled */ 407 /* L1-ASPM disabled: enable L0S */
405 iwl_clear_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); 408 iwl_clear_bit(priv, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED);
406 409
407 radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG); 410 radio_cfg = iwl_eeprom_query16(priv, EEPROM_RADIO_CONFIG);