Date: Tue, 28 Apr 2009 20:36:07 +0000 (UTC) From: Andrew Thompson <thompsa@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r191636 - user/thompsa/vaptq/sys/net80211 Message-ID: <200904282036.n3SKa7mH059248@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: thompsa Date: Tue Apr 28 20:36:07 2009 New Revision: 191636 URL: http://svn.freebsd.org/changeset/base/191636 Log: Split out the channel logic of ieee80211_setcurchan() to ieee80211_setupcurchan() so it can be used to change the channel without deferring the driver callback. Previously the scan would not go back to the bss channel immediately since the channel change was requeued. Modified: user/thompsa/vaptq/sys/net80211/ieee80211_node.c user/thompsa/vaptq/sys/net80211/ieee80211_node.h user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Modified: user/thompsa/vaptq/sys/net80211/ieee80211_node.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_node.c Tue Apr 28 20:23:58 2009 (r191635) +++ user/thompsa/vaptq/sys/net80211/ieee80211_node.c Tue Apr 28 20:36:07 2009 (r191636) @@ -636,11 +636,11 @@ ieee80211_sync_curchan(struct ieee80211c } /* - * Change the current channel. The request channel may be + * Setup the current channel. The request channel may be * promoted if other vap's are operating with HT20/HT40. */ void -ieee80211_setcurchan(struct ieee80211com *ic, struct ieee80211_channel *c) +ieee80211_setupcurchan(struct ieee80211com *ic, struct ieee80211_channel *c) { if (ic->ic_htcaps & IEEE80211_HTC_HT) { int flags = gethtadjustflags(ic); @@ -656,10 +656,16 @@ ieee80211_setcurchan(struct ieee80211com ic->ic_bsschan = ic->ic_curchan = c; ic->ic_curmode = ieee80211_chan2mode(ic->ic_curchan); ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); - /* - * The channel change is guaranteed to have happened before the next - * state change - */ +} + +/* + * Change the current channel. The channel change is guaranteed to have + * happened before the next state change. + */ +void +ieee80211_setcurchan(struct ieee80211com *ic, struct ieee80211_channel *c) +{ + ieee80211_setupcurchan(ic, c); ieee80211_runtask(ic, &ic->ic_chan_task); } Modified: user/thompsa/vaptq/sys/net80211/ieee80211_node.h ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_node.h Tue Apr 28 20:23:58 2009 (r191635) +++ user/thompsa/vaptq/sys/net80211/ieee80211_node.h Tue Apr 28 20:36:07 2009 (r191636) @@ -286,6 +286,8 @@ void ieee80211_node_set_chan(struct ieee void ieee80211_create_ibss(struct ieee80211vap*, struct ieee80211_channel *); void ieee80211_reset_bss(struct ieee80211vap *); void ieee80211_sync_curchan(struct ieee80211com *); +void ieee80211_setupcurchan(struct ieee80211com *, + struct ieee80211_channel *); void ieee80211_setcurchan(struct ieee80211com *, struct ieee80211_channel *); int ieee80211_ibss_merge(struct ieee80211_node *); struct ieee80211_scan_entry; Modified: user/thompsa/vaptq/sys/net80211/ieee80211_scan.c ============================================================================== --- user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Tue Apr 28 20:23:58 2009 (r191635) +++ user/thompsa/vaptq/sys/net80211/ieee80211_scan.c Tue Apr 28 20:36:07 2009 (r191636) @@ -864,6 +864,7 @@ scan_task(void *arg, int pending) /* * Use an 1ms delay so the null data frame has a chance * to go out. + * XXX Should use M_TXCB mechanism to eliminate this. */ cv_timedwait(&SCAN_PRIVATE(ss)->ss_scan_cv, IEEE80211_LOCK_OBJ(ic), hz / 1000); @@ -960,8 +961,12 @@ scan_task(void *arg, int pending) ic->ic_lastscan = ticks; /* return to the bss channel */ if (ic->ic_bsschan != IEEE80211_CHAN_ANYC && - ic->ic_curchan != ic->ic_bsschan) - ieee80211_setcurchan(ic, ic->ic_bsschan); /* XXX */ + ic->ic_curchan != ic->ic_bsschan) { + ieee80211_setupcurchan(ic, ic->ic_bsschan); + IEEE80211_UNLOCK(ic); + ic->ic_set_channel(ic); + IEEE80211_LOCK(ic); + } /* clear internal flags and any indication of a pick */ SCAN_PRIVATE(ss)->ss_iflags &= ~ISCAN_REP; ss->ss_flags &= ~IEEE80211_SCAN_GOTPICK;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904282036.n3SKa7mH059248>