From 78999dd117417bea8528aa04d9b6cf64559998c8 Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Thu, 7 Sep 2000 18:51:04 +0000 Subject: Special-case the LED twiddling code so that it doesn't do anything on the NEC VersaPro NoteBook PC. This 21143 implementation has no LEDs, and flipping the LED control bits somehow stops it from establishing a link. We check the subsystem ID and don't flip the LED control bits for the NEC NIC. --- sys/dev/dc/if_dc.c | 13 +++++++++++-- sys/dev/dc/if_dcreg.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'sys/dev/dc') diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 659fa87a13fc..1b069c71d064 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1759,6 +1759,15 @@ static int dc_attach(dev) sc->dc_flags |= DC_21143_NWAY; mii_phy_probe(dev, &sc->dc_miibus, dc_ifmedia_upd, dc_ifmedia_sts); + /* + * For non-MII cards, we need to have the 21143 + * drive the LEDs. Except there are some systems + * like the NEC VersaPro NoteBook PC which have no + * LEDs, and twiddling these bits has adverse effects + * on them. (I.e. you suddenly can't get a link.) + */ + if (pci_read_config(dev, DC_PCI_CSID, 4) != 0x80281033) + sc->dc_flags |= DC_TULIP_LEDS; error = 0; } @@ -2730,10 +2739,10 @@ static void dc_init(xsc) * MII port, program the LED control pins so we get * link and activity indications. */ - if (DC_IS_INTEL(sc) && sc->dc_pmode == DC_PMODE_SYM) { + if (sc->dc_flags & DC_TULIP_LEDS) { CSR_WRITE_4(sc, DC_WATCHDOG, DC_WDOG_CTLWREN|DC_WDOG_LINK|DC_WDOG_ACTIVITY); - CSR_WRITE_4(sc, DC_WATCHDOG, DC_WDOG_LINK|DC_WDOG_ACTIVITY); + CSR_WRITE_4(sc, DC_WATCHDOG, 0); } /* diff --git a/sys/dev/dc/if_dcreg.h b/sys/dev/dc/if_dcreg.h index abb52edaf4d1..a0a2444de88b 100644 --- a/sys/dev/dc/if_dcreg.h +++ b/sys/dev/dc/if_dcreg.h @@ -679,6 +679,7 @@ struct dc_softc { #define DC_21143_NWAY 0x00000800 #define DC_128BIT_HASH 0x00001000 #define DC_64BIT_HASH 0x00002000 +#define DC_TULIP_LEDS 0x00004000 /* * register space access macros -- cgit v1.3