diff options
author | Chris Cappuccio <chris@cvs.openbsd.org> | 2000-02-06 20:56:03 +0000 |
---|---|---|
committer | Chris Cappuccio <chris@cvs.openbsd.org> | 2000-02-06 20:56:03 +0000 |
commit | c06b512c30ae668f5dd1c12829607607239660c1 (patch) | |
tree | 04ac04868df432a9c54bfebef8c268a812207004 /sys/dev | |
parent | 6c5e87d3eb912c6f78899a23f96934612d204eed (diff) |
Maintain tx clock state and set RED LED appropriately for SSI card
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_lmc.c | 31 | ||||
-rw-r--r-- | sys/dev/pci/if_lmcvar.h | 7 |
2 files changed, 30 insertions, 8 deletions
diff --git a/sys/dev/pci/if_lmc.c b/sys/dev/pci/if_lmc.c index 3b2688be76c..6d2e33371c7 100644 --- a/sys/dev/pci/if_lmc.c +++ b/sys/dev/pci/if_lmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lmc.c,v 1.4 2000/02/06 17:51:41 chris Exp $ */ +/* $OpenBSD: if_lmc.c,v 1.5 2000/02/06 20:56:02 chris Exp $ */ /* $NetBSD: if_lmc.c,v 1.1 1999/03/25 03:32:43 explorer Exp $ */ /*- @@ -79,7 +79,6 @@ * frequency generator. (ST not available for LMC5200) */ - #include <sys/param.h> #include <sys/systm.h> #include <sys/mbuf.h> @@ -438,6 +437,28 @@ lmc_watchdog(int unit) sc->lmc_cmdmode |= TULIP_CMD_TXRUN | TULIP_CMD_RXRUN; LMC_CSR_WRITE (sc, csr_command, sc->lmc_cmdmode); + /* Is the transmit clock still available? */ + ticks = LMC_CSR_READ (sc, csr_gp_timer); + ticks = 0x0000ffff - (ticks & 0x0000ffff); + + if (ticks == 0) + { + /* no clock found ? */ + if (sc->tx_clockState != 0) + { + sc->tx_clockState = 0; + if (sc->lmc_cardtype == LMC_CARDTYPE_SSI) + lmc_led_on (sc, LMC_MII16_LED3); /* ON red */ + } + else + if (sc->tx_clockState == 0) + { + sc->tx_clockState = 1; + if (sc->lmc_cardtype == LMC_CARDTYPE_SSI) + lmc_led_off (sc, LMC_MII16_LED3); /* OFF red */ + } + } + link_status = sc->lmc_media->get_link_status(sc); ostatus = ((sc->lmc_flags & LMC_MODEMOK) == LMC_MODEMOK); @@ -466,7 +487,7 @@ lmc_watchdog(int unit) * hardware link is up, but the interface is marked as down. * Bring it back up again. */ - if (link_status != 0 && !ostatus) { + if (link_status != LMC_LINK_DOWN && !ostatus) { printf(LMC_PRINTF_FMT ": physical link up\n", LMC_PRINTF_ARGS); if (sc->lmc_flags & LMC_IFUP) @@ -480,7 +501,7 @@ lmc_watchdog(int unit) /* turn off red LED */ lmc_led_on (sc, LMC_DS3_LED2); } else { - lmc_led_on (sc, LMC_MII16_LED0 | LMC_MII16_LED1 \ + lmc_led_on (sc, LMC_MII16_LED0 | LMC_MII16_LED1 | LMC_MII16_LED2); if (sc->lmc_timing != LMC_CTL_CLOCK_SOURCE_EXT) lmc_led_off (sc, LMC_MII16_LED3); @@ -514,7 +535,7 @@ lmc_ifup(lmc_softc_t * const sc) lmc_dec_reset(sc); lmc_reset(sc); - sc->lmc_media->set_link_status(sc, 1); + sc->lmc_media->set_link_status(sc, LMC_LINK_UP); sc->lmc_media->set_status(sc, NULL); sc->lmc_flags |= LMC_IFUP; diff --git a/sys/dev/pci/if_lmcvar.h b/sys/dev/pci/if_lmcvar.h index 115b449ab7a..3e5fd0b1cb7 100644 --- a/sys/dev/pci/if_lmcvar.h +++ b/sys/dev/pci/if_lmcvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lmcvar.h,v 1.3 2000/02/01 18:01:42 chris Exp $ */ +/* $OpenBSD: if_lmcvar.h,v 1.4 2000/02/06 20:56:02 chris Exp $ */ /* $NetBSD: if_lmcvar.h,v 1.1 1999/03/25 03:32:43 explorer Exp $ */ /*- @@ -282,7 +282,7 @@ struct lmc___softc { struct isadev lmc_id; /* ISA device */ struct intrhand lmc_ih; /* intrrupt vectoring */ struct atshutdown lmc_ats; /* shutdown hook */ - struct p2pcom lmc_p2pcom; /* point-to-point common stuff */ + struct p2pcom lmc_p2pcom; /* point-to-point common stuff */ #define lmc_if lmc_p2pcom.p2p_if /* network-visible interface */ #endif /* __bsdi__ */ @@ -349,8 +349,9 @@ struct lmc___softc { #endif u_int32_t lmc_crcSize; + u_int32_t tx_clockState; char lmc_yel, lmc_blue, lmc_red; /* for T1 and DS3 */ - char lmc_timing; /* for HSSI and SSI */ + char lmc_timing; /* for HSSI and SSI */ u_int16_t t1_alarm1_status; u_int16_t t1_alarm2_status; }; |