if_wi.c and devd

Robert C. Noland III rnoland at 2hip.net
Tue Aug 9 01:17:37 GMT 2005


Since the recent changes to devd matching removable interfaces by media
type rather than interface name, inserting my wi card didn't do
anything.  I would have to either manually configure it,
or /etc/rc.d/netif start wi0.

Anyway, it seems that in if_wi.c (at least if I am reading this
correctly) we only set imr->ifm_status = IFM_AVALID if the interface is
UP.  Does the following patch produce some unforseen evil?  It does make
devd happy...

--- if_wi.c.orig        Mon Aug  8 20:24:14 2005
+++ if_wi.c     Mon Aug  8 20:54:21 2005
@@ -1259,7 +1259,7 @@
        u_int16_t val;
        int rate, len;

-       if (sc->wi_gone || !sc->sc_enabled) {
+       if (sc->wi_gone) {
                imr->ifm_active = IFM_IEEE80211 | IFM_NONE;
                imr->ifm_status = 0;
                return;
@@ -1267,6 +1267,10 @@

        imr->ifm_status = IFM_AVALID;
        imr->ifm_active = IFM_IEEE80211;
+       if (!sc->sc_enabled) {
+               imr->ifm_active |= IFM_NONE;
+               return;
+       }
        if (ic->ic_state == IEEE80211_S_RUN &&
            (sc->sc_flags & WI_FLAGS_OUTRANGE) == 0)
                imr->ifm_status |= IFM_ACTIVE;


robert.




More information about the freebsd-current mailing list