# broadcom fiber card not active



## STL (Oct 1, 2009)

I am installing a new firewall with freebsd 7.2.  It has a 2 port pci-ex fiber card
When the machine starts up the card recognizes a link (light turns on) but when bsd starts up, the lights turn off and the it seems the card turns off.  The status states that it has no carrier.  Both of the interfaces on the card are plugged into something (one to a transceiver, one to a switch)

here are the some of the valid info you may want to see.
---ifconfig---

```
bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        ether 00:15:77:4f:3d:ce
        media: Ethernet 1000baseSX (none)
        status: no carrier
bge1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        ether 00:15:77:4f:3d:cf
        media: Ethernet autoselect (none)
        status: no carrier
```
dmesg | grep bge

```
bge0: <Allied Telesis AT-2972SX/2, ASIC rev. 0x9003> mem 0xfaff0000-0xfaffffff,0xfafe0000-0xfafeffff irq 16 at device 4.0 on pci4
bge0: Ethernet address: 00:15:77:4f:3d:ce
bge0: [ITHREAD]
bge1: <Allied Telesis AT-2972SX/2, ASIC rev. 0x9003> mem 0xfafc0000-0xfafcffff,0xfafb0000-0xfafbffff irq 17 at device 4.1 on pci4
bge1: Ethernet address: 00:15:77:4f:3d:cf
bge1: [ITHREAD]
```


----------



## SirDice (Oct 1, 2009)

The manual of the card says it's based on a Broadcom BCM5715S chipset.

If I look at bge(4):


> The bge driver provides support for various NICs based on the Broadcom BCM570x, 5714, 5721, 5722, 5750, 5751, 5752 and 5789 families of Gigabit Ethernet controller chips.
> 
> All of these NICs are capable of 10, 100 and 1000Mbps speeds over CAT5 copper cable, except for the SysKonnect SK-9D41 which supports only 1000Mbps over multimode fiber.



So my guess is that the chipset is slightly different from the ones that are supported. That's why it's detected but not fully functional.


----------



## STL (Oct 1, 2009)

*Solved*

the bge driver by default does not include the logic for this series of the broadcom controller chip...applied the patches given at the following link
http://freebsd.monkey.org/freebsd-net/200902/msg00090.html

```
Index: sys/dev/bge/if_bgereg.h
 ===================================================================
 --- sys/dev/bge/if_bgereg.h	(revision 1)
 +++ sys/dev/bge/if_bgereg.h	(working copy)
 @@ -2533,6 +2533,9 @@
  #define	BGE_FLAG_JUMBO		0x00000002
  #define	BGE_FLAG_WIRESPEED	0x00000004
  #define	BGE_FLAG_EADDR		0x00000008
 +
 +#define	BGE_FLAG_MIISERDES	0x00000010
 +
  #define	BGE_FLAG_MSI		0x00000100
  #define	BGE_FLAG_PCIX		0x00000200
  #define	BGE_FLAG_PCIE		0x00000400
 Index: sys/dev/bge/if_bge.c
 ===================================================================
 --- sys/dev/bge/if_bge.c	(revision 1)
 +++ sys/dev/bge/if_bge.c	(working copy)
 @@ -838,8 +838,11 @@
  	mii = device_get_softc(sc->bge_miibus);
  
  	BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE);
 -	if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T)
 +	if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T ||
 +                (sc->bge_flags & BGE_FLAG_MIISERDES))
 +	{
  		BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII);
 +	}
  	else
  		BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII);
  
 @@ -1719,8 +1722,8 @@
  	    BGE_MACMODE_RXDMA_ENB | BGE_MACMODE_RX_STATS_CLEAR |
  	    BGE_MACMODE_TX_STATS_CLEAR | BGE_MACMODE_RX_STATS_ENB |
  	    BGE_MACMODE_TX_STATS_ENB | BGE_MACMODE_FRMHDR_DMA_ENB |
 -	    ((sc->bge_flags & BGE_FLAG_TBI) ?
 -	    BGE_PORTMODE_TBI : BGE_PORTMODE_MII));
 +            ((sc->bge_flags & BGE_FLAG_TBI) ?
 +            BGE_PORTMODE_TBI : (sc->bge_flags & BGE_FLAG_MIISERDES ) ? BGE_PORTMODE_GMII : BGE_PORTMODE_MII));
  
  	/* Set misc. local control, enable interrupts on attentions */
  	CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
 @@ -2654,7 +2657,13 @@
  	}
  
  	if ((hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER)
 -		sc->bge_flags |= BGE_FLAG_TBI;
 +        {
 +                if(sc->bge_flags & BGE_FLAG_5714_FAMILY){
 +                        sc->bge_flags |= BGE_FLAG_MIISERDES;
 +                } else {
 +                        sc->bge_flags |= BGE_FLAG_TBI;
 +                }
 +        }
  
  	/* The SysKonnect SK-9D41 is a 1000baseSX card. */
  	if ((pci_read_config(dev, BGE_PCI_SUBSYS, 4) >> 16) == SK_SUBSYSID_9D41)
 @@ -3267,6 +3276,7 @@
  	if (cmd == POLL_AND_CHECK_STATUS)
  		if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 &&
  		    sc->bge_chipid != BGE_CHIPID_BCM5700_B2) ||
 +			(sc->bge_flags & BGE_FLAG_MIISERDES) ||
  		    sc->bge_link_evt || (sc->bge_flags & BGE_FLAG_TBI))
  			bge_link_upd(sc);
  
 Index: sys/dev/mii/brgphy.c
 ===================================================================
 --- sys/dev/mii/brgphy.c	(revision 1)
 +++ sys/dev/mii/brgphy.c	(working copy)
 @@ -540,10 +540,21 @@
  				mii->mii_media_active |= IFM_NONE; break;
  			}
  		}
 +		 else if(bmsr & BRGPHY_BMSR_LINK){
 +			mii->mii_media_status |= IFM_ACTIVE;
 +		}
  	} else {
  		/* If serdes link is up, get the negotiated speed/duplex. */
  		if (bmsr & BRGPHY_BMSR_LINK) {
  			mii->mii_media_status |= IFM_ACTIVE;
 +			/* If autoneg enabled, read negotiated duplex settings */
 +			if (bmcr & BRGPHY_BMCR_AUTOEN) {
 +				val = PHY_READ(sc, BRGPHY_SERDES_ANAR) & PHY_READ(sc, BRGPHY_SERDES_ANLPAR);
 +				if (val & BRGPHY_SERDES_ANAR_FDX)
 +					mii->mii_media_active |= IFM_FDX;
 +				else
 +					mii->mii_media_active |= IFM_HDX;
 +			}
  		}
  
  		/* Check the link speed/duplex based on the PHY type. */
 @@ -619,6 +630,7 @@
  		/* Pause capability advertisement (pause capable & asymmetric) */
  		PHY_WRITE(sc, BRGPHY_MII_ANAR,
  	    	BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA |
 +		ANAR_X_FD | ANAR_X_HD | ANAR_FC | 0x0800 |
  	    	BRGPHY_ANAR_ASP | BRGPHY_ANAR_PC);
  	} else {
  		PHY_WRITE(sc, BRGPHY_SERDES_ANAR, BRGPHY_SERDES_ANAR_FDX |
```


----------

