summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2005-08-04 21:52:37 +0000
committerbrad <brad@openbsd.org>2005-08-04 21:52:37 +0000
commit10707339de187fd5be36d9cf0a63f416c508f72d (patch)
tree17d01ec9ece915f720efea9a088bf904356a3e40
parentsync (diff)
downloadwireguard-openbsd-10707339de187fd5be36d9cf0a63f416c508f72d.tar.xz
wireguard-openbsd-10707339de187fd5be36d9cf0a63f416c508f72d.zip
allow dcphy_status() to be called even when the parent interface
is in the down state. on some dc's with dcphy this will now allow the card to show carrier state and some link speed though not necessarily full-duplex for some reason. something to look into still.
-rw-r--r--sys/dev/mii/dcphy.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/dev/mii/dcphy.c b/sys/dev/mii/dcphy.c
index 9cd25cd39f5..5b6a516b525 100644
--- a/sys/dev/mii/dcphy.c
+++ b/sys/dev/mii/dcphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcphy.c,v 1.15 2005/05/27 08:04:15 brad Exp $ */
+/* $OpenBSD: dcphy.c,v 1.16 2005/08/04 21:52:37 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -193,9 +193,8 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
/*
* If we're not polling our PHY instance, just return.
*/
- if (IFM_INST(ife->ifm_media) != sc->mii_inst) {
+ if (IFM_INST(ife->ifm_media) != sc->mii_inst)
return (0);
- }
break;
case MII_MEDIACHG:
@@ -203,9 +202,8 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
* If the media indicates a different PHY instance,
* isolate ourselves.
*/
- if (IFM_INST(ife->ifm_media) != sc->mii_inst) {
+ if (IFM_INST(ife->ifm_media) != sc->mii_inst)
return (0);
- }
/*
* If the interface is not up, don't do anything.
@@ -225,11 +223,6 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
sc->mii_flags &= ~MIIF_DOINGAUTO;
(void) dcphy_mii_phy_auto(sc, 0);
break;
- case IFM_100_T4:
- /*
- * XXX Not supported as a manual setting right now.
- */
- return (EINVAL);
case IFM_100_TX:
PHY_RESET(sc);
DC_CLRBIT(dc_sc, DC_10BTCTRL, DC_TCTL_AUTONEGENBL);
@@ -326,9 +319,6 @@ dcphy_status(struct mii_softc *sc)
mii->mii_media_status = IFM_AVALID;
mii->mii_media_active = IFM_ETHER;
- if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
- return;
-
reg = CSR_READ_4(dc_sc, DC_10BTSTAT);
if (!(reg & DC_TSTAT_LS10) || !(reg & DC_TSTAT_LS100))
mii->mii_media_status |= IFM_ACTIVE;