diff options
author | adrian <adrian@FreeBSD.org> | 2016-03-18 03:55:57 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2016-03-18 03:55:57 +0000 |
commit | 08bc03ce8e1452fea8b564e81c986ff34de76fe7 (patch) | |
tree | 39877d782bb8bb41dffce3313d441c2d92ef9961 /sbin/ifconfig | |
parent | 64d71d9fb52dfdc28ac20d54f12331614735ed49 (diff) | |
download | FreeBSD-src-08bc03ce8e1452fea8b564e81c986ff34de76fe7.zip FreeBSD-src-08bc03ce8e1452fea8b564e81c986ff34de76fe7.tar.gz |
Decode VHTCAP, VHTINFO and BSSLOAD.
BSSLOAD is based on work from Idwer Vollering.
Obtained from: Idwer Vollering <vidwer@gmail.com> (bssload)
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/ifieee80211.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index cb86a25..a2622f1 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,20 @@ 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 const char * wpa_cipher(const u_int8_t *sel) { @@ -3154,6 +3207,15 @@ 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; default: if (verbose) printie(iename(vp[0]), vp, 2+vp[1], maxcols); |