diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/pci.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 8 |
4 files changed, 12 insertions, 28 deletions
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index a978984d78a5..ef11dc639461 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c | |||
@@ -113,41 +113,32 @@ static void ath_pci_aspm_init(struct ath_common *common) | |||
113 | struct ath_hw *ah = sc->sc_ah; | 113 | struct ath_hw *ah = sc->sc_ah; |
114 | struct pci_dev *pdev = to_pci_dev(sc->dev); | 114 | struct pci_dev *pdev = to_pci_dev(sc->dev); |
115 | struct pci_dev *parent; | 115 | struct pci_dev *parent; |
116 | int pos; | 116 | u16 aspm; |
117 | u8 aspm; | ||
118 | 117 | ||
119 | if (!ah->is_pciexpress) | 118 | if (!ah->is_pciexpress) |
120 | return; | 119 | return; |
121 | 120 | ||
122 | pos = pci_pcie_cap(pdev); | ||
123 | if (!pos) | ||
124 | return; | ||
125 | |||
126 | parent = pdev->bus->self; | 121 | parent = pdev->bus->self; |
127 | if (!parent) | 122 | if (!parent) |
128 | return; | 123 | return; |
129 | 124 | ||
130 | if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) { | 125 | if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) { |
131 | /* Bluetooth coexistance requires disabling ASPM. */ | 126 | /* Bluetooth coexistance requires disabling ASPM. */ |
132 | pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &aspm); | 127 | pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, |
133 | aspm &= ~(PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); | 128 | PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); |
134 | pci_write_config_byte(pdev, pos + PCI_EXP_LNKCTL, aspm); | ||
135 | 129 | ||
136 | /* | 130 | /* |
137 | * Both upstream and downstream PCIe components should | 131 | * Both upstream and downstream PCIe components should |
138 | * have the same ASPM settings. | 132 | * have the same ASPM settings. |
139 | */ | 133 | */ |
140 | pos = pci_pcie_cap(parent); | 134 | pcie_capability_clear_word(parent, PCI_EXP_LNKCTL, |
141 | pci_read_config_byte(parent, pos + PCI_EXP_LNKCTL, &aspm); | 135 | PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); |
142 | aspm &= ~(PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); | ||
143 | pci_write_config_byte(parent, pos + PCI_EXP_LNKCTL, aspm); | ||
144 | 136 | ||
145 | ath_info(common, "Disabling ASPM since BTCOEX is enabled\n"); | 137 | ath_info(common, "Disabling ASPM since BTCOEX is enabled\n"); |
146 | return; | 138 | return; |
147 | } | 139 | } |
148 | 140 | ||
149 | pos = pci_pcie_cap(parent); | 141 | pcie_capability_read_word(parent, PCI_EXP_LNKCTL, &aspm); |
150 | pci_read_config_byte(parent, pos + PCI_EXP_LNKCTL, &aspm); | ||
151 | if (aspm & (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1)) { | 142 | if (aspm & (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1)) { |
152 | ah->aspm_enabled = true; | 143 | ah->aspm_enabled = true; |
153 | /* Initialize PCIe PM and SERDES registers. */ | 144 | /* Initialize PCIe PM and SERDES registers. */ |
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h index 5f5017767b99..724682669060 100644 --- a/drivers/net/wireless/iwlegacy/common.h +++ b/drivers/net/wireless/iwlegacy/common.h | |||
@@ -1832,10 +1832,8 @@ int il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd); | |||
1832 | static inline u16 | 1832 | static inline u16 |
1833 | il_pcie_link_ctl(struct il_priv *il) | 1833 | il_pcie_link_ctl(struct il_priv *il) |
1834 | { | 1834 | { |
1835 | int pos; | ||
1836 | u16 pci_lnk_ctl; | 1835 | u16 pci_lnk_ctl; |
1837 | pos = pci_pcie_cap(il->pci_dev); | 1836 | pcie_capability_read_word(il->pci_dev, PCI_EXP_LNKCTL, &pci_lnk_ctl); |
1838 | pci_read_config_word(il->pci_dev, pos + PCI_EXP_LNKCTL, &pci_lnk_ctl); | ||
1839 | return pci_lnk_ctl; | 1837 | return pci_lnk_ctl; |
1840 | } | 1838 | } |
1841 | 1839 | ||
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index dbeebef562d5..063ecaff5b56 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -675,13 +675,10 @@ static void iwl_set_pwr_vmain(struct iwl_trans *trans) | |||
675 | static u16 iwl_pciexp_link_ctrl(struct iwl_trans *trans) | 675 | static u16 iwl_pciexp_link_ctrl(struct iwl_trans *trans) |
676 | { | 676 | { |
677 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 677 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
678 | int pos; | ||
679 | u16 pci_lnk_ctl; | 678 | u16 pci_lnk_ctl; |
680 | 679 | ||
681 | struct pci_dev *pci_dev = trans_pcie->pci_dev; | 680 | pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_LNKCTL, |
682 | 681 | &pci_lnk_ctl); | |
683 | pos = pci_pcie_cap(pci_dev); | ||
684 | pci_read_config_word(pci_dev, pos + PCI_EXP_LNKCTL, &pci_lnk_ctl); | ||
685 | return pci_lnk_ctl; | 682 | return pci_lnk_ctl; |
686 | } | 683 | } |
687 | 684 | ||
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 80f75d3ba84a..5983631a1b1a 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -372,13 +372,11 @@ static void rtl_pci_parse_configuration(struct pci_dev *pdev, | |||
372 | struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); | 372 | struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); |
373 | 373 | ||
374 | u8 tmp; | 374 | u8 tmp; |
375 | int pos; | 375 | u16 linkctrl_reg; |
376 | u8 linkctrl_reg; | ||
377 | 376 | ||
378 | /*Link Control Register */ | 377 | /*Link Control Register */ |
379 | pos = pci_pcie_cap(pdev); | 378 | pcie_capability_read_word(pdev, PCI_EXP_LNKCTL, &linkctrl_reg); |
380 | pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &linkctrl_reg); | 379 | pcipriv->ndis_adapter.linkctrl_reg = (u8)linkctrl_reg; |
381 | pcipriv->ndis_adapter.linkctrl_reg = linkctrl_reg; | ||
382 | 380 | ||
383 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Link Control Register =%x\n", | 381 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Link Control Register =%x\n", |
384 | pcipriv->ndis_adapter.linkctrl_reg); | 382 | pcipriv->ndis_adapter.linkctrl_reg); |