From owner-p4-projects@FreeBSD.ORG Fri Oct 29 21:56:20 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 15C5016A4D0; Fri, 29 Oct 2004 21:56:20 +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 DD81F16A4CE for ; Fri, 29 Oct 2004 21:56:19 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4C3A43D55 for ; Fri, 29 Oct 2004 21:56:19 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9TLuJDc001452 for ; Fri, 29 Oct 2004 21:56:19 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9TLuJh7001449 for perforce@freebsd.org; Fri, 29 Oct 2004 21:56:19 GMT (envelope-from sam@freebsd.org) Date: Fri, 29 Oct 2004 21:56:19 GMT Message-Id: <200410292156.i9TLuJh7001449@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 63951 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: Fri, 29 Oct 2004 21:56:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=63951 Change 63951 by sam@sam_ebb on 2004/10/29 21:55:55 fixup manual scanning and a reverse some copyout parameters to fix a couple of other ioctl's Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#7 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#7 (text+ko) ==== @@ -401,9 +401,8 @@ * the active list as the place to start the scan. */ static int -ieee80211_setupscan(struct ieee80211com *ic) +ieee80211_setupscan(struct ieee80211com *ic, const u_int8_t chanlist[]) { - u_char *chanlist = ic->ic_chan_active; int i; /* @@ -430,6 +429,14 @@ if (ic->ic_bss->ni_chan == IEEE80211_CHAN_ANYC || isclr(chanlist, ieee80211_chan2ieee(ic, ic->ic_bss->ni_chan))) ic->ic_bss->ni_chan = ic->ic_ibss_chan; + 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; } @@ -727,7 +734,7 @@ case WI_RID_SCAN_REQ: /* XXX wicontrol */ if (ic->ic_opmode == IEEE80211_M_HOSTAP) break; - error = ieee80211_setupscan(ic); + error = ieee80211_setupscan(ic, ic->ic_chan_avail); if (error == 0) error = ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); break; @@ -759,9 +766,7 @@ } setbit(chanlist, i); } - memcpy(ic->ic_chan_active, chanlist, - sizeof(ic->ic_chan_active)); - error = ieee80211_setupscan(ic); + error = ieee80211_setupscan(ic, chanlist); if (wreq.wi_type == WI_RID_CHANNEL_LIST) { /* NB: ignore error from ieee80211_setupscan */ error = ENETRESET; @@ -1156,7 +1161,7 @@ /* NB: truncate, caller can check length */ if (ireq->i_len > ic->ic_opt_ie_len) ireq->i_len = ic->ic_opt_ie_len; - error = copyout(ireq->i_data, ic->ic_opt_ie, ireq->i_len); + error = copyout(ic->ic_opt_ie, ireq->i_data, ireq->i_len); break; case IEEE80211_IOC_WPAKEY: error = ieee80211_ioctl_getkey(ic, ireq); @@ -1167,11 +1172,10 @@ case IEEE80211_IOC_BSSID: if (ireq->i_len != IEEE80211_ADDR_LEN) return EINVAL; - error = copyout(ireq->i_data, - ic->ic_state == IEEE80211_S_RUN ? + error = copyout(ic->ic_state == IEEE80211_S_RUN ? ic->ic_bss->ni_bssid : ic->ic_des_bssid, - ireq->i_len); + ireq->i_data, ireq->i_len); break; case IEEE80211_IOC_WPAIE: error = ieee80211_ioctl_getwpaie(ic, ireq); @@ -1809,7 +1813,7 @@ case IEEE80211_IOC_SCAN_REQ: if (ic->ic_opmode == IEEE80211_M_HOSTAP) break; - error = ieee80211_setupscan(ic); + error = ieee80211_setupscan(ic, ic->ic_chan_avail); if (error == 0) error = ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); break;