diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-09-10 15:12:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:27 -0400 |
commit | 867633f026456ff71d4c4890f502c7a61b2adac0 (patch) | |
tree | d961a66c05c2d729cc4ff3259021c98fce782f6d /drivers/net/wireless/ath/ath9k/pci.c | |
parent | db7197184802578314d974e4b2bc961bdcec8f8c (diff) |
ath9k: Define bus agnostic bluetooth coex prep helper
We disable ASPM when enabling bluetooth coexistance. Disabling
ASPM is a bus specific operation. In the future other buses may
support bluetooth coexistance, an example is USB. To this end
move the current routine which disables ASPM into pci.c, and declare
it the PCI bt_coex_prep() helper. Additionally, since ASPM is
a PCI-Express primitive ensure we don't ever try to muck with ASPM
registers on non PCI-express devices.
This also cleans up hw.c to not include bus specific headers or
utilities.
Cc: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Cc: Stephen Chen <stephen.chen@atheros.com>
Cc: Zhifeng Cai <zhifeng.cai@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/pci.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/pci.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 | */ | ||
81 | static 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 | |||
78 | static struct ath_bus_ops ath_pci_bus_ops = { | 94 | static 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 | ||
84 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | 101 | static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |