diff options
author | jlemon <jlemon@FreeBSD.org> | 2001-07-19 15:48:00 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2001-07-19 15:48:00 +0000 |
commit | e7626346af4d540b33bed6b2b1682a5e2035d695 (patch) | |
tree | 8ca879abe3292fbe3c6e7ce5db8059c38b14a595 /sys/dev/fxp | |
parent | 713de370d58ee86ae1428c29ed0b0a087ca8ea43 (diff) | |
download | FreeBSD-src-e7626346af4d540b33bed6b2b1682a5e2035d695.zip FreeBSD-src-e7626346af4d540b33bed6b2b1682a5e2035d695.tar.gz |
Only turn on MWI if the PCI configuration word indicates that it
is supported, in addition to checking for a valid cacheline size.
Add a missing splx() in fxp_tick that got dropped.
Found by: peter
MFC in: 3 days
Diffstat (limited to 'sys/dev/fxp')
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index f89ee7b..2f2a8a4 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -482,10 +482,12 @@ fxp_attach(device_t dev) */ if (sc->chip != FXP_CHIP_82557) { /* - * If there is a valid cacheline size (8 or 16 dwords), - * then turn on MWI. + * If MWI is enabled in the PCI configuration, and there + * is a valid cacheline size (8 or 16 dwords), then tell + * the board to turn on MWI. */ - if (pci_read_config(dev, PCIR_CACHELNSZ, 1) != 0) + if (val & PCIM_CMD_MWRICEN && + pci_read_config(dev, PCIR_CACHELNSZ, 1) != 0) sc->flags |= FXP_FLAG_MWI_ENABLE; /* turn on the extended TxCB feature */ @@ -1235,10 +1237,9 @@ fxp_tick(void *xsc) sp->rx_rnr_errors = 0; sp->rx_overrun_errors = 0; } - if (sc->miibus != NULL) mii_tick(device_get_softc(sc->miibus)); - + splx(s); /* * Schedule another timeout one second from now. */ |