summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/dc/if_dc.c13
-rw-r--r--sys/dev/dc/if_dcreg.h1
-rw-r--r--sys/pci/if_dc.c13
-rw-r--r--sys/pci/if_dcreg.h1
4 files changed, 24 insertions, 4 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c
index 659fa87..1b069c7 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 abb52ed..a0a2444 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
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c
index 659fa87..1b069c7 100644
--- a/sys/pci/if_dc.c
+++ b/sys/pci/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/pci/if_dcreg.h b/sys/pci/if_dcreg.h
index abb52ed..a0a2444 100644
--- a/sys/pci/if_dcreg.h
+++ b/sys/pci/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
OpenPOWER on IntegriCloud