if_fxp.c (25094) | if_fxp.c (26623) |
---|---|
1/* 2 * Copyright (c) 1995, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/* 2 * Copyright (c) 1995, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $Id: if_fxp.c,v 1.33 1997/03/25 14:54:38 davidg Exp $ | 27 * $Id: if_fxp.c,v 1.34 1997/04/23 01:44:30 davidg Exp $ |
28 */ 29 30/* 31 * Intel EtherExpress Pro/100B PCI Fast Ethernet driver 32 */ 33 34#include "bpfilter.h" 35 --- 922 unchanged lines hidden (view full) --- 958 /* 959 * Initialize receiver buffer area - RFA. 960 */ 961 fxp_scb_wait(csr); 962 csr->scb_general = vtophys(sc->rfa_headm->m_ext.ext_buf); 963 csr->scb_command = FXP_SCB_COMMAND_RU_START; 964 965 /* | 28 */ 29 30/* 31 * Intel EtherExpress Pro/100B PCI Fast Ethernet driver 32 */ 33 34#include "bpfilter.h" 35 --- 922 unchanged lines hidden (view full) --- 958 /* 959 * Initialize receiver buffer area - RFA. 960 */ 961 fxp_scb_wait(csr); 962 csr->scb_general = vtophys(sc->rfa_headm->m_ext.ext_buf); 963 csr->scb_command = FXP_SCB_COMMAND_RU_START; 964 965 /* |
966 * Toggle a few bits in the DP83840 PHY. | 966 * Toggle a few bits in the PHY. |
967 */ | 967 */ |
968 if (sc->phy_primary_device == FXP_PHY_DP83840 || 969 sc->phy_primary_device == FXP_PHY_DP83840A) { | 968 switch (sc->phy_primary_device) { 969 case FXP_PHY_DP83840: 970 case FXP_PHY_DP83840A: |
970 fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR, 971 fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR) | 972 FXP_DP83840_PCR_LED4_MODE | /* LED4 always indicates duplex */ 973 FXP_DP83840_PCR_F_CONNECT | /* force link disconnect bypass */ 974 FXP_DP83840_PCR_BIT10); /* XXX I have no idea */ | 971 fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR, 972 fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_PCR) | 973 FXP_DP83840_PCR_LED4_MODE | /* LED4 always indicates duplex */ 974 FXP_DP83840_PCR_F_CONNECT | /* force link disconnect bypass */ 975 FXP_DP83840_PCR_BIT10); /* XXX I have no idea */ |
976 /* fall through */ 977 case FXP_PHY_82555: |
|
975 /* 976 * If link0 is set, disable auto-negotiation and then: 977 * If link1 is unset = 10Mbps 978 * If link1 is set = 100Mbps 979 * If link2 is unset = half duplex 980 * If link2 is set = full duplex 981 */ 982 if (ifp->if_flags & IFF_LINK0) { 983 int flags; 984 985 flags = (ifp->if_flags & IFF_LINK1) ? | 978 /* 979 * If link0 is set, disable auto-negotiation and then: 980 * If link1 is unset = 10Mbps 981 * If link1 is set = 100Mbps 982 * If link2 is unset = half duplex 983 * If link2 is set = full duplex 984 */ 985 if (ifp->if_flags & IFF_LINK0) { 986 int flags; 987 988 flags = (ifp->if_flags & IFF_LINK1) ? |
986 FXP_DP83840_BMCR_SPEED_100M : 0; | 989 FXP_PHY_BMCR_SPEED_100M : 0; |
987 flags |= (ifp->if_flags & IFF_LINK2) ? | 990 flags |= (ifp->if_flags & IFF_LINK2) ? |
988 FXP_DP83840_BMCR_FULLDUPLEX : 0; 989 fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR, 990 (fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR) & 991 ~(FXP_DP83840_BMCR_AUTOEN | FXP_DP83840_BMCR_SPEED_100M | 992 FXP_DP83840_BMCR_FULLDUPLEX)) | flags); | 991 FXP_PHY_BMCR_FULLDUPLEX : 0; 992 fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR, 993 (fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR) & 994 ~(FXP_PHY_BMCR_AUTOEN | FXP_PHY_BMCR_SPEED_100M | 995 FXP_PHY_BMCR_FULLDUPLEX)) | flags); |
993 } else { | 996 } else { |
994 fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR, 995 (fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_DP83840_BMCR) | 996 FXP_DP83840_BMCR_AUTOEN)); | 997 fxp_mdi_write(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR, 998 (fxp_mdi_read(sc->csr, sc->phy_primary_addr, FXP_PHY_BMCR) | 999 FXP_PHY_BMCR_AUTOEN)); |
997 } | 1000 } |
998 } else { | 1001 break; 1002 default: |
999 printf("fxp%d: warning: unsupported PHY, type = %d, addr = %d\n", 1000 ifp->if_unit, sc->phy_primary_device, sc->phy_primary_addr); 1001 } 1002 1003 ifp->if_flags |= IFF_RUNNING; 1004 ifp->if_flags &= ~IFF_OACTIVE; 1005 splx(s); 1006 --- 160 unchanged lines hidden --- | 1003 printf("fxp%d: warning: unsupported PHY, type = %d, addr = %d\n", 1004 ifp->if_unit, sc->phy_primary_device, sc->phy_primary_addr); 1005 } 1006 1007 ifp->if_flags |= IFF_RUNNING; 1008 ifp->if_flags &= ~IFF_OACTIVE; 1009 splx(s); 1010 --- 160 unchanged lines hidden --- |