MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ieee80211_node_set_chan

Function ieee80211_node_set_chan

freebsd/net80211/ieee80211_node.c:283–318  ·  view source on GitHub ↗

* Set/change the channel. The rate set is also updated as * to insure a consistent view by drivers. * XXX should be private but hostap needs it to deal with CSA */

Source from the content-addressed store, hash-verified

281 * XXX should be private but hostap needs it to deal with CSA
282 */
283void
284ieee80211_node_set_chan(struct ieee80211_node *ni,
285 struct ieee80211_channel *chan)
286{
287 struct ieee80211com *ic = ni->ni_ic;
288 struct ieee80211vap *vap = ni->ni_vap;
289 enum ieee80211_phymode mode;
290
291 KASSERT(chan != IEEE80211_CHAN_ANYC, ("no channel"));
292
293 ni->ni_chan = chan;
294 mode = ieee80211_chan2mode(chan);
295 if (IEEE80211_IS_CHAN_HT(chan)) {
296 /*
297 * We must install the legacy rate est in ni_rates and the
298 * HT rate set in ni_htrates.
299 */
300 ni->ni_htrates = *ieee80211_get_suphtrates(ic, chan);
301 /*
302 * Setup bss tx parameters based on operating mode. We
303 * use legacy rates when operating in a mixed HT+non-HT bss
304 * and non-ERP rates in 11g for mixed ERP+non-ERP bss.
305 */
306 if (mode == IEEE80211_MODE_11NA &&
307 (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0)
308 mode = IEEE80211_MODE_11A;
309 else if (mode == IEEE80211_MODE_11NG &&
310 (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0)
311 mode = IEEE80211_MODE_11G;
312 if (mode == IEEE80211_MODE_11G &&
313 (vap->iv_flags & IEEE80211_F_PUREG) == 0)
314 mode = IEEE80211_MODE_11B;
315 }
316 ni->ni_txparms = &vap->iv_txparms[mode];
317 ni->ni_rates = *ieee80211_get_suprates(ic, chan);
318}
319
320static __inline void
321copy_bss(struct ieee80211_node *nbss, const struct ieee80211_node *obss)

Callers 6

ieee80211_node.cFile · 0.85
ieee80211_tmp_nodeFunction · 0.85
ieee80211_dup_bssFunction · 0.85
hostap_newstateFunction · 0.85
mesh_newstateFunction · 0.85

Calls 3

ieee80211_chan2modeFunction · 0.85
ieee80211_get_suphtratesFunction · 0.85
ieee80211_get_supratesFunction · 0.85

Tested by

no test coverage detected