From owner-p4-projects@FreeBSD.ORG Thu May 19 16:06:52 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1199B16A4D0; Thu, 19 May 2005 16:06:52 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B49D616A4CE for ; Thu, 19 May 2005 16:06:51 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8878C43D60 for ; Thu, 19 May 2005 16:06:51 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j4JG6pHW046176 for ; Thu, 19 May 2005 16:06:51 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4JG6pcn046173 for perforce@freebsd.org; Thu, 19 May 2005 16:06:51 GMT (envelope-from sam@freebsd.org) Date: Thu, 19 May 2005 16:06:51 GMT Message-Id: <200505191606.j4JG6pcn046173@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 Subject: PERFORCE change 77185 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2005 16:06:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=77185 Change 77185 by sam@sam_ebb on 2005/05/19 16:06:25 o correct handling of scan code's pwr sav state bit o return on-channel on scan complete before calling the scan policy module's pick routine; otherwise it may be on the wrong channel when it tries to contact the ap it selected o remove channel change logic from sta policy code now that the core scan code does the change Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_scan.c#4 edit .. //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#5 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_scan.c#4 (text+ko) ==== @@ -450,8 +450,10 @@ change_channel(ic, ss->ss_savchan); ic->ic_scan_end(ic); /* notify driver */ /* XXX ieee80211_end_scan or otherwise notify? */ - if (ss->ss_flags & IEEE80211_SCAN_PWRSAV) + if (ss->ss_flags & IEEE80211_SCAN_PWRSAV) { ieee80211_sta_pwrsave(vap, 0); + ss->ss_flags &= ~IEEE80211_SCAN_PWRSAV; + } /* clear ephemeral state bits */ ss->ss_flags &= ~(IEEE80211_SCAN_MINDWELL | IEEE80211_SCAN_BGSCAN | IEEE80211_SCAN_ONCE); @@ -550,16 +552,17 @@ * to end the scan before we invoke the callback method * to avoid having rx frames alter the scan candidate * list (maybe we could use a flag to have them discarded?). - * - * NB: don't blindly restore channel state; - * ss_scan_end may decide differently. */ ic->ic_scan_end(ic); /* notify driver */ if (scandone) /* record scan complete time */ ic->ic_lastscan = ticks; + /* return to the original channel */ + if (ss->ss_savchan != ic->ic_curchan) + change_channel(ic, ss->ss_savchan); /* clear mindwell lock and initial channel change flush */ ss->ss_flags &= ~(IEEE80211_SCAN_MINDWELL | IEEE80211_SCAN_DISCARD); + if (!ss->ss_ops->scan_end(ss, vap) && (ss->ss_flags & IEEE80211_SCAN_ONCE) == 0 && time_before(ticks + ss->ss_mindwell, ss->ss_scanend)) { @@ -587,9 +590,6 @@ __func__, scandone ? "done" : "stopped", ticks, ss->ss_mindwell, ss->ss_scanend); - /* return to the original channel */ - if (ss->ss_savchan != ic->ic_curchan) - change_channel(ic, ss->ss_savchan); /* * Drop out of power save mode when a scan has * completed. If this scan was prematurely terminated @@ -599,8 +599,11 @@ * save mode because the beacon indicates we have frames * waiting for us. */ - if (scandone && (ss->ss_flags & IEEE80211_SCAN_PWRSAV)) + if (scandone && + (ss->ss_flags & IEEE80211_SCAN_PWRSAV)) { ieee80211_sta_pwrsave(vap, 0); + ss->ss_flags &= ~IEEE80211_SCAN_PWRSAV; + } ic->ic_flags &= ~IEEE80211_F_SCAN; /* NB: suppress notification during bg scan */ if (scandone) ==== //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#5 (text+ko) ==== @@ -690,7 +690,6 @@ static int sta_pick_bss(struct ieee80211_scan_state *ss, struct ieee80211vap *vap) { - struct ieee80211com *ic = vap->iv_ic; struct sta_table *st = ss->ss_priv; struct sta_entry *se, *selbs; @@ -704,8 +703,6 @@ * handle notification that this has completed. */ ss->ss_flags &= ~IEEE80211_SCAN_NOPICK; - ic->ic_curchan = ss->ss_savchan; - ic->ic_set_channel(ic); return 1; } /*