diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-08-08 16:43:51 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-08-08 16:43:51 +0000 |
commit | 51ef85893546f5f8bc8eeada63882d278e496f7b (patch) | |
tree | bcb4d68932bbe8c1fa9effbc29e75a2ffea5b813 | |
parent | 32fe17a663470bcff500ec1d022251eb5521ca1d (diff) |
Make fix for preserving LED settings conditional on presence of an Intel
21143 chip; from FreeBSD.
-rw-r--r-- | sys/dev/ic/dc.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 792e56cffaf..8a4ad38d8d6 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.8 2000/08/02 19:01:06 aaron Exp $ */ +/* $OpenBSD: dc.c,v 1.9 2000/08/08 16:43:50 aaron Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1179,11 +1179,15 @@ void dc_setcfg(sc, media) if (sc->dc_pmode == DC_PMODE_MII) { int watchdogreg; + if (DC_IS_INTEL(sc)) { /* there's a write enable bit here that reads as 1 */ - watchdogreg = CSR_READ_4(sc, DC_WATCHDOG); - watchdogreg &= ~DC_WDOG_CTLWREN; - watchdogreg |= DC_WDOG_JABBERDIS; - CSR_WRITE_4(sc, DC_WATCHDOG, watchdogreg); + watchdogreg = CSR_READ_4(sc, DC_WATCHDOG); + watchdogreg &= ~DC_WDOG_CTLWREN; + watchdogreg |= DC_WDOG_JABBERDIS; + CSR_WRITE_4(sc, DC_WATCHDOG, watchdogreg); + } else { + DC_SETBIT(sc, DC_WATCHDOG, DC_WDOG_JABBERDIS); + } DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_PCS| DC_NETCFG_PORTSEL|DC_NETCFG_SCRAMBLER)); if (sc->dc_type == DC_TYPE_98713) @@ -1210,11 +1214,15 @@ void dc_setcfg(sc, media) if (sc->dc_pmode == DC_PMODE_MII) { int watchdogreg; + if (DC_IS_INTEL(sc)) { /* there's a write enable bit here that reads as 1 */ - watchdogreg = CSR_READ_4(sc, DC_WATCHDOG); - watchdogreg &= ~DC_WDOG_CTLWREN; - watchdogreg |= DC_WDOG_JABBERDIS; - CSR_WRITE_4(sc, DC_WATCHDOG, watchdogreg); + watchdogreg = CSR_READ_4(sc, DC_WATCHDOG); + watchdogreg &= ~DC_WDOG_CTLWREN; + watchdogreg |= DC_WDOG_JABBERDIS; + CSR_WRITE_4(sc, DC_WATCHDOG, watchdogreg); + } else { + DC_SETBIT(sc, DC_WATCHDOG, DC_WDOG_JABBERDIS); + } DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_PCS| DC_NETCFG_PORTSEL|DC_NETCFG_SCRAMBLER)); if (sc->dc_type == DC_TYPE_98713) |