mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Teach the bge driver about the BCM5701 (specifically, the 3Com
3c996B-T, with the 5701 rev B5 ASIC). One thing that confuses me still is that the 'link state change' bit in the status block seems to change state an awful lot. I have a workaround for this in place now, but it needs more investigation. For the moment though, this is enough to get the driver to work with this card.
This commit is contained in:
parent
68cbd14239
commit
98b28ee5b4
2 changed files with 20 additions and 4 deletions
|
|
@ -57,7 +57,7 @@
|
|||
* function in a 32-bit/64-bit 33/66Mhz bus, or a 64-bit/133Mhz bus.
|
||||
*
|
||||
* The BCM5701 is a single-chip solution incorporating both the BCM5700
|
||||
* MAC and a BCM5401 10/100/1000 PHY. Unlike the BCM5700, the BCM5700
|
||||
* MAC and a BCM5401 10/100/1000 PHY. Unlike the BCM5700, the BCM5701
|
||||
* does not support external SSRAM.
|
||||
*
|
||||
* Broadcom also produces a variation of the BCM5700 under the "Altima"
|
||||
|
|
@ -479,6 +479,9 @@ bge_miibus_readreg(dev, phy, reg)
|
|||
sc = device_get_softc(dev);
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
if (sc->bge_asicrev == BGE_ASICREV_BCM5701_B5 && phy != 1)
|
||||
return(0);
|
||||
|
||||
if (ifp->if_flags & IFF_RUNNING)
|
||||
BGE_CLRBIT(sc, BGE_MI_MODE, BGE_MIMODE_AUTOPOLL);
|
||||
|
||||
|
|
@ -1623,6 +1626,12 @@ bge_attach(dev)
|
|||
ifp->if_capabilities = IFCAP_HWCSUM;
|
||||
ifp->if_capenable = ifp->if_capabilities;
|
||||
|
||||
/* Save ASIC rev. */
|
||||
|
||||
sc->bge_asicrev =
|
||||
pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
|
||||
BGE_PCIMISCCTL_ASICREV;
|
||||
|
||||
/* The SysKonnect SK-9D41 is a 1000baseSX card. */
|
||||
if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41)
|
||||
sc->bge_tbi = 1;
|
||||
|
|
@ -1981,9 +1990,11 @@ bge_intr(xsc)
|
|||
/* Process link state changes. */
|
||||
if (sc->bge_rdata->bge_status_block.bge_status &
|
||||
BGE_STATFLAG_LINKSTATE_CHANGED) {
|
||||
sc->bge_link = 0;
|
||||
untimeout(bge_tick, sc, sc->bge_stat_ch);
|
||||
bge_tick(sc);
|
||||
if (sc->bge_asicrev != BGE_ASICREV_BCM5701_B5) {
|
||||
sc->bge_link = 0;
|
||||
untimeout(bge_tick, sc, sc->bge_stat_ch);
|
||||
bge_tick(sc);
|
||||
}
|
||||
/* ack the event to clear/reset it */
|
||||
CSR_WRITE_4(sc, BGE_MAC_STS, BGE_MACSTAT_SYNC_CHANGED|
|
||||
BGE_MACSTAT_CFG_CHANGED);
|
||||
|
|
|
|||
|
|
@ -217,6 +217,10 @@
|
|||
#define BGE_ASICREV_BCM5700_B2 0x71030000
|
||||
#define BGE_ASICREV_BCM5700_ALTIMA 0x71040000
|
||||
#define BGE_ASICREV_BCM5700_C0 0x72000000
|
||||
#define BGE_ASICREV_BCM5701_A0 0x00000000 /* grrrr */
|
||||
#define BGE_ASICREV_BCM5701_B0 0x01000000
|
||||
#define BGE_ASICREV_BCM5701_B2 0x01020000
|
||||
#define BGE_ASICREV_BCM5701_B5 0x01050000
|
||||
|
||||
/* PCI DMA Read/Write Control register */
|
||||
#define BGE_PCIDMARWCTL_MINDMA 0x000000FF
|
||||
|
|
@ -2109,6 +2113,7 @@ struct bge_softc {
|
|||
u_int8_t bge_unit; /* interface number */
|
||||
u_int8_t bge_extram; /* has external SSRAM */
|
||||
u_int8_t bge_tbi;
|
||||
u_int32_t bge_asicrev;
|
||||
struct bge_ring_data *bge_rdata; /* rings */
|
||||
struct bge_chain_data bge_cdata; /* mbufs */
|
||||
u_int16_t bge_tx_saved_considx;
|
||||
|
|
|
|||
Loading…
Reference in a new issue