summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2008-01-18 22:09:50 +0000
committerjkim <jkim@FreeBSD.org>2008-01-18 22:09:50 +0000
commitd0a4947e475b54c018975f22ae30fa3d2eda1d5a (patch)
tree99944cc64647598142279c5b03df1ce07cd9f315 /sys/dev
parentedc23a8104a888ea49121b63cb35431f2a3dc487 (diff)
downloadFreeBSD-src-d0a4947e475b54c018975f22ae30fa3d2eda1d5a.zip
FreeBSD-src-d0a4947e475b54c018975f22ae30fa3d2eda1d5a.tar.gz
Add a flag for Ethernet@WireSpeed capability and correct chip revisions.
The idea was taken from OpenBSD and cross-referenced with Linux driver.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/bge/if_bge.c9
-rw-r--r--sys/dev/bge/if_bgereg.h3
-rw-r--r--sys/dev/mii/brgphy.c8
3 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 6c338dc..e8d56f2 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -2264,6 +2264,15 @@ bge_attach(device_t dev)
sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid);
sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid);
+ /*
+ * Don't enable Ethernet@WireSpeed for the 5700 or the
+ * 5705 A0 and A1 chips.
+ */
+ if (sc->bge_asicrev != BGE_ASICREV_BCM5700 &&
+ sc->bge_chipid != BGE_CHIPID_BCM5705_A0 &&
+ sc->bge_chipid != BGE_CHIPID_BCM5705_A1)
+ sc->bge_flags |= BGE_FLAG_WIRESPEED;
+
if (bge_has_eeprom(sc))
sc->bge_flags |= BGE_FLAG_EEPROM;
diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h
index 1752966..0334add 100644
--- a/sys/dev/bge/if_bgereg.h
+++ b/sys/dev/bge/if_bgereg.h
@@ -2459,7 +2459,8 @@ struct bge_softc {
uint32_t bge_flags;
#define BGE_FLAG_TBI 0x00000001
#define BGE_FLAG_JUMBO 0x00000002
-#define BGE_FLAG_EEPROM 0x00000004
+#define BGE_FLAG_WIRESPEED 0x00000004
+#define BGE_FLAG_EEPROM 0x00000008
#define BGE_FLAG_MSI 0x00000100
#define BGE_FLAG_PCIX 0x00000200
#define BGE_FLAG_PCIE 0x00000400
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index d35125e..eed7407 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -915,13 +915,7 @@ brgphy_reset(struct mii_softc *sc)
brgphy_jumbo_settings(sc, ifp->if_mtu);
- /*
- * Don't enable Ethernet@WireSpeed for the 5700 or the
- * 5705 A1 and A2 chips.
- */
- if (bge_sc->bge_asicrev != BGE_ASICREV_BCM5700 &&
- bge_sc->bge_chipid != BGE_CHIPID_BCM5705_A1 &&
- bge_sc->bge_chipid != BGE_CHIPID_BCM5705_A2)
+ if (bge_sc->bge_flags & BGE_FLAG_WIRESPEED)
brgphy_ethernet_wirespeed(sc);
/* Enable Link LED on Dell boxes */
OpenPOWER on IntegriCloud