aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/rtwn
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2020-08-24 13:15:08 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2020-08-24 13:15:08 +0000
commit2b9f12f6b2f5284999ab0a63037943dea5cfbedf (patch)
treedefdf18c9d25b017cd3697aa4f61ab270b6059c9 /sys/dev/rtwn
parenta333a508a20df6d9c94927a0176d40c896dd52de (diff)
downloadsrc-2b9f12f6b2f5284999ab0a63037943dea5cfbedf.tar.gz
src-2b9f12f6b2f5284999ab0a63037943dea5cfbedf.zip
net80211: enhance getflags*() and ieee80211_add_channel*()
For ieee80211_add_channel+*() we are passing in an int flag for ht40 and in some cases another int flag for vht80 where we'd only need two bits really. Convert these variables to a bitflag and fold them together into one. This also allows for VHT160 and VHT80P80 and whatever may come to be considered. Define the various options currently needed. Change the drivers (rtwn and rsu) which actually set this bit to non-0. For convenience the "1" currently used for HT40 is preserved. Enahnce getflags_5ghz() to handle the full set of VHT flags based on the input flags from the the driver. Update the regdomain implementation as well to make use of the new flags and deal with higher [V]HT bandwidths. ieee80211_add_channel() specifically did not take flags so it will not support naything beyond 20Mhz channels. Note: I am not entirely happy with the "cbw_flag[s]" name, but we do use chan_flags elsewhere already. MFC after: 2 weeks Reviewed by: adrian, gnn Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential revision: https://reviews.freebsd.org/D26091
Notes
Notes: svn path=/head/; revision=364673
Diffstat (limited to 'sys/dev/rtwn')
-rw-r--r--sys/dev/rtwn/if_rtwn.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c
index e410010cc433..499ae4ebcd6f 100644
--- a/sys/dev/rtwn/if_rtwn.c
+++ b/sys/dev/rtwn/if_rtwn.c
@@ -1525,25 +1525,29 @@ rtwn_getradiocaps(struct ieee80211com *ic,
{
struct rtwn_softc *sc = ic->ic_softc;
uint8_t bands[IEEE80211_MODE_BYTES];
- int i;
+ int cbw_flags, i;
+
+ cbw_flags = (ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) ?
+ NET80211_CBW_FLAG_HT40 : 0;
memset(bands, 0, sizeof(bands));
setbit(bands, IEEE80211_MODE_11B);
setbit(bands, IEEE80211_MODE_11G);
setbit(bands, IEEE80211_MODE_11NG);
ieee80211_add_channels_default_2ghz(chans, maxchans, nchans,
- bands, !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40));
+ bands, cbw_flags);
/* XXX workaround add_channel_list() limitations */
setbit(bands, IEEE80211_MODE_11A);
setbit(bands, IEEE80211_MODE_11NA);
for (i = 0; i < nitems(sc->chan_num_5ghz); i++) {
+
if (sc->chan_num_5ghz[i] == 0)
continue;
ieee80211_add_channel_list_5ghz(chans, maxchans, nchans,
sc->chan_list_5ghz[i], sc->chan_num_5ghz[i], bands,
- !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40));
+ cbw_flags);
}
}