aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2020-08-17 13:04:18 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2020-08-17 13:04:18 +0000
commit4b1c248795c2143d555b0933e09e65deb8f69309 (patch)
treeb5bcaf9bf120670946c89811789bd85de5b088b8 /sbin
parent7dd979dfef808a62a0f1092ac6772f489ca6b0ac (diff)
downloadsrc-4b1c248795c2143d555b0933e09e65deb8f69309.tar.gz
src-4b1c248795c2143d555b0933e09e65deb8f69309.zip
80211: consistently order 160 and 80+80
For flags and checks the order goes VHT160 and then VHT80P80 unless checks are in reverse order ("more comes first") in which case we deal with VHT80P80 first. The one reverse order to pick out is where we check channel prefernences. While it may seem that VHT160 is better, finding two "free" channels (VHT 80+80) is more likely so we do prefer that. While dealing with VHT160 and VHT80P80 add extra clauses previously missing or marked TODO in a few places. Reviewed by: adrian, gnn MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26002
Notes
Notes: svn path=/head/; revision=364303
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifieee80211.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 6b88b593089f..d7794be320e5 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -2176,8 +2176,6 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci,
/*
* VHT first - HT is a subset.
- *
- * XXX TODO: VHT80P80, VHT160 is not yet done.
*/
if (flags & IEEE80211_CHAN_VHT) {
if ((chanFlags & IEEE80211_CHAN_VHT20) &&
@@ -2201,7 +2199,20 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci,
"VHT80 channel\n", freq);
continue;
}
-
+ if ((chanFlags & IEEE80211_CHAN_VHT160) &&
+ (flags & IEEE80211_CHAN_VHT160) == 0) {
+ if (verbose)
+ printf("%u: skip, not a "
+ "VHT160 channel\n", freq);
+ continue;
+ }
+ if ((chanFlags & IEEE80211_CHAN_VHT80P80) &&
+ (flags & IEEE80211_CHAN_VHT80P80) == 0) {
+ if (verbose)
+ printf("%u: skip, not a "
+ "VHT80+80 channel\n", freq);
+ continue;
+ }
flags &= ~IEEE80211_CHAN_VHT;
flags |= chanFlags & IEEE80211_CHAN_VHT;
}
@@ -3958,8 +3969,11 @@ get_chaninfo(const struct ieee80211_channel *c, int precise,
if (IEEE80211_IS_CHAN_TURBO(c))
strlcat(buf, " Turbo", bsize);
if (precise) {
- /* XXX should make VHT80U, VHT80D */
- if (IEEE80211_IS_CHAN_VHT80(c) &&
+ if (IEEE80211_IS_CHAN_VHT80P80(c))
+ strlcat(buf, " vht/80p80", bsize);
+ else if (IEEE80211_IS_CHAN_VHT160(c))
+ strlcat(buf, " vht/160", bsize);
+ else if (IEEE80211_IS_CHAN_VHT80(c) &&
IEEE80211_IS_CHAN_HT40D(c))
strlcat(buf, " vht/80-", bsize);
else if (IEEE80211_IS_CHAN_VHT80(c) &&
@@ -4013,10 +4027,11 @@ print_chaninfo(const struct ieee80211_channel *c, int verb)
static int
chanpref(const struct ieee80211_channel *c)
{
+
+ if (IEEE80211_IS_CHAN_VHT80P80(c))
+ return 90;
if (IEEE80211_IS_CHAN_VHT160(c))
return 80;
- if (IEEE80211_IS_CHAN_VHT80P80(c))
- return 75;
if (IEEE80211_IS_CHAN_VHT80(c))
return 70;
if (IEEE80211_IS_CHAN_VHT40(c))