aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c14
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c17
5 files changed, 20 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 0c64c801a150..0962505430e2 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -545,6 +545,7 @@ struct ath_bus_ops {
545 void (*read_cachesize)(struct ath_softc *sc, int *csz); 545 void (*read_cachesize)(struct ath_softc *sc, int *csz);
546 void (*cleanup)(struct ath_softc *sc); 546 void (*cleanup)(struct ath_softc *sc);
547 bool (*eeprom_read)(struct ath_hw *ah, u32 off, u16 *data); 547 bool (*eeprom_read)(struct ath_hw *ah, u32 off, u16 *data);
548 void (*bt_coex_prep)(struct ath_softc *sc);
548}; 549};
549 550
550struct ath_wiphy; 551struct ath_wiphy;
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 4e14c307b3da..a3b1ce32cfcb 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -16,7 +16,6 @@
16 16
17#include <linux/io.h> 17#include <linux/io.h>
18#include <asm/unaligned.h> 18#include <asm/unaligned.h>
19#include <linux/pci.h>
20 19
21#include "hw.h" 20#include "hw.h"
22#include "ath9k.h" 21#include "ath9k.h"
@@ -4294,16 +4293,3 @@ void ath_gen_timer_isr(struct ath_hw *ah)
4294 timer->trigger(timer->arg); 4293 timer->trigger(timer->arg);
4295 } 4294 }
4296} 4295}
4297
4298/*
4299 * Primitive to disable ASPM
4300 */
4301void ath_pcie_aspm_disable(struct ath_softc *sc)
4302{
4303 struct pci_dev *pdev = to_pci_dev(sc->dev);
4304 u8 aspm;
4305
4306 pci_read_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, &aspm);
4307 aspm &= ~(ATH_PCIE_CAP_LINK_L0S | ATH_PCIE_CAP_LINK_L1);
4308 pci_write_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, aspm);
4309}
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index f1dc98927c4a..f460a06b86ac 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -679,5 +679,4 @@ u32 ath9k_hw_gettsf32(struct ath_hw *ah);
679#define ATH_PCIE_CAP_LINK_L0S 1 679#define ATH_PCIE_CAP_LINK_L0S 1
680#define ATH_PCIE_CAP_LINK_L1 2 680#define ATH_PCIE_CAP_LINK_L1 2
681 681
682void ath_pcie_aspm_disable(struct ath_softc *sc);
683#endif 682#endif
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index dc8d47e4d0f5..27ab378ae535 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2241,7 +2241,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
2241 AR_STOMP_LOW_WLAN_WGHT); 2241 AR_STOMP_LOW_WLAN_WGHT);
2242 ath9k_hw_btcoex_enable(ah); 2242 ath9k_hw_btcoex_enable(ah);
2243 2243
2244 ath_pcie_aspm_disable(sc); 2244 if (sc->bus_ops->bt_coex_prep)
2245 sc->bus_ops->bt_coex_prep(sc);
2245 if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) 2246 if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
2246 ath9k_btcoex_timer_resume(sc); 2247 ath9k_btcoex_timer_resume(sc);
2247 } 2248 }
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 903dd8ad9d43..f59d22491ced 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -75,10 +75,27 @@ static bool ath_pci_eeprom_read(struct ath_hw *ah, u32 off, u16 *data)
75 return true; 75 return true;
76} 76}
77 77
78/*
79 * Bluetooth coexistance requires disabling ASPM.
80 */
81static void ath_pci_bt_coex_prep(struct ath_softc *sc)
82{
83 struct pci_dev *pdev = to_pci_dev(sc->dev);
84 u8 aspm;
85
86 if (!pdev->is_pcie)
87 return;
88
89 pci_read_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, &aspm);
90 aspm &= ~(ATH_PCIE_CAP_LINK_L0S | ATH_PCIE_CAP_LINK_L1);
91 pci_write_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, aspm);
92}
93
78static struct ath_bus_ops ath_pci_bus_ops = { 94static struct ath_bus_ops ath_pci_bus_ops = {
79 .read_cachesize = ath_pci_read_cachesize, 95 .read_cachesize = ath_pci_read_cachesize,
80 .cleanup = ath_pci_cleanup, 96 .cleanup = ath_pci_cleanup,
81 .eeprom_read = ath_pci_eeprom_read, 97 .eeprom_read = ath_pci_eeprom_read,
98 .bt_coex_prep = ath_pci_bt_coex_prep,
82}; 99};
83 100
84static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 101static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)