summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig/ifieee80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ifconfig/ifieee80211.c')
-rw-r--r--sbin/ifconfig/ifieee80211.c95
1 files changed, 86 insertions, 9 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 5ababf3..84daec9 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -2534,6 +2534,45 @@ printwmeinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
}
static void
+printvhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
+{
+ printf("%s", tag);
+ if (verbose) {
+ const struct ieee80211_ie_vhtcap *vhtcap =
+ (const struct ieee80211_ie_vhtcap *) ie;
+ uint32_t vhtcap_info = LE_READ_4(&vhtcap->vht_cap_info);
+
+ printf("<cap 0x%08x", vhtcap_info);
+ printf(" rx_mcs_map 0x%x",
+ LE_READ_2(&vhtcap->supp_mcs.rx_mcs_map));
+ printf(" rx_highest %d",
+ LE_READ_2(&vhtcap->supp_mcs.rx_highest) & 0x1fff);
+ printf(" tx_mcs_map 0x%x",
+ LE_READ_2(&vhtcap->supp_mcs.tx_mcs_map));
+ printf(" tx_highest %d",
+ LE_READ_2(&vhtcap->supp_mcs.tx_highest) & 0x1fff);
+
+ printf(">");
+ }
+}
+
+static void
+printvhtinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
+{
+ printf("%s", tag);
+ if (verbose) {
+ const struct ieee80211_ie_vht_operation *vhtinfo =
+ (const struct ieee80211_ie_vht_operation *) ie;
+
+ printf("<chw %d freq1_idx %d freq2_idx %d basic_mcs_set 0x%04x>",
+ vhtinfo->chan_width,
+ vhtinfo->center_freq_seg1_idx,
+ vhtinfo->center_freq_seg2_idx,
+ LE_READ_2(&vhtinfo->basic_mcs_set));
+ }
+}
+
+static void
printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
{
printf("%s", tag);
@@ -2674,6 +2713,40 @@ do { \
#undef MATCHOUI
}
+static void
+printbssload(const char *tag, const uint8_t *ie, size_t ielen, int maxlen)
+{
+ printf("%s", tag);
+ if (verbose) {
+ const struct ieee80211_bss_load_ie *bssload =
+ (const struct ieee80211_bss_load_ie *) ie;
+ printf("<sta count %d, chan load %d, aac %d>",
+ LE_READ_2(&bssload->sta_count),
+ bssload->chan_load,
+ bssload->aac);
+ }
+}
+
+static void
+printapchanrep(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
+{
+ printf("%s", tag);
+ if (verbose) {
+ const struct ieee80211_ap_chan_report_ie *ap =
+ (const struct ieee80211_ap_chan_report_ie *) ie;
+ const char *sep = "";
+ int i;
+
+ printf("<class %u, chan:[", ap->i_class);
+
+ for (i = 3; i < ielen; i++) {
+ printf("%s%u", sep, ie[i]);
+ sep = ",";
+ }
+ printf("]>");
+ }
+}
+
static const char *
wpa_cipher(const u_int8_t *sel)
{
@@ -3018,14 +3091,6 @@ printcountry(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen)
printf(">");
}
-/* unaligned little endian access */
-#define LE_READ_4(p) \
- ((u_int32_t) \
- ((((const u_int8_t *)(p))[0] ) | \
- (((const u_int8_t *)(p))[1] << 8) | \
- (((const u_int8_t *)(p))[2] << 16) | \
- (((const u_int8_t *)(p))[3] << 24)))
-
static __inline int
iswpaoui(const u_int8_t *frm)
{
@@ -3084,9 +3149,9 @@ iename(int elemid)
case IEEE80211_ELEMID_MEASREP: return " MEASREP";
case IEEE80211_ELEMID_QUIET: return " QUIET";
case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS";
- case IEEE80211_ELEMID_APCHANREP:return " APCHANREP";
case IEEE80211_ELEMID_TPC: return " TPC";
case IEEE80211_ELEMID_CCKM: return " CCKM";
+ case IEEE80211_ELEMID_VHT_PWR_ENV: return " VHTPWRENV";
}
return " ???";
}
@@ -3151,6 +3216,18 @@ printies(const u_int8_t *vp, int ielen, int maxcols)
case IEEE80211_ELEMID_MESHCONF:
printmeshconf(" MESHCONF", vp, 2+vp[1], maxcols);
break;
+ case IEEE80211_ELEMID_VHT_CAP:
+ printvhtcap(" VHTCAP", vp, 2+vp[1], maxcols);
+ break;
+ case IEEE80211_ELEMID_VHT_OPMODE:
+ printvhtinfo(" VHTOPMODE", vp, 2+vp[1], maxcols);
+ break;
+ case IEEE80211_ELEMID_BSSLOAD:
+ printbssload(" BSSLOAD", vp, 2+vp[1], maxcols);
+ break;
+ case IEEE80211_ELEMID_APCHANREP:
+ printapchanrep(" APCHANREP", vp, 2+vp[1], maxcols);
+ break;
default:
if (verbose)
printie(iename(vp[0]), vp, 2+vp[1], maxcols);
OpenPOWER on IntegriCloud