* Setup the current channel. The request channel may be * promoted if other vap's are operating with HT20/HT40. */
| 780 | * promoted if other vap's are operating with HT20/HT40. |
| 781 | */ |
| 782 | void |
| 783 | ieee80211_setupcurchan(struct ieee80211com *ic, struct ieee80211_channel *c) |
| 784 | { |
| 785 | if (ic->ic_htcaps & IEEE80211_HTC_HT) { |
| 786 | int flags = gethtadjustflags(ic); |
| 787 | /* |
| 788 | * Check for channel promotion required to support the |
| 789 | * set of running vap's. This assumes we are called |
| 790 | * after ni_chan is setup for each vap. |
| 791 | */ |
| 792 | /* XXX VHT? */ |
| 793 | /* NB: this assumes IEEE80211_FHT_USEHT40 > IEEE80211_FHT_HT */ |
| 794 | if (flags > ieee80211_htchanflags(c)) |
| 795 | c = ieee80211_ht_adjust_channel(ic, c, flags); |
| 796 | } |
| 797 | |
| 798 | /* |
| 799 | * VHT promotion - this will at least promote to VHT20/40 |
| 800 | * based on what HT has done; it may further promote the |
| 801 | * channel to VHT80 or above. |
| 802 | */ |
| 803 | if (ic->ic_vhtcaps != 0) { |
| 804 | int flags = getvhtadjustflags(ic); |
| 805 | if (flags > ieee80211_vhtchanflags(c)) |
| 806 | c = ieee80211_vht_adjust_channel(ic, c, flags); |
| 807 | } |
| 808 | |
| 809 | ic->ic_bsschan = ic->ic_curchan = c; |
| 810 | ic->ic_curmode = ieee80211_chan2mode(ic->ic_curchan); |
| 811 | ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); |
| 812 | } |
| 813 | |
| 814 | /* |
| 815 | * Change the current channel. The channel change is guaranteed to have |
no test coverage detected