1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-25 16:13:17 +00:00

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
This commit is contained in:
Jonathan Lemon 2001-07-19 15:48:00 +00:00
parent 4834ec4db9
commit 74396a0a26
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79965

View File

@ -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.
*/