Skip to contentSkip to conversation

ath9k: Disable ASPM when btcoex is active

PATCH New Vasanthakumar Thiagarajan 1 participant 2 messages Sep 7, 2009 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: Disable ASPM when btcoex is active

---
 drivers/net/wireless/ath/ath9k/hw.c   |   14 ++++++++++++++
 drivers/net/wireless/ath/ath9k/hw.h   |    5 +++++
 drivers/net/wireless/ath/ath9k/main.c |    1 +
 3 files changed, 20 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +14 -0
index 011b14f..97a09db 100644
@@ -16,6 +16,7 @@
 
 #include <linux/io.h>
 #include <asm/unaligned.h>
+#include <linux/pci.h>
 
 #include "ath9k.h"
 #include "initvals.h"
@@ -4298,3 +4299,16 @@ void ath_gen_timer_isr(struct ath_hw *ah)
 		timer->trigger(timer->arg);
 	}
 }
+
+/*
+ * Primitive to disable ASPM
+ */
+void ath_pcie_aspm_disable(struct ath_softc *sc)
+{
+	struct pci_dev *pdev = to_pci_dev(sc->dev);
+	u8 aspm;
+
+	pci_read_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, &aspm);
+	aspm &= ~(ATH_PCIE_CAP_LINK_L0S | ATH_PCIE_CAP_LINK_L1);
+	pci_write_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, aspm);
+}
drivers/net/wireless/ath/ath9k/hw.h +5 -0
index 5ca6ffa..a592f1a 100644
@@ -665,4 +665,9 @@ void ath_gen_timer_free(struct ath_hw *ah, struct ath_gen_timer *timer);
 void ath_gen_timer_isr(struct ath_hw *hw);
 u32 ath9k_hw_gettsf32(struct ath_hw *ah);
 
+#define ATH_PCIE_CAP_LINK_CTRL	0x70
+#define ATH_PCIE_CAP_LINK_L0S	1
+#define ATH_PCIE_CAP_LINK_L1	2
+
+void ath_pcie_aspm_disable(struct ath_softc *sc);
 #endif
drivers/net/wireless/ath/ath9k/main.c +1 -0
index a69fda8..ce011ab 100644
@@ -2010,6 +2010,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
 				      AR_STOMP_LOW_WLAN_WGHT);
 		ath9k_hw_btcoex_enable(sc->sc_ah);
 
+		ath_pcie_aspm_disable(sc);
 		if (sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_3WIRE)
 			ath_btcoex_timer_resume(sc, &sc->btcoex_info);
 	}
Signature · 1 line
1.5.5.1
#1 lore raw

PATCH 1/1 ath9k: Remove unnecessary casting to u8 in pci_read_config_byte() call

---
 drivers/net/wireless/ath/ath9k/pci.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/pci.c +1 -2
index 8bb286d..8b28814 100644
@@ -35,8 +35,7 @@ static void ath_pci_read_cachesize(struct ath_softc *sc, int *csz)
 {
 	u8 u8tmp;
 
-	pci_read_config_byte(to_pci_dev(sc->dev), PCI_CACHE_LINE_SIZE,
-			     (u8 *)&u8tmp);
+	pci_read_config_byte(to_pci_dev(sc->dev), PCI_CACHE_LINE_SIZE, &u8tmp);
 	*csz = (int)u8tmp;
 
 	/*
Signature · 1 line
1.5.5.1