diff options
author | wpaul <wpaul@FreeBSD.org> | 2000-08-01 19:34:13 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2000-08-01 19:34:13 +0000 |
commit | 6077857dc7b0950039bae886bd4de371a1098587 (patch) | |
tree | e9100e49cbc7643d7fbcb04adc833d4310c3f066 /sys/pci/if_dc.c | |
parent | 9935f1df75bb6958ca345ebe82dcdff25df26771 (diff) | |
download | FreeBSD-src-6077857dc7b0950039bae886bd4de371a1098587.zip FreeBSD-src-6077857dc7b0950039bae886bd4de371a1098587.tar.gz |
Apply patch supplied by John Hood <jhood@sitaranetworks.com> to fix problems
with LEDs on some cards being stomped on when clearing the "jabber disable"
bit. Using DC_SETBIT() has an unwanted side effect of setting a write enable
bit in the watchdog timer register which we really want to be cleared when
we do a write.
Diffstat (limited to 'sys/pci/if_dc.c')
-rw-r--r-- | sys/pci/if_dc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index 1d4c6de..6699d83 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -1221,7 +1221,12 @@ static void dc_setcfg(sc, media) DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_SPEEDSEL); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_HEARTBEAT); if (sc->dc_pmode == DC_PMODE_MII) { - DC_SETBIT(sc, DC_WATCHDOG, DC_WDOG_JABBERDIS); + int watchdogreg; + + /* 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; DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_PCS| DC_NETCFG_PORTSEL|DC_NETCFG_SCRAMBLER)); if (sc->dc_type == DC_TYPE_98713) @@ -1246,7 +1251,13 @@ static void dc_setcfg(sc, media) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_SPEEDSEL); DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_HEARTBEAT); if (sc->dc_pmode == DC_PMODE_MII) { - DC_SETBIT(sc, DC_WATCHDOG, DC_WDOG_JABBERDIS); + int watchdogreg; + + /* 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); DC_CLRBIT(sc, DC_NETCFG, (DC_NETCFG_PCS| DC_NETCFG_PORTSEL|DC_NETCFG_SCRAMBLER)); if (sc->dc_type == DC_TYPE_98713) |