Skip to contentSkip to conversation

iw: print HE capabilities

PATCH In review John Crispin 4 participants 5 messages May 28, 2019 – Jun 7, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iw: print HE capabilities

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

---
Changes in V2
* add a missing ',' in the iftypes name list

 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
Quoted 7 lines · On Tuesday, 28 May 2019 08:58:28 CEST John Crispin wrote:

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

---
Changes in V2
* add a missing ',' in the iftypes name list

The patch was already added with the bugfix [1].

Kind regards,
Sven

[1] https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=c741be9f6ca34411c4dbeb03dd13e0dd794713a5

#2 lore raw
Quoted 8 lines · Sven Eckelmann
Quoted 7 lines · On Tuesday, 28 May 2019 08:58:28 CEST John Crispin wrote:

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

---
Changes in V2
* add a missing ',' in the iftypes name list

Quoted 6 lines

The patch was already added with the bugfix [1].

Kind regards,
Sven

[1] https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=c741be9f6ca34411c4dbeb03dd13e0dd794713a5

oh great, Thanks !

#3 lore raw
In reply to John Crispin
Quoted 1 line · John Crispin

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

trivia:

util.c

Quoted 1 line
util.c +0 -0

[]

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

Quoted 8 lines
util.c +8 -0
+void print_he_info(struct nlattr *nl_iftype)
+{
+	struct nlattr *tb[NL80211_BAND_IFTYPE_ATTR_MAX + 1];
+	struct nlattr *tb_flags[NL80211_IFTYPE_MAX + 1];
+	char *iftypes[NUM_NL80211_IFTYPES] = {
+		"Unspec", "Adhoc", "Station", "AP", "AP/VLAN", "WDS", "Monitor",
+		"Mesh", "P2P/Client", "P2P/Go", "P2P/Device", "OCB", "NAN",
+	};

Should probably be
const char * const iftypes[...]

#4 lore raw
Quoted 7 lines · Joe Perches
Quoted 1 line · John Crispin

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

trivia:

util.c

Quoted 1 line
util.c +0 -0

[]

Quoted 11 lines

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

Quoted 8 lines
util.c +8 -0
+void print_he_info(struct nlattr *nl_iftype)
+{
+	struct nlattr *tb[NL80211_BAND_IFTYPE_ATTR_MAX + 1];
+	struct nlattr *tb_flags[NL80211_IFTYPE_MAX + 1];
+	char *iftypes[NUM_NL80211_IFTYPES] = {
+		"Unspec", "Adhoc", "Station", "AP", "AP/VLAN", "WDS", "Monitor",
+		"Mesh", "P2P/Client", "P2P/Go", "P2P/Device", "OCB", "NAN",
+	};

Should probably be
const char * const iftypes[...]

We are doing this iftype string mapping in several places so a helper function may be warranted.

Gr. AvS