Date: Tue, 15 Apr 2008 17:20:19 GMT From: Andrew Thompson <thompsa@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 140082 for review Message-ID: <200804151720.m3FHKJIl001508@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=140082 Change 140082 by thompsa@thompsa_burger on 2008/04/15 17:19:44 - Fix up ndis_ioctl logic - The ic now lives at ifp->if_l2com Affected files ... .. //depot/projects/vap/sys/dev/if_ndis/if_ndis.c#11 edit .. //depot/projects/vap/sys/dev/if_ndis/if_ndisvar.h#8 edit Differences ... ==== //depot/projects/vap/sys/dev/if_ndis/if_ndis.c#11 (text+ko) ==== @@ -700,7 +700,7 @@ /* Do media setup */ if (sc->ndis_80211) { - struct ieee80211com *ic = (void *)&sc->ic; + struct ieee80211com *ic = ifp->if_l2com; ndis_80211_rates_ex rates; struct ndis_80211_nettype_list *ntl; uint32_t arg; @@ -991,7 +991,7 @@ NDIS_UNLOCK(sc); ndis_stop(sc); if (sc->ndis_80211) - ieee80211_ifdetach(&sc->ic); + ieee80211_ifdetach(ifp->if_l2com); else ether_ifdetach(ifp); } else @@ -1467,7 +1467,7 @@ ifp = arg; sc = ifp->if_softc; - ic = &sc->ic; + ic = ifp->if_l2com; vap = TAILQ_FIRST(&ic->ic_vaps); block = dobj->do_devext; @@ -1654,7 +1654,7 @@ uint8_t rval; sc = xsc; - ic = &sc->ic; + ic = sc->ifp->if_l2com; vap = TAILQ_FIRST(&ic->ic_vaps); NDIS_LOCK(sc); @@ -1891,8 +1891,8 @@ void *xsc; { struct ndis_softc *sc = xsc; - struct ieee80211com *ic = (void *)&sc->ic; struct ifnet *ifp = sc->ifp; + struct ieee80211com *ic = ifp->if_l2com; int i, len, error; /* @@ -2058,7 +2058,7 @@ int rval = 0, len; uint32_t arg, save; - ic = &sc->ic; + ic = sc->ifp->if_l2com; len = sizeof(arg); @@ -2200,8 +2200,8 @@ uint32_t arg; struct ifnet *ifp; - ic = &sc->ic; ifp = sc->ifp; + ic = ifp->if_l2com; vap = TAILQ_FIRST(&ic->ic_vaps); ni = vap->iv_bss; @@ -2555,9 +2555,9 @@ uint32_t arg; struct ifnet *ifp; - ic = &sc->ic; + ifp = sc->ifp; + ic = ifp->if_l2com; vap = TAILQ_FIRST(&ic->ic_vaps); - ifp = sc->ifp; ni = vap->iv_bss; if (!NDIS_INITIALIZED(sc)) @@ -2693,6 +2693,7 @@ caddr_t data; { struct ndis_softc *sc = ifp->if_softc; + struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; struct ndis_oid_data oid; struct ndis_evt evt; @@ -2738,7 +2739,9 @@ break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: - if (!sc->ndis_80211) + if (sc->ndis_80211) + error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, command); + else error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; case SIOCSIFCAP: @@ -2849,8 +2852,7 @@ NDIS_UNLOCK(sc); break; default: - if (!sc->ndis_80211) - error = ether_ioctl(ifp, command, data); + error = ether_ioctl(ifp, command, data); break; } @@ -3022,9 +3024,8 @@ struct ieee80211com *ic; int i; - ic = &sc->ic; - ifp = sc->ifp; + ic = ifp->if_l2com; untimeout(ndis_tick, sc, sc->ndis_stat_ch); NDIS_LOCK(sc); @@ -3106,12 +3107,14 @@ ndis_scan(void *arg, int npending) { struct ndis_softc *sc = arg; - struct ieee80211com *ic = (void *)&sc->ic; + struct ieee80211com *ic; struct ieee80211vap *vap; - struct ieee80211_scan_state *ss = ic->ic_scan; + struct ieee80211_scan_state *ss; ndis_80211_ssid ssid; int error, len; + ic = sc->ifp->if_l2com; + ss = ic->ic_scan; vap = TAILQ_FIRST(&ic->ic_vaps); if (!NDIS_INITIALIZED(sc)) { @@ -3153,7 +3156,7 @@ static void ndis_scan_results(struct ndis_softc *sc) { - struct ieee80211com *ic = (void *)&sc->ic; + struct ieee80211com *ic; struct ieee80211vap *vap; ndis_80211_bssid_list_ex *bl; ndis_wlan_bssid_ex *wb; @@ -3166,6 +3169,7 @@ uint8_t rates[2+IEEE80211_RATE_MAXSIZE]; uint8_t *frm, *efrm; + ic = sc->ifp->if_l2com; vap = TAILQ_FIRST(&ic->ic_vaps); noise = -96; ==== //depot/projects/vap/sys/dev/if_ndis/if_ndisvar.h#8 (text+ko) ==== @@ -108,7 +108,6 @@ #define NDIS_VAP(vap) ((struct ndis_vap *)(vap)) struct ndis_softc { - struct ieee80211com ic; /* interface info */ struct ifnet *ifp; struct ifmedia ifmedia; /* media info */ u_long ndis_hwassist;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804151720.m3FHKJIl001508>