From ba23dd44acc382a9f09e20743d14299e3583246c Mon Sep 17 00:00:00 2001 From: Jason Wright Date: Tue, 29 Aug 2000 19:00:37 +0000 Subject: openbsdisms --- sys/dev/mii/brgphy.c | 5 ++++- sys/dev/mii/xmphy.c | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index c7c31a96958..956450b5822 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: brgphy.c,v 1.1 2000/08/28 05:22:25 jason Exp $ */ +/* $OpenBSD: brgphy.c,v 1.2 2000/08/29 19:00:36 jason Exp $ */ /* * Copyright (c) 2000 @@ -127,6 +127,9 @@ brgphy_service(sc, mii, cmd) struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; + if ((sc->mii_dev.dv_flags & DVF_ACTIVE) == 0) + return (ENXIO); + switch (cmd) { case MII_POLLSTAT: /* diff --git a/sys/dev/mii/xmphy.c b/sys/dev/mii/xmphy.c index 264dd48956c..e71e5cff455 100644 --- a/sys/dev/mii/xmphy.c +++ b/sys/dev/mii/xmphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xmphy.c,v 1.1 2000/08/28 13:40:23 jason Exp $ */ +/* $OpenBSD: xmphy.c,v 1.2 2000/08/29 19:00:36 jason Exp $ */ /* * Copyright (c) 2000 @@ -104,7 +104,7 @@ xmphy_attach(parent, self, aux) sc->mii_service = xmphy_service; sc->mii_status = xmphy_status; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; + sc->mii_flags |= MIIF_NOISOLATE | mii->mii_flags; #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) @@ -130,6 +130,9 @@ xmphy_service(sc, mii, cmd) struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; + if ((sc->mii_dev.dv_flags & DVF_ACTIVE) == 0) + return (ENXIO); + switch (cmd) { case MII_POLLSTAT: /* -- cgit v1.2.3