Date: Wed, 10 Jan 2007 07:11:14 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 112702 for review Message-ID: <200701100711.l0A7BE1s069102@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112702 Change 112702 by kmacy@kmacy_storage:sam_wifi on 2007/01/10 07:10:28 a more correct fix for creating an ibss - but channels set by ifconfig still are not sticking Affected files ... .. //depot/projects/wifi/sys/dev/wi/if_wi.c#29 edit .. //depot/projects/wifi/sys/dev/wi/if_wivar.h#10 edit Differences ... ==== //depot/projects/wifi/sys/dev/wi/if_wi.c#29 (text+ko) ==== @@ -480,7 +480,7 @@ sc->sc_system_scale = 1; sc->sc_cnfauthmode = IEEE80211_AUTH_OPEN; sc->sc_roaming_mode = 1; - + sc->wi_channel = IEEE80211_CHAN_ANYC; sc->sc_portnum = WI_DEFAULT_PORT; sc->sc_authtype = WI_DEFAULT_AUTHTYPE; @@ -669,6 +669,7 @@ struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = &sc->sc_ic; struct wi_joinreq join; + struct ieee80211_channel *chan; int i; int error = 0, wasenabled; @@ -826,9 +827,11 @@ if (ic->ic_opmode == IEEE80211_M_AHDEMO || ic->ic_opmode == IEEE80211_M_IBSS || ic->ic_opmode == IEEE80211_M_MONITOR || - ic->ic_opmode == IEEE80211_M_HOSTAP) - ieee80211_create_ibss(ic, ic->ic_curchan); - + ic->ic_opmode == IEEE80211_M_HOSTAP) { + chan = (sc->wi_channel == IEEE80211_CHAN_ANYC) ? + ic->ic_curchan : sc->wi_channel; + ieee80211_create_ibss(ic, chan); + } /* Enable interrupts */ CSR_WRITE_2(sc, WI_INT_EN, WI_INTRS); @@ -3501,7 +3504,14 @@ static void wi_set_channel(struct ieee80211com *ic) { - return; + struct ifnet *ifp = ic->ic_ifp; + struct wi_softc *sc = ifp->if_softc; + + WI_LOCK(sc); + if (!(sc->sc_flags & WI_FLAGS_SCANNING)) { + sc->wi_channel = ic->ic_curchan; + } + WI_UNLOCK(sc); } static void @@ -3511,6 +3521,7 @@ struct wi_softc *sc = ifp->if_softc; WI_LOCK(sc); + sc->sc_flags |= WI_FLAGS_SCANNING; wi_scan_ap(sc, 0x3fff, 0x000f); WI_UNLOCK(sc); @@ -3519,5 +3530,10 @@ static void wi_scan_end(struct ieee80211com *ic) { - return; + struct ifnet *ifp = ic->ic_ifp; + struct wi_softc *sc = ifp->if_softc; + + WI_LOCK(sc); + sc->sc_flags &= ~WI_FLAGS_SCANNING; + WI_UNLOCK(sc); } ==== //depot/projects/wifi/sys/dev/wi/if_wivar.h#10 (text+ko) ==== @@ -100,6 +100,7 @@ bus_space_handle_t wi_bmemhandle; bus_space_tag_t wi_bmemtag; void * wi_intrhand; + struct ieee80211_channel *wi_channel; int wi_io_addr; int wi_cmd_count; @@ -108,7 +109,7 @@ int sc_if_flags; int sc_bap_id; int sc_bap_off; - + u_int16_t sc_procframe; u_int16_t sc_portnum; @@ -201,6 +202,8 @@ #define WI_FLAGS_BUG_AUTOINC 0x0100 #define WI_FLAGS_HAS_FRAGTHR 0x0200 #define WI_FLAGS_HAS_DBMADJUST 0x0400 +#define WI_FLAGS_SCANNING 0x0800 + /* driver-specific node state */ struct wi_node {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701100711.l0A7BE1s069102>