aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2020-08-17 12:43:07 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2020-08-17 12:43:07 +0000
commit96811be22f974e6e3a72ccba806bd3f3ba8deae6 (patch)
tree525f1a00f0b2a49b72ec03289accc39675e70092 /sbin/ifconfig
parent51ae4071cbc05848bf8c50a55a4656d6113bba53 (diff)
downloadsrc-96811be22f974e6e3a72ccba806bd3f3ba8deae6.tar.gz
src-96811be22f974e6e3a72ccba806bd3f3ba8deae6.zip
net80211 / ifconfig: cleanup the use of IEEE80211_FVHT_USEVHT*
Rather then using magic numbers duplicate IEEE80211_FVHT_VHT* in ifconfig (cleanup of these and other flags used and not exposed by net80211 should happen later) and use those. In the kernel this simplifies one ioctl path (the other one currently relies on individual bit flags being passed in). We also re-order the 80P80 and 160 flag for 160 to come before 80+80 and more clearly leave the flags as TODO in one of the 160/80+80 cases. Reviewed by: adrian MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26000
Notes
Notes: svn path=/head/; revision=364299
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/ifieee80211.c45
1 files changed, 27 insertions, 18 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 88d905698c17..ea9ee75d560e 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -129,6 +129,15 @@
#define IEEE80211_NODE_UAPSD 0x400000 /* UAPSD enabled */
#endif
+/* XXX should also figure out where to put these for k/u-space sharing. */
+#ifndef IEEE80211_FVHT_VHT
+#define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */
+#define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */
+#define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */
+#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */
+#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */
+#endif
+
#define MAXCHAN 1536 /* max 1.5K channels */
#define MAXCOL 78
@@ -5331,26 +5340,26 @@ end:
if (IEEE80211_IS_CHAN_VHT(c) || verbose) {
getvhtconf(s);
- if (vhtconf & 0x1)
+ if (vhtconf & IEEE80211_FVHT_VHT)
LINE_CHECK("vht");
else
LINE_CHECK("-vht");
- if (vhtconf & 0x2)
+ if (vhtconf & IEEE80211_FVHT_USEVHT40)
LINE_CHECK("vht40");
else
LINE_CHECK("-vht40");
- if (vhtconf & 0x4)
+ if (vhtconf & IEEE80211_FVHT_USEVHT80)
LINE_CHECK("vht80");
else
LINE_CHECK("-vht80");
- if (vhtconf & 0x8)
- LINE_CHECK("vht80p80");
- else
- LINE_CHECK("-vht80p80");
- if (vhtconf & 0x10)
+ if (vhtconf & IEEE80211_FVHT_USEVHT160)
LINE_CHECK("vht160");
else
LINE_CHECK("-vht160");
+ if (vhtconf & IEEE80211_FVHT_USEVHT80P80)
+ LINE_CHECK("vht80p80");
+ else
+ LINE_CHECK("-vht80p80");
}
if (get80211val(s, IEEE80211_IOC_WME, &wme) != -1) {
@@ -5951,16 +5960,16 @@ static struct cmd ieee80211_cmds[] = {
DEF_CMD("-ht40", 0, set80211htconf),
DEF_CMD("ht", 3, set80211htconf), /* NB: 20+40 */
DEF_CMD("-ht", 0, set80211htconf),
- DEF_CMD("vht", 1, set80211vhtconf),
- DEF_CMD("-vht", 0, set80211vhtconf),
- DEF_CMD("vht40", 2, set80211vhtconf),
- DEF_CMD("-vht40", -2, set80211vhtconf),
- DEF_CMD("vht80", 4, set80211vhtconf),
- DEF_CMD("-vht80", -4, set80211vhtconf),
- DEF_CMD("vht80p80", 8, set80211vhtconf),
- DEF_CMD("-vht80p80", -8, set80211vhtconf),
- DEF_CMD("vht160", 16, set80211vhtconf),
- DEF_CMD("-vht160", -16, set80211vhtconf),
+ DEF_CMD("vht", IEEE80211_FVHT_VHT, set80211vhtconf),
+ DEF_CMD("-vht", 0, set80211vhtconf),
+ DEF_CMD("vht40", IEEE80211_FVHT_USEVHT40, set80211vhtconf),
+ DEF_CMD("-vht40", -IEEE80211_FVHT_USEVHT40, set80211vhtconf),
+ DEF_CMD("vht80", IEEE80211_FVHT_USEVHT80, set80211vhtconf),
+ DEF_CMD("-vht80", -IEEE80211_FVHT_USEVHT80, set80211vhtconf),
+ DEF_CMD("vht160", IEEE80211_FVHT_USEVHT160, set80211vhtconf),
+ DEF_CMD("-vht160", -IEEE80211_FVHT_USEVHT160, set80211vhtconf),
+ DEF_CMD("vht80p80", IEEE80211_FVHT_USEVHT80P80, set80211vhtconf),
+ DEF_CMD("-vht80p80", -IEEE80211_FVHT_USEVHT80P80, set80211vhtconf),
DEF_CMD("rifs", 1, set80211rifs),
DEF_CMD("-rifs", 0, set80211rifs),
DEF_CMD("smps", IEEE80211_HTCAP_SMPS_ENA, set80211smps),