From d675147e39eec293d1b3ab613cf6b7e0d748a0d3 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Tue, 7 Dec 1999 19:18:41 +0000 Subject: [PATCH] Tweak the DC_REDUCED_MII_POLL code in dc_mii_tick() for the DC_IS_INTEL() case. The idea is to reduce how often we call mii_tick(), however currently it may not be called often enough, which prevents autonegotiation from being driven correctly. This should improve the chances of successfully autonegotiating media settings on non-MII 21143 NICs. (Still waiting for confirmation from some testers, but the code is clearly wrong in any case.) --- sys/dev/dc/if_dc.c | 4 ++-- sys/pci/if_dc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 25491e002ed..a01fa7361d8 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -2123,10 +2123,10 @@ static void dc_tick(xsc) if (sc->dc_flags & DC_REDUCED_MII_POLL) { r = CSR_READ_4(sc, DC_ISR); if (DC_IS_INTEL(sc)) { - if (r & DC_ISR_LINKFAIL) { + if (r & DC_ISR_LINKFAIL) sc->dc_link = 0; + if (sc->dc_link == 0) mii_tick(mii); - } } else { if ((r & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT && sc->dc_cdata.dc_tx_prod == 0) diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index 25491e002ed..a01fa7361d8 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -2123,10 +2123,10 @@ static void dc_tick(xsc) if (sc->dc_flags & DC_REDUCED_MII_POLL) { r = CSR_READ_4(sc, DC_ISR); if (DC_IS_INTEL(sc)) { - if (r & DC_ISR_LINKFAIL) { + if (r & DC_ISR_LINKFAIL) sc->dc_link = 0; + if (sc->dc_link == 0) mii_tick(mii); - } } else { if ((r & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT && sc->dc_cdata.dc_tx_prod == 0)