diff options
author | Adrian Chadd <adrian@FreeBSD.org> | 2016-03-18 03:55:57 +0000 |
---|---|---|
committer | Adrian Chadd <adrian@FreeBSD.org> | 2016-03-18 03:55:57 +0000 |
commit | f6759842d914f0e3b72c2aea6efe2bd94cc66b86 (patch) | |
tree | 39877d782bb8bb41dffce3313d441c2d92ef9961 /sbin/ifconfig/ifieee80211.c | |
parent | e426a812dbf29b249c06e3fbddf20c11ad18d902 (diff) | |
download | src-f6759842d914f0e3b72c2aea6efe2bd94cc66b86.tar.gz src-f6759842d914f0e3b72c2aea6efe2bd94cc66b86.zip |
Decode VHTCAP, VHTINFO and BSSLOAD.
BSSLOAD is based on work from Idwer Vollering.
Obtained from: Idwer Vollering <vidwer@gmail.com> (bssload)
Notes
Notes:
svn path=/head/; revision=297007
Diffstat (limited to 'sbin/ifconfig/ifieee80211.c')
-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 cb86a2556ea5..a2622f1c2301 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); |