From owner-p4-projects@FreeBSD.ORG Wed Oct 3 20:32:30 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B159516A421; Wed, 3 Oct 2007 20:32:29 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6895D16A41A for ; Wed, 3 Oct 2007 20:32:29 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4504C13C4A6 for ; Wed, 3 Oct 2007 20:32:29 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l93KWT7g083476 for ; Wed, 3 Oct 2007 20:32:29 GMT (envelope-from thompsa@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l93KWTjm083473 for perforce@freebsd.org; Wed, 3 Oct 2007 20:32:29 GMT (envelope-from thompsa@freebsd.org) Date: Wed, 3 Oct 2007 20:32:29 GMT Message-Id: <200710032032.l93KWTjm083473@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thompsa@freebsd.org using -f From: Andrew Thompson To: Perforce Change Reviews Cc: Subject: PERFORCE change 127136 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, 03 Oct 2007 20:32:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=127136 Change 127136 by thompsa@thompsa_heff on 2007/10/03 20:32:00 Fix adhoc mode. Obtained from: sam Affected files ... .. //depot/projects/wifi/sys/dev/ipw/if_ipw.c#36 edit Differences ... ==== //depot/projects/wifi/sys/dev/ipw/if_ipw.c#36 (text+ko) ==== @@ -849,8 +849,20 @@ ieee80211_state_name[nstate], sc->flags)); switch (nstate) { - case IEEE80211_S_SCAN: case IEEE80211_S_RUN: + if (ic->ic_opmode == IEEE80211_M_IBSS) { + /* + * XXX when joining an ibss network we are called + * with a SCAN -> RUN transition on scan complete. + * Use that to call ipw_auth_and_assoc. On completing + * the join we are then called again with an + * AUTH -> RUN transition and we want to do nothing. + * This is all totally bogus and needs to be redone. + */ + if (ic->ic_state == IEEE80211_S_SCAN) + taskqueue_enqueue_fast(taskqueue_fast, + &sc->sc_assoc_task); + } break; case IEEE80211_S_INIT: @@ -967,12 +979,13 @@ case IPW_STATE_ASSOCIATED: DPRINTFN(2, ("Association succeeded (%s flags 0x%x)\n", IEEESTATE(ic), sc->flags)); - if (sc->flags & IPW_FLAG_SCANNING) { - ieee80211_cancel_scan(ic); - sc->flags &= ~IPW_FLAG_SCANNING; - } sc->flags |= IPW_FLAG_ASSOCIATED; - ieee80211_new_state(ic, IEEE80211_S_RUN, -1); + /* XXX suppress state change in case the fw auto-associates */ + if (ic->ic_state != IEEE80211_S_ASSOC) { + DPRINTF(("Unexpected association (state %u)\n", + ic->ic_state)); + } else + ieee80211_new_state(ic, IEEE80211_S_RUN, -1); break; case IPW_STATE_SCANNING: @@ -2794,8 +2807,7 @@ IPW_LOCK_DECL; IPW_LOCK(sc); - if (ic->ic_opmode == IEEE80211_M_IBSS || - ic->ic_opmode == IEEE80211_M_MONITOR) { + if (ic->ic_opmode == IEEE80211_M_MONITOR) { ipw_disable(sc); ipw_setchannel(sc, ic->ic_curchan); ipw_enable(sc);