]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/ath/ath9k/hw.c
ath9k: Disable ASPM when btcoex is active
[karo-tx-linux.git] / drivers / net / wireless / ath / ath9k / hw.c
index 011b14f35e5073ebf8fd1c86bf913d646cb64225..97a09dba76de0f0077d721e9d5fdb931c86721e7 100644 (file)
@@ -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);
+}