Date: Sat, 26 Nov 2005 23:27:38 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 87288 for review Message-ID: <200511262327.jAQNRcwI021281@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511262327.jAQNRcwI021281>