diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/pci.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/pci.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index 7ca8499249ec..78ef1f13386f 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c | |||
@@ -96,7 +96,7 @@ static void ath_pci_bt_coex_prep(struct ath_common *common) | |||
96 | struct pci_dev *pdev = to_pci_dev(sc->dev); | 96 | struct pci_dev *pdev = to_pci_dev(sc->dev); |
97 | u8 aspm; | 97 | u8 aspm; |
98 | 98 | ||
99 | if (!pdev->is_pcie) | 99 | if (!pci_is_pcie(pdev)) |
100 | return; | 100 | return; |
101 | 101 | ||
102 | pci_read_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, &aspm); | 102 | pci_read_config_byte(pdev, ATH_PCIE_CAP_LINK_CTRL, &aspm); |
@@ -264,6 +264,8 @@ static void ath_pci_remove(struct pci_dev *pdev) | |||
264 | struct ath_softc *sc = aphy->sc; | 264 | struct ath_softc *sc = aphy->sc; |
265 | void __iomem *mem = sc->mem; | 265 | void __iomem *mem = sc->mem; |
266 | 266 | ||
267 | if (!is_ath9k_unloaded) | ||
268 | sc->sc_ah->ah_flags |= AH_UNPLUGGED; | ||
267 | ath9k_deinit_device(sc); | 269 | ath9k_deinit_device(sc); |
268 | free_irq(sc->irq, sc); | 270 | free_irq(sc->irq, sc); |
269 | ieee80211_free_hw(sc->hw); | 271 | ieee80211_free_hw(sc->hw); |
@@ -309,7 +311,16 @@ static int ath_pci_resume(struct device *device) | |||
309 | AR_GPIO_OUTPUT_MUX_AS_OUTPUT); | 311 | AR_GPIO_OUTPUT_MUX_AS_OUTPUT); |
310 | ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); | 312 | ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); |
311 | 313 | ||
314 | /* | ||
315 | * Reset key cache to sane defaults (all entries cleared) instead of | ||
316 | * semi-random values after suspend/resume. | ||
317 | */ | ||
318 | ath9k_ps_wakeup(sc); | ||
319 | ath9k_init_crypto(sc); | ||
320 | ath9k_ps_restore(sc); | ||
321 | |||
312 | sc->ps_idle = true; | 322 | sc->ps_idle = true; |
323 | ath9k_set_wiphy_idle(aphy, true); | ||
313 | ath_radio_disable(sc, hw); | 324 | ath_radio_disable(sc, hw); |
314 | 325 | ||
315 | return 0; | 326 | return 0; |