From owner-p4-projects@FreeBSD.ORG Wed Jan 10 07:11:15 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 23C1D16A40F; Wed, 10 Jan 2007 07:11:15 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2CC016A403 for ; Wed, 10 Jan 2007 07:11:14 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id E214613C459 for ; Wed, 10 Jan 2007 07:11:14 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l0A7BEl8069109 for ; Wed, 10 Jan 2007 07:11:14 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0A7BE1s069102 for perforce@freebsd.org; Wed, 10 Jan 2007 07:11:14 GMT (envelope-from kmacy@freebsd.org) Date: Wed, 10 Jan 2007 07:11:14 GMT Message-Id: <200701100711.l0A7BE1s069102@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 112702 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jan 2007 07:11:15 -0000 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 {