rlphy.c (213364) | rlphy.c (213384) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. 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 --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/dev/mii/rlphy.c 213364 2010-10-02 18:53:12Z marius $"); | 34__FBSDID("$FreeBSD: head/sys/dev/mii/rlphy.c 213384 2010-10-03 17:00:57Z marius $"); |
35 36/* 37 * driver for RealTek 8139 internal PHYs 38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> --- 201 unchanged lines hidden (view full) --- 244 return; 245 } 246 247 if ((anlpar = PHY_READ(phy, MII_ANAR) & 248 PHY_READ(phy, MII_ANLPAR))) { 249 if (anlpar & ANLPAR_TX_FD) 250 mii->mii_media_active |= IFM_100_TX|IFM_FDX; 251 else if (anlpar & ANLPAR_T4) | 35 36/* 37 * driver for RealTek 8139 internal PHYs 38 */ 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> --- 201 unchanged lines hidden (view full) --- 244 return; 245 } 246 247 if ((anlpar = PHY_READ(phy, MII_ANAR) & 248 PHY_READ(phy, MII_ANLPAR))) { 249 if (anlpar & ANLPAR_TX_FD) 250 mii->mii_media_active |= IFM_100_TX|IFM_FDX; 251 else if (anlpar & ANLPAR_T4) |
252 mii->mii_media_active |= IFM_100_T4; | 252 mii->mii_media_active |= IFM_100_T4|IFM_HDX; |
253 else if (anlpar & ANLPAR_TX) | 253 else if (anlpar & ANLPAR_TX) |
254 mii->mii_media_active |= IFM_100_TX; | 254 mii->mii_media_active |= IFM_100_TX|IFM_HDX; |
255 else if (anlpar & ANLPAR_10_FD) 256 mii->mii_media_active |= IFM_10_T|IFM_FDX; 257 else if (anlpar & ANLPAR_10) | 255 else if (anlpar & ANLPAR_10_FD) 256 mii->mii_media_active |= IFM_10_T|IFM_FDX; 257 else if (anlpar & ANLPAR_10) |
258 mii->mii_media_active |= IFM_10_T; | 258 mii->mii_media_active |= IFM_10_T|IFM_HDX; |
259 else 260 mii->mii_media_active |= IFM_NONE; 261 return; 262 } 263 /* 264 * If the other side doesn't support NWAY, then the 265 * best we can do is determine if we have a 10Mbps or 266 * 100Mbps link. There's no way to know if the link --- 27 unchanged lines hidden (view full) --- 294 mii->mii_media_active |= IFM_10_T; 295 } else { 296 if (PHY_READ(phy, RL_MEDIASTAT) & 297 RL_MEDIASTAT_SPEED10) 298 mii->mii_media_active |= IFM_10_T; 299 else 300 mii->mii_media_active |= IFM_100_TX; 301 } | 259 else 260 mii->mii_media_active |= IFM_NONE; 261 return; 262 } 263 /* 264 * If the other side doesn't support NWAY, then the 265 * best we can do is determine if we have a 10Mbps or 266 * 100Mbps link. There's no way to know if the link --- 27 unchanged lines hidden (view full) --- 294 mii->mii_media_active |= IFM_10_T; 295 } else { 296 if (PHY_READ(phy, RL_MEDIASTAT) & 297 RL_MEDIASTAT_SPEED10) 298 mii->mii_media_active |= IFM_10_T; 299 else 300 mii->mii_media_active |= IFM_100_TX; 301 } |
302 mii->mii_media_active |= IFM_HDX; |
|
302 } else 303 mii->mii_media_active = ife->ifm_media; 304} | 303 } else 304 mii->mii_media_active = ife->ifm_media; 305} |