aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorMohammed Shafi Shajakhan <mshajakhan@atheros.com>2010-12-22 01:50:12 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-22 15:44:22 -0500
commitdb7ec38d8e99f449856c11ffaef363a8eb5af90f (patch)
tree41f0833fff19d7e7127a0cc795cedc9f465f8208 /drivers/net/wireless/ath
parente6d8a817d00793eecd063b1548bbc954ab62b124 (diff)
ath9k: Reset keycache on resume
It looks like some hardware registers are left into undefined state after suspend/resume. At minimum, this can cause odd issues related to key cache and hardware trying to encrypt/decrypt frames unexpectedly. This seems to happen even when there is no keys configured, i.e., hardware can end up touching TX frames just based of invalid key cache context even if the driver is not asking a specific entry to be used. In addition, RX can likely be affected. This patch fixes this issue. Signed-off-by: Jouni Malinen <Jouni.Malinen@Atheros.com> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c8
3 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index d9bda275ec21..fcc087ce3bc3 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -670,6 +670,7 @@ extern int ath9k_pm_qos_value;
670extern bool is_ath9k_unloaded; 670extern bool is_ath9k_unloaded;
671 671
672irqreturn_t ath_isr(int irq, void *dev); 672irqreturn_t ath_isr(int irq, void *dev);
673void ath9k_init_crypto(struct ath_softc *sc);
673int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, 674int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
674 const struct ath_bus_ops *bus_ops); 675 const struct ath_bus_ops *bus_ops);
675void ath9k_deinit_device(struct ath_softc *sc); 676void ath9k_deinit_device(struct ath_softc *sc);
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 9efc77d82563..efb778d4356a 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -373,7 +373,7 @@ fail:
373#undef DS2PHYS 373#undef DS2PHYS
374} 374}
375 375
376static void ath9k_init_crypto(struct ath_softc *sc) 376void ath9k_init_crypto(struct ath_softc *sc)
377{ 377{
378 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 378 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
379 int i = 0; 379 int i = 0;
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 545aa1c650cf..78ef1f13386f 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -311,6 +311,14 @@ static int ath_pci_resume(struct device *device)
311 AR_GPIO_OUTPUT_MUX_AS_OUTPUT); 311 AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
312 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);
313 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
314 sc->ps_idle = true; 322 sc->ps_idle = true;
315 ath9k_set_wiphy_idle(aphy, true); 323 ath9k_set_wiphy_idle(aphy, true);
316 ath_radio_disable(sc, hw); 324 ath_radio_disable(sc, hw);