summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-08-13 00:04:42 +0000
committersam <sam@FreeBSD.org>2005-08-13 00:04:42 +0000
commita11b2e92bda0b49b1ef1d73dc46c289cca59dcf1 (patch)
tree962b43a0d175d00bc19e64edb2ccabb8a5c30f2c
parentc7715b87d693fed356911fad6776d2dd62f33134 (diff)
downloadFreeBSD-src-a11b2e92bda0b49b1ef1d73dc46c289cca59dcf1.zip
FreeBSD-src-a11b2e92bda0b49b1ef1d73dc46c289cca59dcf1.tar.gz
fix media_status so devd recognizes the device as an 802.11 interface
Submitted by: Robert C. Noland III
-rw-r--r--sys/dev/wi/if_wi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index fc9ab4d..0b01387 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -1259,7 +1259,7 @@ wi_media_status(struct ifnet *ifp, struct ifmediareq *imr)
u_int16_t val;
int rate, len;
- if (sc->wi_gone || !sc->sc_enabled) {
+ if (sc->wi_gone) { /* hardware gone (e.g. ejected) */
imr->ifm_active = IFM_IEEE80211 | IFM_NONE;
imr->ifm_status = 0;
return;
@@ -1267,6 +1267,11 @@ wi_media_status(struct ifnet *ifp, struct ifmediareq *imr)
imr->ifm_status = IFM_AVALID;
imr->ifm_active = IFM_IEEE80211;
+ if (!sc->sc_enabled) { /* port !enabled, have no status */
+ imr->ifm_active |= IFM_NONE;
+ imr->ifm_status = IFM_AVALID;
+ return;
+ }
if (ic->ic_state == IEEE80211_S_RUN &&
(sc->sc_flags & WI_FLAGS_OUTRANGE) == 0)
imr->ifm_status |= IFM_ACTIVE;
OpenPOWER on IntegriCloud