diff options
author | archie <archie@FreeBSD.org> | 2001-01-10 22:53:52 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 2001-01-10 22:53:52 +0000 |
commit | d9b10e22484739c4060ebe44003ae96100c06210 (patch) | |
tree | e4931fb6bdb27c9ef9d4ad1f4f32d701e3d01993 /sys | |
parent | d1df263f65b9a75b590c4cadaf2037265500a30d (diff) | |
download | FreeBSD-src-d9b10e22484739c4060ebe44003ae96100c06210.zip FreeBSD-src-d9b10e22484739c4060ebe44003ae96100c06210.tar.gz |
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>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/lmc/if_lmc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/lmc/if_lmc.c b/sys/dev/lmc/if_lmc.c index d6b586150..a04ef28 100644 --- a/sys/dev/lmc/if_lmc.c +++ b/sys/dev/lmc/if_lmc.c @@ -416,8 +416,6 @@ lmc_watchdog(lmc_softc_t * const sc) LMC_PRINTF_ARGS); if (sc->lmc_flags & LMC_IFUP) lmc_ifup(sc); - sc->lmc_flags |= LMC_MODEMOK; - lmc_led_on(sc, LMC_MII16_LED1); return; } @@ -448,7 +446,6 @@ lmc_ifup(lmc_softc_t * const sc) sc->lmc_media->set_status(sc, NULL); sc->lmc_flags |= LMC_IFUP; - lmc_led_on(sc, LMC_MII16_LED1); /* * 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); sc->lmc_handle = timeout(ng_lmc_watchdog_frame, sc, hz); 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); + } } /* |