From owner-p4-projects@FreeBSD.ORG Mon Mar 10 05:24:58 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 89FB51065676; Mon, 10 Mar 2008 05:24:58 +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 484661065673 for ; Mon, 10 Mar 2008 05:24:58 +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 4BABD8FC3C for ; Mon, 10 Mar 2008 05:24:58 +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 m2A5OwrQ034520 for ; Mon, 10 Mar 2008 05:24:58 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2A5OwoA034518 for perforce@freebsd.org; Mon, 10 Mar 2008 05:24:58 GMT (envelope-from sam@freebsd.org) Date: Mon, 10 Mar 2008 05:24:58 GMT Message-Id: <200803100524.m2A5OwoA034518@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 137290 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: Mon, 10 Mar 2008 05:24:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=137290 Change 137290 by sam@sam_ebb on 2008/03/10 05:24:20 Add IEEE80211_SCAN_NOJOIN and the equivalent ioctl flag for scan requests that want to check the scan cache for a hit before deciding whether or not to kick off a scan. This will be used to short-circuit scans done after a deauth or similar. While here correct previous addition of IEEE80211_IOC_SCAN_CHECK to not overlap with IEEE80211_SCAN_NOSSID (move the latter since it's used internally). Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#39 edit .. //depot/projects/vap/sys/net80211/ieee80211_ioctl.h#15 edit .. //depot/projects/vap/sys/net80211/ieee80211_scan.c#17 edit .. //depot/projects/vap/sys/net80211/ieee80211_scan.h#12 edit .. //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#20 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#39 (text+ko) ==== @@ -2345,7 +2345,8 @@ (IEEE80211_IOC_SCAN_NOPICK | IEEE80211_IOC_SCAN_ACTIVE | \ IEEE80211_IOC_SCAN_PICK1ST | IEEE80211_IOC_SCAN_BGSCAN | \ IEEE80211_IOC_SCAN_ONCE | IEEE80211_IOC_SCAN_NOBCAST | \ - IEEE80211_IOC_SCAN_FLUSH | IEEE80211_IOC_SCAN_CHECK) + IEEE80211_IOC_SCAN_NOJOIN | IEEE80211_IOC_SCAN_FLUSH | \ + IEEE80211_IOC_SCAN_CHECK) struct ieee80211com *ic = vap->iv_ic; struct ieee80211_scan_req sr; /* XXX off stack? */ int error, i; ==== //depot/projects/vap/sys/net80211/ieee80211_ioctl.h#15 (text+ko) ==== @@ -646,6 +646,7 @@ #define IEEE80211_IOC_SCAN_BGSCAN 0x00008 /* bg scan, exit ps at end */ #define IEEE80211_IOC_SCAN_ONCE 0x00010 /* do one complete pass */ #define IEEE80211_IOC_SCAN_NOBCAST 0x00020 /* don't send bcast probe req */ +#define IEEE80211_IOC_SCAN_NOJOIN 0x00040 /* no auto-sequencing */ #define IEEE80211_IOC_SCAN_FLUSH 0x10000 /* flush scan cache first */ #define IEEE80211_IOC_SCAN_CHECK 0x20000 /* check scan cache first */ u_int sr_duration; /* duration (ms) */ ==== //depot/projects/vap/sys/net80211/ieee80211_scan.c#17 (text+ko) ==== @@ -469,13 +469,14 @@ "%s: scan inhibited by pending channel change\n", __func__); } else if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, - "%s: %s scan, duration %u mindwell %u maxdwell %u, desired mode %s, %s%s%s%s%s\n" + "%s: %s scan, duration %u mindwell %u maxdwell %u, desired mode %s, %s%s%s%s%s%s\n" , __func__ , flags & IEEE80211_SCAN_ACTIVE ? "active" : "passive" , duration, mindwell, maxdwell , ieee80211_phymode_name[vap->iv_des_mode] , flags & IEEE80211_SCAN_FLUSH ? "flush" : "append" , flags & IEEE80211_SCAN_NOPICK ? ", nopick" : "" + , flags & IEEE80211_SCAN_NOJOIN ? ", nojoin" : "" , flags & IEEE80211_SCAN_NOBCAST ? ", nobcast" : "" , flags & IEEE80211_SCAN_PICK1ST ? ", pick1st" : "" , flags & IEEE80211_SCAN_ONCE ? ", once" : "" @@ -549,11 +550,12 @@ IEEE80211_LOCK(ic); IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, - "%s: %s scan, %s%s%s%s\n" + "%s: %s scan, %s%s%s%s%s\n" , __func__ , flags & IEEE80211_SCAN_ACTIVE ? "active" : "passive" , flags & IEEE80211_SCAN_FLUSH ? "flush" : "append" , flags & IEEE80211_SCAN_NOPICK ? ", nopick" : "" + , flags & IEEE80211_SCAN_NOJOIN ? ", nojoin" : "" , flags & IEEE80211_SCAN_PICK1ST ? ", pick1st" : "" , flags & IEEE80211_SCAN_ONCE ? ", once" : "" ); ==== //depot/projects/vap/sys/net80211/ieee80211_scan.h#12 (text+ko) ==== @@ -99,6 +99,7 @@ #define IEEE80211_SCAN_BGSCAN 0x0008 /* bg scan, exit ps at end */ #define IEEE80211_SCAN_ONCE 0x0010 /* do one complete pass */ #define IEEE80211_SCAN_NOBCAST 0x0020 /* no broadcast probe req */ +#define IEEE80211_SCAN_NOJOIN 0x0040 /* no auto-sequencing */ #define IEEE80211_SCAN_GOTPICK 0x1000 /* got candidate, can stop */ uint8_t ss_nssid; /* # ssid's to probe/match */ struct ieee80211_scan_ssid ss_ssid[IEEE80211_SCAN_MAX_SSID]; @@ -117,8 +118,8 @@ * ss_flags. It might be better to split this stuff out into * a separate variable to avoid confusion. */ -#define IEEE80211_SCAN_FLUSH 0x10000 /* flush candidate table */ -#define IEEE80211_SCAN_NOSSID 0x20000 /* don't update ssid list */ +#define IEEE80211_SCAN_FLUSH 0x00010000 /* flush candidate table */ +#define IEEE80211_SCAN_NOSSID 0x80000000 /* don't update ssid list */ struct ieee80211com; void ieee80211_scan_attach(struct ieee80211com *); ==== //depot/projects/vap/sys/net80211/ieee80211_scan_sta.c#20 (text+ko) ==== @@ -1036,6 +1036,8 @@ if (TAILQ_FIRST(&st->st_entry) == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: no scan candidate\n", __func__); + if (ss->ss_flags & IEEE80211_SCAN_NOJOIN) + return 0; notfound: /* * If nothing suitable was found decrement @@ -1049,6 +1051,8 @@ return 0; /* restart scan */ } selbs = select_bss(ss, vap, IEEE80211_MSG_SCAN); + if (ss->ss_flags & IEEE80211_SCAN_NOJOIN) + return (selbs != NULL); if (selbs == NULL || !ieee80211_sta_join(vap, &selbs->base)) goto notfound; return 1; /* terminate scan */ @@ -1374,6 +1378,8 @@ if (TAILQ_FIRST(&st->st_entry) == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: no scan candidate\n", __func__); + if (ss->ss_flags & IEEE80211_SCAN_NOJOIN) + return 0; notfound: if (vap->iv_des_nssid) { /* @@ -1405,6 +1411,8 @@ return 0; /* restart scan */ } selbs = select_bss(ss, vap, IEEE80211_MSG_SCAN); + if (ss->ss_flags & IEEE80211_SCAN_NOJOIN) + return (selbs != NULL); if (selbs == NULL || !ieee80211_sta_join(vap, &selbs->base)) goto notfound; return 1; /* terminate scan */ @@ -1570,7 +1578,7 @@ } } ap_reset_promisc(ic); - if (ss->ss_flags & IEEE80211_SCAN_NOPICK) { + if (ss->ss_flags & (IEEE80211_SCAN_NOPICK | IEEE80211_SCAN_NOJOIN)) { /* * Manual/background scan, don't select+join the * bss, just return. The scanning framework will