summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-08-28 00:49:48 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-08-28 00:49:48 +0000
commit956a91d2627823c0820260561f0ec906a5230c2f (patch)
tree56eadfa52316df2fbf7cdae19741a83ac3cdb48f /sys/dev
parent5d48e5bfba512e38a942f4ee7b595010da236f03 (diff)
Set the BGE_NO3LED flag to properly adjust the PHY LED mode if attaching
to either a BCM5700 or BCM5701 chip and have the Dell PCI vendor subid. The appropriate code has been in brgphy for 2 years, now the bge(4) driver will use it. Also found in the Broadcom bcm5700 and Linux tg3 drivers.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_bge.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 0384b6f29c3..69b723acc15 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.169 2006/08/27 21:42:13 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.170 2006/08/28 00:49:47 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -1656,7 +1656,7 @@ bge_attach(struct device *parent, struct device *self, void *aux)
struct pci_attach_args *pa = aux;
pci_chipset_tag_t pc = pa->pa_pc;
const struct bge_revision *br;
- pcireg_t pm_ctl, memtype;
+ pcireg_t pm_ctl, memtype, subid;
pci_intr_handle_t ih;
const char *intrstr = NULL;
bus_size_t size;
@@ -1669,6 +1669,8 @@ bge_attach(struct device *parent, struct device *self, void *aux)
sc->bge_pa = *pa;
+ subid = pci_conf_read(pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
+
/*
* Map control/status registers.
*/
@@ -1893,10 +1895,14 @@ bge_attach(struct device *parent, struct device *self, void *aux)
sc->bge_flags |= BGE_TBI;
/* The SysKonnect SK-9D41 is a 1000baseSX card. */
- if ((pci_conf_read(pc, pa->pa_tag, BGE_PCI_SUBSYS) >> 16) ==
- SK_SUBSYSID_9D41)
+ if (PCI_PRODUCT(subid) == SK_SUBSYSID_9D41)
sc->bge_flags |= BGE_TBI;
+ if ((BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5700 ||
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5701) &&
+ PCI_VENDOR(subid) == DELL_VENDORID)
+ sc->bge_flags |= BGE_NO3LED;
+
if (sc->bge_flags & BGE_TBI) {
ifmedia_init(&sc->bge_ifmedia, IFM_IMASK, bge_ifmedia_upd,
bge_ifmedia_sts);