diff options
author | John Crispin <john@openwrt.org> | 2014-06-02 13:10:49 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2014-06-02 13:10:49 +0000 |
commit | f3aa8a8cf41ac4df18a2409f6595a3ddc866de7b (patch) | |
tree | 3677600e12eb4f293d5f1c6ecf0ff37d4b87080b /package/network/utils/iwinfo/src/iwinfo_nl80211.c | |
parent | 8139ba35af4fb68bb2f841e310bd97e74b363c45 (diff) | |
download | master-31e0f0ae-f3aa8a8cf41ac4df18a2409f6595a3ddc866de7b.tar.gz master-31e0f0ae-f3aa8a8cf41ac4df18a2409f6595a3ddc866de7b.tar.bz2 master-31e0f0ae-f3aa8a8cf41ac4df18a2409f6595a3ddc866de7b.zip |
iwinfo: add 802.11ac hwmode support
In case of .11ac device the hwmode was not properly displayed.
This patch fixes it.
Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
SVN-Revision: 40953
Diffstat (limited to 'package/network/utils/iwinfo/src/iwinfo_nl80211.c')
-rw-r--r-- | package/network/utils/iwinfo/src/iwinfo_nl80211.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/package/network/utils/iwinfo/src/iwinfo_nl80211.c b/package/network/utils/iwinfo/src/iwinfo_nl80211.c index 8e585892d7..4a52d5ca8d 100644 --- a/package/network/utils/iwinfo/src/iwinfo_nl80211.c +++ b/package/network/utils/iwinfo/src/iwinfo_nl80211.c @@ -2159,6 +2159,7 @@ static int nl80211_get_hwmodelist_cb(struct nl_msg *msg, void *arg) int *modes = arg; int bands_remain, freqs_remain; uint16_t caps = 0; + uint32_t vht_caps = 0; struct nlattr **attr = nl80211_parse(msg); struct nlattr *bands[NL80211_BAND_ATTR_MAX + 1]; struct nlattr *freqs[NL80211_FREQUENCY_ATTR_MAX + 1]; @@ -2180,6 +2181,13 @@ static int nl80211_get_hwmodelist_cb(struct nl_msg *msg, void *arg) if (caps > 0) *modes |= IWINFO_80211_N; + if (bands[NL80211_BAND_ATTR_VHT_CAPA]) + vht_caps = nla_get_u32(bands[NL80211_BAND_ATTR_VHT_CAPA]); + + /* Treat any nonzero capability as 11ac */ + if (vht_caps > 0) + *modes |= IWINFO_80211_AC; + nla_for_each_nested(freq, bands[NL80211_BAND_ATTR_FREQS], freqs_remain) { @@ -2194,7 +2202,7 @@ static int nl80211_get_hwmodelist_cb(struct nl_msg *msg, void *arg) *modes |= IWINFO_80211_B; *modes |= IWINFO_80211_G; } - else + else if (!(*modes & IWINFO_80211_AC)) { *modes |= IWINFO_80211_A; } |