From 86543395c1db7da2bb77964301a634e3753795b1 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Fri, 18 Jan 2008 22:09:50 +0000 Subject: [PATCH] Add a flag for Ethernet@WireSpeed capability and correct chip revisions. The idea was taken from OpenBSD and cross-referenced with Linux driver. --- sys/dev/bge/if_bge.c | 9 +++++++++ sys/dev/bge/if_bgereg.h | 3 ++- sys/dev/mii/brgphy.c | 8 +------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 6c338dcdda2f..e8d56f26b426 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 1752966149be..0334add37d44 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 d35125e09ace..eed7407d45a8 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 */