From owner-p4-projects@FreeBSD.ORG Sun Apr 6 06:46:47 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 938211065678; Sun, 6 Apr 2008 06:46:47 +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 55701106564A for ; Sun, 6 Apr 2008 06:46:47 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3CB7F8FC14 for ; Sun, 6 Apr 2008 06:46:47 +0000 (UTC) (envelope-from sam@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 m366klR6018526 for ; Sun, 6 Apr 2008 06:46:47 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m366kllw018524 for perforce@freebsd.org; Sun, 6 Apr 2008 06:46:47 GMT (envelope-from sam@freebsd.org) Date: Sun, 6 Apr 2008 06:46:47 GMT Message-Id: <200804060646.m366kllw018524@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 139442 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: Sun, 06 Apr 2008 06:46:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=139442 Change 139442 by sam@sam_ebb on 2008/04/06 06:46:38 o turn off bgscan for now; it doesn't appear to bring us back to the home channel o only issue CONFIG on INIT -> SCAN state change; other cases such as RUN -> SCAN need to not do this or the firmware goes belly up o remove IWI_DISASSOC requests if found associated when we need to push the firmware; this doesn't appear to work, we'll need to add it back in as we hit the cases (need to wait for disassoc to complete before doing further work) o handle spontaneous deauth (e.g. when inactive); clock the state machine to SCAN o remote soft locking arond iwi_init on firmware restart; this doesn't work; need to revisit when we attack firmware error handling wpa_supplicant now recovers from spontaneous deauth. Once bgscan is working again we'll be able to bypass the scan and reassociate directly like other drivers. Affected files ... .. //depot/projects/vap/sys/dev/iwi/if_iwi.c#18 edit Differences ... ==== //depot/projects/vap/sys/dev/iwi/if_iwi.c#18 (text+ko) ==== @@ -395,7 +395,9 @@ | IEEE80211_C_SHPREAMBLE /* short preamble supported */ | IEEE80211_C_WPA /* 802.11i */ | IEEE80211_C_WME /* 802.11e */ +#if 0 | IEEE80211_C_BGSCAN /* capable of bg scanning */ +#endif ; /* read MAC address from EEPROM */ @@ -1003,12 +1005,11 @@ IWI_UNLOCK(sc); break; case IEEE80211_S_SCAN: + if (vap->iv_state != IEEE80211_S_INIT) + break; iwi_queue_cmd(sc, IWI_CONFIG, 0); return EINPROGRESS; case IEEE80211_S_AUTH: - /* The firmware will fail if we are already associated */ - if (sc->flags & IWI_FLAG_ASSOCIATED) - iwi_queue_cmd(sc, IWI_DISASSOC, 0); iwi_queue_cmd(sc, IWI_AUTH, arg); return EINPROGRESS; case IEEE80211_S_RUN: @@ -1034,9 +1035,6 @@ */ if (vap->iv_state == IEEE80211_S_AUTH) break; - /* The firmware will fail if we are already associated */ - if (sc->flags & IWI_FLAG_ASSOCIATED) - iwi_queue_cmd(sc, IWI_DISASSOC, 0); iwi_queue_cmd(sc, IWI_ASSOC, arg); return EINPROGRESS; default: @@ -1477,10 +1475,20 @@ &IWI_VAP(vap)->iwi_authsuccess_task); break; case IWI_AUTH_FAIL: - DPRINTFN(2, ("Authentication failed\n")); + /* + * These are delivered as an unsolicited deauth + * (e.g. due to inactivity) or in response to an + * associate request. + */ sc->flags &= ~IWI_FLAG_ASSOCIATED; - IWI_STATE_END(sc, IWI_FW_ASSOCIATING); - /* XXX */ + if (vap->iv_state != IEEE80211_S_RUN) { + DPRINTFN(2, ("Authentication failed\n")); + IWI_STATE_END(sc, IWI_FW_ASSOCIATING); + } else { + DPRINTFN(2, ("Deauthenticated\n")); + } + taskqueue_enqueue(taskqueue_swi, + &IWI_VAP(vap)->iwi_assocfailed_task); break; case IWI_AUTH_SENT_1: case IWI_AUTH_RECV_2: @@ -1526,8 +1534,8 @@ case IWI_FW_DISASSOCIATING: DPRINTFN(2, ("Dissassociated\n")); - IWI_STATE_END(sc, - IWI_FW_DISASSOCIATING); + IWI_STATE_END(sc, IWI_FW_DISASSOCIATING); + /* XXX what next? */ break; } sc->flags &= ~IWI_FLAG_ASSOCIATED; @@ -3252,13 +3260,10 @@ iwi_restart(void *arg, int npending) { struct iwi_softc *sc = arg; - IWI_LOCK_DECL; - IWI_LOCK(sc); /* XXX not right */ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) iwi_init(sc); - IWI_UNLOCK(sc); } /*