Skip to contentSkip to conversation

iw: print HE capabilities

PATCH Superseded John Crispin 2 participants 2 messages May 20, 2019 – May 23, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iw: print HE capabilities

Print the HE MAC/PHY capabilities and MCS/NSS sets.

---
 info.c |   6 ++
 iw.h   |   1 +
 util.c | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 238 insertions(+)
info.c +6 -0
index 92c7d1d..e6270c8 100644
@@ -162,7 +162,13 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
 			    tb_band[NL80211_BAND_ATTR_VHT_MCS_SET])
 				print_vht_info(nla_get_u32(tb_band[NL80211_BAND_ATTR_VHT_CAPA]),
 					       nla_data(tb_band[NL80211_BAND_ATTR_VHT_MCS_SET]));
+			if (tb_band[NL80211_BAND_ATTR_IFTYPE_DATA]) {
+				struct nlattr *nl_iftype;
+				int rem_band;
 
+				nla_for_each_nested(nl_iftype, tb_band[NL80211_BAND_ATTR_IFTYPE_DATA], rem_band)
+					print_he_info(nl_iftype);
+			}
 			if (tb_band[NL80211_BAND_ATTR_FREQS]) {
 				if (!band_had_freq) {
 					printf("\t\tFrequencies:\n");
iw.h +1 -0
index ca8a0ff..bc0b3ac 100644
@@ -197,6 +197,7 @@ void print_ampdu_length(__u8 exponent);
 void print_ampdu_spacing(__u8 spacing);
 void print_ht_capability(__u16 cap);
 void print_vht_info(__u32 capa, const __u8 *mcs);
+void print_he_info(struct nlattr *nl_iftype);
 
 char *channel_width_name(enum nl80211_chan_width width);
 const char *iftype_name(enum nl80211_iftype iftype);
util.c +231 -0

237 lines not on this page · raw message

Signature · 1 line
2.20.1
#1 lore raw

util.c void print_vht_info(__u32 capa, const __u8 *mcs) · line 1111

Quoted 4 lines · On Monday, 20 May 2019 12:54:16 CEST John Crispin wrote:
util.c +4 -0
+       char *iftypes[NUM_NL80211_IFTYPES] = {
+               "Unspec", "Adhoc", "Station", "AP", "AP/VLAN", "WDS", "Monitor"
+               "Mesh", "P2P/Client", "P2P/Go", "P2P/Device", "OCB", "NAN",
+       };

Noticed during tests with hwsim that this list is slightly incorrect - because the "," is missing after "Monitor". Thus you will now have an entry "MonitorMesh" instead of two entries "Monitor" + "Mesh". So everything after NL80211_IFTYPE_MESH_POINT is off by one.

Kind regards,
Sven