* [PATCH] iw: handle NL80211_ATTR_EXT_FEATURES attribute
@ 2015-03-30 10:56 Janusz Dziedzic
2015-05-05 12:15 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Janusz Dziedzic @ 2015-03-30 10:56 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, Janusz Dziedzic
Print if VHT-IBSS is supported.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
info.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/info.c b/info.c
index 66887e3..91dff15 100644
--- a/info.c
+++ b/info.c
@@ -63,6 +63,18 @@ static char *dfs_state_name(enum nl80211_dfs_state state)
}
}
+static int ext_feature_isset(const unsigned char *ext_features, int ext_features_len,
+ enum nl80211_ext_feature_index ftidx)
+{
+ unsigned char ft_byte;
+
+ if ((int) ftidx / 8 >= ext_features_len)
+ return 0;
+
+ ft_byte = ext_features[ftidx / 8];
+ return (ft_byte & BIT(ftidx % 8)) != 0;
+}
+
static int print_phy_handler(struct nl_msg *msg, void *arg)
{
struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
@@ -601,6 +613,14 @@ broken_combination:
printf("\tDevice supports TDLS channel switching\n");
}
+ if (tb_msg[NL80211_ATTR_EXT_FEATURES]) {
+ struct nlattr *tb = tb_msg[NL80211_ATTR_EXT_FEATURES];
+
+ if (ext_feature_isset(nla_data(tb), nla_len(tb),
+ NL80211_EXT_FEATURE_VHT_IBSS))
+ printf("\tDevice supports VHT-IBSS.\n");
+ }
+
if (tb_msg[NL80211_ATTR_TDLS_SUPPORT])
printf("\tDevice supports T-DLS.\n");
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-05 12:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-30 10:56 [PATCH] iw: handle NL80211_ATTR_EXT_FEATURES attribute Janusz Dziedzic
2015-05-05 12:15 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).