FreeBSD/sys/dev/iwn/if_iwn.c
/*
 * Callback from net80211 to force a channel change.
 */
Callback from net80211 to force a channel change.
Callback from net80211 to force a channel change .
static void
iwn_set_channel(struct ieee80211com *ic)
{
	const struct ieee80211_channel *c = ic->ic_curchan;
	struct iwn_softc *sc = ic->ic_softc;
	int error;
	DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);
	IWN_LOCK(sc);
	sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq);
	sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags);
	sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq);
	sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags);
	if (ic->ic_opmode == IEEE80211_M_MONITOR) {
		error = iwn_config(sc);
		if (error != 0)
		device_printf(sc->sc_dev,
		    "%s: error %d settting channel\n", __func__, error);
	}
	IWN_UNLOCK(sc);
}
static void iwn_set_channel ( struct ieee80211com * ic ) { const struct ieee80211_channel * c = ic -> ic_curchan ; struct iwn_softc * sc = ic -> ic_softc ; int error ; DPRINTF ( sc , IWN_DEBUG_TRACE , " \n " , __func__ ) ; IWN_LOCK ( sc ) ; sc -> sc_rxtap . wr_chan_freq = htole16 ( c -> ic_freq ) ; sc -> sc_rxtap . wr_chan_flags = htole16 ( c -> ic_flags ) ; sc -> sc_txtap . wt_chan_freq = htole16 ( c -> ic_freq ) ; sc -> sc_txtap . wt_chan_flags = htole16 ( c -> ic_flags ) ; if ( ic -> ic_opmode == IEEE80211_M_MONITOR ) { error = iwn_config ( sc ) ; if ( error != 0 ) device_printf ( sc -> sc_dev , " \n " , __func__ , error ) ; } IWN_UNLOCK ( sc ) ; }
Callback from net80211 to force a channel change.
Callback from net80211 to force a channel change .
/*
	 * Only need to set the channel in Monitor mode. AP scanning and auth
	 * are already taken care of by their respective firmware commands.
	 */