* 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 */
| 281 | * XXX should be private but hostap needs it to deal with CSA |
| 282 | */ |
| 283 | void |
| 284 | ieee80211_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 | |
| 320 | static __inline void |
| 321 | copy_bss(struct ieee80211_node *nbss, const struct ieee80211_node *obss) |
no test coverage detected