mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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>
This commit is contained in:
parent
725d623fae
commit
5d99c6417d
3 changed files with 31 additions and 5 deletions
|
|
@ -154,6 +154,10 @@ static struct bge_type bge_devs[] = {
|
|||
"Broadcom BCM5705M Gigabit Ethernet" },
|
||||
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5782,
|
||||
"Broadcom BCM5782 Gigabit Ethernet" },
|
||||
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5901,
|
||||
"Broadcom BCM5901 Fast Ethernet" },
|
||||
{ BCOM_VENDORID, BCOM_DEVICEID_BCM5901A2,
|
||||
"Broadcom BCM5901A2 Fast Ethernet" },
|
||||
{ SK_VENDORID, SK_DEVICEID_ALTIMA,
|
||||
"SysKonnect Gigabit Ethernet" },
|
||||
{ ALTIMA_VENDORID, ALTIMA_DEVICE_AC1000,
|
||||
|
|
|
|||
|
|
@ -1822,6 +1822,8 @@ struct bge_status_block {
|
|||
#define BCOM_DEVICEID_BCM5705M 0x165D
|
||||
#define BCOM_DEVICEID_BCM5705M_ALT 0x165E
|
||||
#define BCOM_DEVICEID_BCM5782 0x1696
|
||||
#define BCOM_DEVICEID_BCM5901 0x170D
|
||||
#define BCOM_DEVICEID_BCM5901A2 0x170E
|
||||
|
||||
/*
|
||||
* Alteon AceNIC PCI vendor/device ID.
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue