summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/brgphy.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2003-08-12 05:18:51 +0000
committerwpaul <wpaul@FreeBSD.org>2003-08-12 05:18:51 +0000
commit1a2d5f38b0e6fb77c067fe3f08059dd9293ab98b (patch)
treef43c7ec569501d8191921219671558aab9d85a13 /sys/dev/mii/brgphy.c
parentf7a72db8a5fc28c6067312d7e8b803ceda5ba841 (diff)
downloadFreeBSD-src-1a2d5f38b0e6fb77c067fe3f08059dd9293ab98b.zip
FreeBSD-src-1a2d5f38b0e6fb77c067fe3f08059dd9293ab98b.tar.gz
Add support for the Broadcom BCM5901 and BCM5901 rev A2 chips.
These are 10/100 only NICs found on the IBM Thinkpad R40E and G40. These seem to be based on the BCM5705 MAC but with a PHY that doesn't support 1000Mbps modes. Submitted by: Igor Sviridov <sia@nest.org>
Diffstat (limited to 'sys/dev/mii/brgphy.c')
-rw-r--r--sys/dev/mii/brgphy.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index 9f6ed9c..ed86ca8a 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -58,6 +58,9 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <dev/bge/if_bgereg.h>
+#include <pci/pcireg.h>
+#include <pci/pcivar.h>
+
#include "miibus_if.h"
static int brgphy_probe(device_t);
@@ -153,6 +156,8 @@ brgphy_attach(dev)
struct mii_attach_args *ma;
struct mii_data *mii;
const char *sep = "";
+ struct bge_softc *bge_sc;
+ int fast_ether_only = FALSE;
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
@@ -186,11 +191,26 @@ brgphy_attach(dev)
sc->mii_capabilities &= ~BMSR_ANEG;
device_printf(dev, " ");
mii_add_media(sc);
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst),
- BRGPHY_BMCR_FDX);
- PRINT(", 1000baseTX");
- ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst), 0);
- PRINT("1000baseTX-FDX");
+
+ /* The 590x chips are 10/100 only. */
+
+ bge_sc = mii->mii_ifp->if_softc;
+
+ if (strcmp(mii->mii_ifp->if_name, "bge") == 0 &&
+ pci_get_vendor(bge_sc->bge_dev) == BCOM_VENDORID &&
+ (pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901 ||
+ pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901A2))
+ fast_ether_only = TRUE;
+
+ if (fast_ether_only == FALSE) {
+ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0,
+ sc->mii_inst), BRGPHY_BMCR_FDX);
+ PRINT(", 1000baseTX");
+ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T,
+ IFM_FDX, sc->mii_inst), 0);
+ PRINT("1000baseTX-FDX");
+ }
+
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0);
PRINT("auto");
OpenPOWER on IntegriCloud