summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_ath.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-05-25 02:07:59 +0000
committeradrian <adrian@FreeBSD.org>2012-05-25 02:07:59 +0000
commitbe5ba4a1c6b29919d741be32fb51b3137e7b545c (patch)
tree7feb46b6a04f7501d7da33c80208994f4ab2045e /sys/dev/ath/if_ath.c
parenteda9e50c52e3c3311e30b433606b4c3cf6d6126a (diff)
downloadFreeBSD-src-be5ba4a1c6b29919d741be32fb51b3137e7b545c.zip
FreeBSD-src-be5ba4a1c6b29919d741be32fb51b3137e7b545c.tar.gz
Prepare for improved (read: pcie) suspend/resume support.
* Flesh out the pcie disable method for 11n chips, as they were defaulting to the AR5212 (empty) PCIe disable method. * Add accessor macros for the HAL PCIe enable/disable calls. * Call disable on ath_suspend() * Call enable on ath_resume() NOTE: * This has nothing to do with the NIC sleep/run state - the NIC still will stay in network-run state rather than supporting network-sleep state. This is preparation work for supporting correct suspend/resume WARs for the 11n PCIe NICs. TODO: * It may be feasible at this point to keep the chip powered down during initial probe/attach and only power it up upon the first configure/reset pass. This however would require correct (for values of "correct") tracking of the NIC power configuration state from the driver and that just isn't attempted at the moment. Tested: * AR9280 on my Lenovo T60, but with no suspend/resume pass (yet).
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r--sys/dev/ath/if_ath.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 3aad7e0..065a428 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -1318,6 +1318,9 @@ ath_suspend(struct ath_softc *sc)
* mode; pci will power off our socket on suspend and
* CardBus detaches the device.
*/
+
+ /* For PCIe, this matters */
+ ath_hal_disablepcie(sc->sc_ah);
}
/*
@@ -1350,6 +1353,9 @@ ath_resume(struct ath_softc *sc)
DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n",
__func__, ifp->if_flags);
+ /* Re-enable PCIe, re-enable the PCIe bus */
+ ath_hal_enablepcie(ah, 1);
+
/*
* Must reset the chip before we reload the
* keycache as we were powered down on suspend.
OpenPOWER on IntegriCloud