summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-02-01 20:58:45 +0000
committeryongari <yongari@FreeBSD.org>2010-02-01 20:58:45 +0000
commit3eea9a2ed1740e760ae2f87c100c2d2e9596a969 (patch)
tree08dfa97a7442b21e3926997bc2baba8b2eb2c0bd /sys/dev
parentd42c5f9ad1d5e5b19dfe5654db575824307bdc3c (diff)
downloadFreeBSD-src-3eea9a2ed1740e760ae2f87c100c2d2e9596a969.zip
FreeBSD-src-3eea9a2ed1740e760ae2f87c100c2d2e9596a969.tar.gz
PCI express device status register has W1C feature. Writing 0 has
no effect. Make sure to clear error bits by writing 1. [1] While I'm here use predefined value instead of hardcodig magic vlaue. Submitted by: msaitoh at NetBSD [1]
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/bge/if_bge.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 7bfb1fe..e08ace8 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -3136,14 +3136,17 @@ bge_reset(struct bge_softc *sc)
devctl = pci_read_config(dev,
sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2);
/* Clear enable no snoop and disable relaxed ordering. */
- devctl &= ~(0x0010 | 0x0800);
+ devctl &= ~(PCIM_EXP_CTL_RELAXED_ORD_ENABLE |
+ PCIM_EXP_CTL_NOSNOOP_ENABLE);
/* Set PCIE max payload size to 128. */
devctl &= ~PCIM_EXP_CTL_MAX_PAYLOAD;
pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL,
devctl, 2);
/* Clear error status. */
pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_STA,
- 0, 2);
+ PCIM_EXP_STA_CORRECTABLE_ERROR |
+ PCIM_EXP_STA_NON_FATAL_ERROR | PCIM_EXP_STA_FATAL_ERROR |
+ PCIM_EXP_STA_UNSUPPORTED_REQ, 2);
}
/* Reset some of the PCI state that got zapped by reset. */
OpenPOWER on IntegriCloud