aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bge
diff options
context:
space:
mode:
authorPaul Saab <ps@FreeBSD.org>2003-02-05 08:54:36 +0000
committerPaul Saab <ps@FreeBSD.org>2003-02-05 08:54:36 +0000
commit41abcc1b6206496b31d6fac5353fc774c31a62dc (patch)
treee59b98fe1ef8178ece08f0bdfefa993081a98395 /sys/dev/bge
parent440baa08c3de75b936f74211758f1bf3ffe79890 (diff)
Notes
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c22
-rw-r--r--sys/dev/bge/if_bgereg.h2
2 files changed, 17 insertions, 7 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index da701fca4976..26803b8d543a 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -1613,14 +1613,22 @@ bge_attach(dev)
/*
* Figure out what sort of media we have by checking the
- * hardware config word in the EEPROM. Note: on some BCM5700
- * cards, this value appears to be unset. If that's the
- * case, we have to rely on identifying the NIC by its PCI
- * subsystem ID, as we do below for the SysKonnect SK-9D41.
+ * hardware config word in the first 32k of NIC internal memory,
+ * or fall back to examining the EEPROM if necessary.
+ * Note: on some BCM5700 cards, this value appears to be unset.
+ * If that's the case, we have to rely on identifying the NIC
+ * by its PCI subsystem ID, as we do below for the SysKonnect
+ * SK-9D41.
*/
- bge_read_eeprom(sc, (caddr_t)&hwcfg,
- BGE_EE_HWCFG_OFFSET, sizeof(hwcfg));
- if ((ntohl(hwcfg) & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER)
+ if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_SIG) == BGE_MAGIC_NUMBER)
+ hwcfg = bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_NICCFG);
+ else {
+ bge_read_eeprom(sc, (caddr_t)&hwcfg,
+ BGE_EE_HWCFG_OFFSET, sizeof(hwcfg));
+ hwcfg = ntohl(hwcfg);
+ }
+
+ if ((hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER)
sc->bge_tbi = 1;
/* The SysKonnect SK-9D41 is a 1000baseSX card. */
diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h
index 4d6725cb28b0..4057b186d624 100644
--- a/sys/dev/bge/if_bgereg.h
+++ b/sys/dev/bge/if_bgereg.h
@@ -72,6 +72,8 @@
#define BGE_STATUS_BLOCK 0x00000B00
#define BGE_STATUS_BLOCK_END 0x00000B4F
#define BGE_SOFTWARE_GENCOMM 0x00000B50
+#define BGE_SOFTWARE_GENCOMM_SIG 0x00000B54
+#define BGE_SOFTWARE_GENCOMM_NICCFG 0x00000B58
#define BGE_SOFTWARE_GENCOMM_END 0x00000FFF
#define BGE_UNMAPPED 0x00001000
#define BGE_UNMAPPED_END 0x00001FFF