Date: Thu, 19 May 2005 16:06:51 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 77185 for review Message-ID: <200505191606.j4JG6pcn046173@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505191606.j4JG6pcn046173>