aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c44
4 files changed, 29 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index db44e5b0c98b..875faf6894ae 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -603,10 +603,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)
603 603
604 ath9k_hw_init_mode_regs(ah); 604 ath9k_hw_init_mode_regs(ah);
605 605
606 606 if (!ah->is_pciexpress)
607 if (ah->is_pciexpress)
608 ath9k_hw_aspm_init(ah);
609 else
610 ath9k_hw_disablepcie(ah); 607 ath9k_hw_disablepcie(ah);
611 608
612 if (!AR_SREV_9300_20_OR_LATER(ah)) 609 if (!AR_SREV_9300_20_OR_LATER(ah))
@@ -621,6 +618,9 @@ static int __ath9k_hw_init(struct ath_hw *ah)
621 if (r) 618 if (r)
622 return r; 619 return r;
623 620
621 if (ah->is_pciexpress)
622 ath9k_hw_aspm_init(ah);
623
624 r = ath9k_hw_init_macaddr(ah); 624 r = ath9k_hw_init_macaddr(ah);
625 if (r) { 625 if (r) {
626 ath_err(common, "Failed to initialize MAC address\n"); 626 ath_err(common, "Failed to initialize MAC address\n");
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 2ea10f317183..ee0d9441209b 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -1036,10 +1036,6 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning);
1036void ath9k_hw_proc_mib_event(struct ath_hw *ah); 1036void ath9k_hw_proc_mib_event(struct ath_hw *ah);
1037void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan); 1037void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan);
1038 1038
1039#define ATH_PCIE_CAP_LINK_CTRL 0x70
1040#define ATH_PCIE_CAP_LINK_L0S 1
1041#define ATH_PCIE_CAP_LINK_L1 2
1042
1043#define ATH9K_CLOCK_RATE_CCK 22 1039#define ATH9K_CLOCK_RATE_CCK 22
1044#define ATH9K_CLOCK_RATE_5GHZ_OFDM 40 1040#define ATH9K_CLOCK_RATE_5GHZ_OFDM 40
1045#define ATH9K_CLOCK_RATE_2GHZ_OFDM 44 1041#define ATH9K_CLOCK_RATE_2GHZ_OFDM 44
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index e40873215fc6..781af25f440d 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1145,8 +1145,6 @@ static int ath9k_start(struct ieee80211_hw *hw)
1145 AR_STOMP_LOW_WLAN_WGHT); 1145 AR_STOMP_LOW_WLAN_WGHT);
1146 ath9k_hw_btcoex_enable(ah); 1146 ath9k_hw_btcoex_enable(ah);
1147 1147
1148 if (common->bus_ops->bt_coex_prep)
1149 common->bus_ops->bt_coex_prep(common);
1150 if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) 1148 if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
1151 ath9k_btcoex_timer_resume(sc); 1149 ath9k_btcoex_timer_resume(sc);
1152 } 1150 }
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 65cf728fa111..daa26b5d7455 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -89,23 +89,6 @@ static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
89 return true; 89 return true;
90} 90}
91 91
92/*
93 * Bluetooth coexistance requires disabling ASPM.
94 */
95static void ath_pci_bt_coex_prep(struct ath_common *common)
96{
97 struct ath_softc *sc = (struct ath_softc *) common->priv;
98 struct pci_dev *pdev = to_pci_dev(sc->dev);
99 u8 aspm;
100
101 if (!pci_is_pcie(pdev))
102 return;
103
104 pci_read_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, &aspm);
105 aspm &= ~(ATH_PCIE_CAP_LINK_L0S | ATH_PCIE_CAP_LINK_L1);
106 pci_write_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, aspm);
107}
108
109static void ath_pci_extn_synch_enable(struct ath_common *common) 92static void ath_pci_extn_synch_enable(struct ath_common *common)
110{ 93{
111 struct ath_softc *sc = (struct ath_softc *) common->priv; 94 struct ath_softc *sc = (struct ath_softc *) common->priv;
@@ -117,6 +100,7 @@ static void ath_pci_extn_synch_enable(struct ath_common *common)
117 pci_write_config_byte(pdev, sc->sc_ah->caps.pcie_lcr_offset, lnkctl); 100 pci_write_config_byte(pdev, sc->sc_ah->caps.pcie_lcr_offset, lnkctl);
118} 101}
119 102
103/* Need to be called after we discover btcoex capabilities */
120static void ath_pci_aspm_init(struct ath_common *common) 104static void ath_pci_aspm_init(struct ath_common *common)
121{ 105{
122 struct ath_softc *sc = (struct ath_softc *) common->priv; 106 struct ath_softc *sc = (struct ath_softc *) common->priv;
@@ -126,10 +110,33 @@ static void ath_pci_aspm_init(struct ath_common *common)
126 int pos; 110 int pos;
127 u8 aspm; 111 u8 aspm;
128 112
129 if (!pci_is_pcie(pdev)) 113 pos = pci_pcie_cap(pdev);
114 if (!pos)
130 return; 115 return;
131 116
132 parent = pdev->bus->self; 117 parent = pdev->bus->self;
118
119 if (ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE) {
120 /* Bluetooth coexistance requires disabling ASPM. */
121 pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &aspm);
122 aspm &= ~(PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1);
123 pci_write_config_byte(pdev, pos + PCI_EXP_LNKCTL, aspm);
124
125 /*
126 * Both upstream and downstream PCIe components should
127 * have the same ASPM settings.
128 */
129 if (WARN_ON(!parent))
130 return;
131
132 pos = pci_pcie_cap(parent);
133 pci_read_config_byte(parent, pos + PCI_EXP_LNKCTL, &aspm);
134 aspm &= ~(PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1);
135 pci_write_config_byte(parent, pos + PCI_EXP_LNKCTL, aspm);
136
137 return;
138 }
139
133 if (WARN_ON(!parent)) 140 if (WARN_ON(!parent))
134 return; 141 return;
135 142
@@ -146,7 +153,6 @@ static const struct ath_bus_ops ath_pci_bus_ops = {
146 .ath_bus_type = ATH_PCI, 153 .ath_bus_type = ATH_PCI,
147 .read_cachesize = ath_pci_read_cachesize, 154 .read_cachesize = ath_pci_read_cachesize,
148 .eeprom_read = ath_pci_eeprom_read, 155 .eeprom_read = ath_pci_eeprom_read,
149 .bt_coex_prep = ath_pci_bt_coex_prep,
150 .extn_synch_en = ath_pci_extn_synch_enable, 156 .extn_synch_en = ath_pci_extn_synch_enable,
151 .aspm_init = ath_pci_aspm_init, 157 .aspm_init = ath_pci_aspm_init,
152}; 158};