Skip to content

Commit

Permalink
iw: handle NL80211_ATTR_EXT_FEATURES attribute
Browse files Browse the repository at this point in the history
Print if VHT-IBSS is supported.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
dziedjan authored and jmberg-intel committed May 5, 2015
1 parent a9e3804 commit f0e30bd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -601,6 +613,14 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
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");

Expand Down

0 comments on commit f0e30bd

Please sign in to comment.