if_bge.c (214428) | if_bge.c (215297) |
---|---|
1/*- 2 * Copyright (c) 2001 Wind River Systems 3 * Copyright (c) 1997, 1998, 1999, 2001 4 * Bill Paul <wpaul@windriver.com>. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31 * THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Wind River Systems 3 * Copyright (c) 1997, 1998, 1999, 2001 4 * Bill Paul <wpaul@windriver.com>. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 18 unchanged lines hidden (view full) --- 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31 * THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 214428 2010-10-27 17:20:19Z yongari $"); | 35__FBSDID("$FreeBSD: head/sys/dev/bge/if_bge.c 215297 2010-11-14 13:26:10Z marius $"); |
36 37/* 38 * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. 39 * 40 * The Broadcom BCM5700 is based on technology originally developed by 41 * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet 42 * MAC chips. The BCM5700, sometimes refered to as the Tigon III, has 43 * two on-board MIPS R4000 CPUs and can have as much as 16MB of external --- 865 unchanged lines hidden (view full) --- 909 if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || 910 IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) 911 BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); 912 else 913 BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); 914 915 if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) { 916 BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); | 36 37/* 38 * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. 39 * 40 * The Broadcom BCM5700 is based on technology originally developed by 41 * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet 42 * MAC chips. The BCM5700, sometimes refered to as the Tigon III, has 43 * two on-board MIPS R4000 CPUs and can have as much as 16MB of external --- 865 unchanged lines hidden (view full) --- 909 if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || 910 IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) 911 BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII); 912 else 913 BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII); 914 915 if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) { 916 BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); |
917 if (IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG1) | 917 if ((IFM_OPTIONS(mii->mii_media_active) & 918 IFM_ETH_TXPAUSE) != 0) |
918 BGE_SETBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); 919 else 920 BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); | 919 BGE_SETBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); 920 else 921 BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); |
921 if (IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0) | 922 if ((IFM_OPTIONS(mii->mii_media_active) & 923 IFM_ETH_RXPAUSE) != 0) |
922 BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); 923 else 924 BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); 925 } else { 926 BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); 927 BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); 928 BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); 929 } --- 2167 unchanged lines hidden (view full) --- 3097 * if we get a conflict with the ASF firmware accessing 3098 * the PHY. 3099 */ 3100 trys = 0; 3101 BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); 3102again: 3103 bge_asf_driver_up(sc); 3104 | 924 BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); 925 else 926 BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); 927 } else { 928 BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); 929 BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); 930 BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); 931 } --- 2167 unchanged lines hidden (view full) --- 3099 * if we get a conflict with the ASF firmware accessing 3100 * the PHY. 3101 */ 3102 trys = 0; 3103 BGE_CLRBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); 3104again: 3105 bge_asf_driver_up(sc); 3106 |
3105 error = (mii_attach(dev, &sc->bge_miibus, ifp, | 3107 error = mii_attach(dev, &sc->bge_miibus, ifp, |
3106 bge_ifmedia_upd, bge_ifmedia_sts, BMSR_DEFCAPMASK, | 3108 bge_ifmedia_upd, bge_ifmedia_sts, BMSR_DEFCAPMASK, |
3107 phy_addr, MII_OFFSET_ANY, 0)); | 3109 phy_addr, MII_OFFSET_ANY, MIIF_DOPAUSE); |
3108 if (error != 0) { 3109 if (trys++ < 4) { 3110 device_printf(sc->bge_dev, "Try again\n"); 3111 bge_miibus_writereg(sc->bge_dev, 1, MII_BMCR, 3112 BMCR_RESET); 3113 goto again; 3114 } 3115 device_printf(sc->bge_dev, "attaching PHYs failed\n"); --- 2727 unchanged lines hidden --- | 3110 if (error != 0) { 3111 if (trys++ < 4) { 3112 device_printf(sc->bge_dev, "Try again\n"); 3113 bge_miibus_writereg(sc->bge_dev, 1, MII_BMCR, 3114 BMCR_RESET); 3115 goto again; 3116 } 3117 device_printf(sc->bge_dev, "attaching PHYs failed\n"); --- 2727 unchanged lines hidden --- |