From owner-p4-projects@FreeBSD.ORG Sat Nov 26 23:27:40 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C40D316A423; Sat, 26 Nov 2005 23:27:39 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 99AD216A41F for ; Sat, 26 Nov 2005 23:27:39 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37D2D43D58 for ; Sat, 26 Nov 2005 23:27:39 +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 jAQNRd3S021284 for ; Sat, 26 Nov 2005 23:27:39 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jAQNRcwI021281 for perforce@freebsd.org; Sat, 26 Nov 2005 23:27:38 GMT (envelope-from sam@freebsd.org) Date: Sat, 26 Nov 2005 23:27:38 GMT Message-Id: <200511262327.jAQNRcwI021281@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 87288 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: Sat, 26 Nov 2005 23:27:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=87288 Change 87288 by sam@sam_ebb on 2005/11/26 23:26:38 fix ifconfig scan Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#51 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#51 (text+ko) ==== @@ -74,37 +74,7 @@ static struct ieee80211_channel *findchannel(struct ieee80211com *, int ieee, int mode); -/* - * Prepare to do a user-initiated scan for AP's. If no - * current/default channel is setup or the current channel - * is invalid then pick the first available channel from - * the active list as the place to start the scan. - */ static int -ieee80211_setupscan(struct ieee80211com *ic, const u_int8_t chanlist[]) -{ - /* - * XXX don't permit a scan to be started unless we - * know the device is ready. For the moment this means - * the device is marked up as this is the required to - * initialize the hardware. It would be better to permit - * scanning prior to being up but that'll require some - * changes to the infrastructure. - */ - if (!IS_UP(ic)) - return EINVAL; - memcpy(ic->ic_chan_active, chanlist, sizeof(ic->ic_chan_active)); - /* - * We force the state to INIT before calling ieee80211_new_state - * to get ieee80211_begin_scan called. We really want to scan w/o - * altering the current state but that's not possible right now. - */ - /* XXX handle proberequest case */ - ic->ic_state = IEEE80211_S_INIT; /* XXX bypass state machine */ - return 0; -} - -static int cap2cipher(int flag) { switch (flag) { @@ -1837,11 +1807,14 @@ error = ieee80211_ioctl_setchanlist(ic, ireq); break; case IEEE80211_IOC_SCAN_REQ: - if (ic->ic_opmode == IEEE80211_M_HOSTAP) /* XXX ignore */ - break; - error = ieee80211_setupscan(ic, ic->ic_chan_avail); - if (error == 0) /* XXX background scan */ - error = ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); + if (!IS_UP(ic)) + return EINVAL; + (void) ieee80211_start_scan(ic, + IEEE80211_SCAN_ACTIVE | + IEEE80211_SCAN_NOPICK | + IEEE80211_SCAN_ONCE, IEEE80211_SCAN_FOREVER, + /* XXX use ioctl params */ + ic->ic_des_nssid, ic->ic_des_ssid); break; case IEEE80211_IOC_ADDMAC: case IEEE80211_IOC_DELMAC: