ukphy_subr.c (59760) | ukphy_subr.c (95723) |
---|---|
1/* $NetBSD: ukphy_subr.c,v 1.2 1998/11/05 04:08:02 thorpej Exp $ */ 2 3/*- 4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, --- 43 unchanged lines hidden (view full) --- 52 53#include <dev/mii/mii.h> 54#include <dev/mii/miivar.h> 55 56#include "miibus_if.h" 57 58#if !defined(lint) 59static const char rcsid[] = | 1/* $NetBSD: ukphy_subr.c,v 1.2 1998/11/05 04:08:02 thorpej Exp $ */ 2 3/*- 4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, --- 43 unchanged lines hidden (view full) --- 52 53#include <dev/mii/mii.h> 54#include <dev/mii/miivar.h> 55 56#include "miibus_if.h" 57 58#if !defined(lint) 59static const char rcsid[] = |
60 "$FreeBSD: head/sys/dev/mii/ukphy_subr.c 59760 2000-04-29 15:36:14Z phk $"; | 60 "$FreeBSD: head/sys/dev/mii/ukphy_subr.c 95723 2002-04-29 13:35:31Z phk $"; |
61#endif 62 63/* 64 * Media status subroutine. If a PHY driver does media detection simply 65 * by decoding the NWay autonegotiation, use this routine. 66 */ 67void | 61#endif 62 63/* 64 * Media status subroutine. If a PHY driver does media detection simply 65 * by decoding the NWay autonegotiation, use this routine. 66 */ 67void |
68ukphy_status(phy) 69 struct mii_softc *phy; | 68ukphy_status(struct mii_softc *phy) |
70{ 71 struct mii_data *mii = phy->mii_pdata; | 69{ 70 struct mii_data *mii = phy->mii_pdata; |
71 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; |
|
72 int bmsr, bmcr, anlpar; 73 74 mii->mii_media_status = IFM_AVALID; 75 mii->mii_media_active = IFM_ETHER; 76 77 bmsr = PHY_READ(phy, MII_BMSR) | PHY_READ(phy, MII_BMSR); 78 if (bmsr & BMSR_LINK) 79 mii->mii_media_status |= IFM_ACTIVE; --- 29 unchanged lines hidden (view full) --- 109 mii->mii_media_active |= IFM_100_TX; 110 else if (anlpar & ANLPAR_10_FD) 111 mii->mii_media_active |= IFM_10_T|IFM_FDX; 112 else if (anlpar & ANLPAR_10) 113 mii->mii_media_active |= IFM_10_T; 114 else 115 mii->mii_media_active |= IFM_NONE; 116 } else | 72 int bmsr, bmcr, anlpar; 73 74 mii->mii_media_status = IFM_AVALID; 75 mii->mii_media_active = IFM_ETHER; 76 77 bmsr = PHY_READ(phy, MII_BMSR) | PHY_READ(phy, MII_BMSR); 78 if (bmsr & BMSR_LINK) 79 mii->mii_media_status |= IFM_ACTIVE; --- 29 unchanged lines hidden (view full) --- 109 mii->mii_media_active |= IFM_100_TX; 110 else if (anlpar & ANLPAR_10_FD) 111 mii->mii_media_active |= IFM_10_T|IFM_FDX; 112 else if (anlpar & ANLPAR_10) 113 mii->mii_media_active |= IFM_10_T; 114 else 115 mii->mii_media_active |= IFM_NONE; 116 } else |
117 mii->mii_media_active = mii_media_from_bmcr(bmcr); | 117 mii->mii_media_active = ife->ifm_media; |
118} | 118} |