lmc_ifup() was not checking the state of the interface. This would

cause the watchdog to (incorrectly) detect the interface state
going from down to up one second after lmc_ifup() was called,
causing lmc_ifup() to be called again, and resetting everything.
Fix by checking the interface state within lmc_ifup().

Submitted by:	Darren Croke <djc@packetdesign.com>
This commit is contained in:
archie 2001-01-10 22:53:52 +00:00
parent d1df263f65
commit d9b10e2248

View File

@ -416,8 +416,6 @@ lmc_watchdog(lmc_softc_t * const sc)
LMC_PRINTF_ARGS); LMC_PRINTF_ARGS);
if (sc->lmc_flags & LMC_IFUP) if (sc->lmc_flags & LMC_IFUP)
lmc_ifup(sc); lmc_ifup(sc);
sc->lmc_flags |= LMC_MODEMOK;
lmc_led_on(sc, LMC_MII16_LED1);
return; return;
} }
@ -448,7 +446,6 @@ lmc_ifup(lmc_softc_t * const sc)
sc->lmc_media->set_status(sc, NULL); sc->lmc_media->set_status(sc, NULL);
sc->lmc_flags |= LMC_IFUP; sc->lmc_flags |= LMC_IFUP;
lmc_led_on(sc, LMC_MII16_LED1);
/* /*
* select what interrupts we want to get * select what interrupts we want to get
@ -471,6 +468,14 @@ lmc_ifup(lmc_softc_t * const sc)
untimeout(ng_lmc_watchdog_frame, sc, sc->lmc_handle); untimeout(ng_lmc_watchdog_frame, sc, sc->lmc_handle);
sc->lmc_handle = timeout(ng_lmc_watchdog_frame, sc, hz); sc->lmc_handle = timeout(ng_lmc_watchdog_frame, sc, hz);
sc->lmc_running = 1; sc->lmc_running = 1;
/*
* check if the physical link is up
*/
if (sc->lmc_media->get_link_status(sc)) {
sc->lmc_flags |= LMC_MODEMOK;
lmc_led_on(sc, LMC_MII16_LED1);
}
} }
/* /*