aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ath/if_ath_pci.c
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2011-10-14 03:24:35 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2011-10-14 03:24:35 +0000
commitcdd36f96b25df903994d1654f310b6f0d2956ed5 (patch)
tree4d454c01cdb35b32deab99da1aa9f7c35c2e4803 /sys/dev/ath/if_ath_pci.c
parent2d6fb05305057059c157a1dfe2d24e57060a61a1 (diff)
Notes
Diffstat (limited to 'sys/dev/ath/if_ath_pci.c')
-rw-r--r--sys/dev/ath/if_ath_pci.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/dev/ath/if_ath_pci.c b/sys/dev/ath/if_ath_pci.c
index c9b7eecbc1b8..fa3cf3b408c8 100644
--- a/sys/dev/ath/if_ath_pci.c
+++ b/sys/dev/ath/if_ath_pci.c
@@ -74,6 +74,16 @@ struct ath_pci_softc {
#define BS_BAR 0x10
#define PCIR_RETRY_TIMEOUT 0x41
+static void
+ath_pci_setup(device_t dev)
+{
+ /*
+ * Disable retry timeout to keep PCI Tx retries from
+ * interfering with C3 CPU state.
+ */
+ pci_write_config(dev, PCIR_RETRY_TIMEOUT, 0, 1);
+}
+
static int
ath_pci_probe(device_t dev)
{
@@ -103,10 +113,9 @@ ath_pci_attach(device_t dev)
pci_enable_busmaster(dev);
/*
- * Disable retry timeout to keep PCI Tx retries from
- * interfering with C3 CPU state.
+ * Setup other PCI bus configuration parameters.
*/
- pci_write_config(dev, PCIR_RETRY_TIMEOUT, 0, 1);
+ ath_pci_setup(dev);
/*
* Setup memory-mapping of PCI registers.
@@ -228,6 +237,11 @@ ath_pci_resume(device_t dev)
{
struct ath_pci_softc *psc = device_get_softc(dev);
+ /*
+ * Suspend/resume resets the PCI configuration space.
+ */
+ ath_pci_setup(dev);
+
ath_resume(&psc->sc_sc);
return (0);