diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-05-08 13:14:36 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-05-08 13:29:10 +0200 |
commit | 7b39bee1c62dc68c84938cda43115e4d30724d1e (patch) | |
tree | aa0c1961e4320b6eeebf3c0169e984ef99a8c464 /iwinfo_wl.c | |
parent | 9842d2507fa19cdf7d0bfd76df73609d14473b49 (diff) | |
download | iwinfo-7b39bee1c62dc68c84938cda43115e4d30724d1e.tar.gz |
iwinfo: add support for querying available HT modes
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'iwinfo_wl.c')
-rw-r--r-- | iwinfo_wl.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/iwinfo_wl.c b/iwinfo_wl.c index 7cbda96..c7517ec 100644 --- a/iwinfo_wl.c +++ b/iwinfo_wl.c @@ -630,6 +630,29 @@ static int wl_get_hwmodelist(const char *ifname, int *buf) return -1; } +static int wl_get_htmodelist(const char *ifname, int *buf) +{ + int modes; + + if (!wl_get_hwmodelist(ifname, &modes)) + { + *buf = 0; + + /* FIXME: determine real capabilities */ + + if (modes & IWINFO_80211_N) + *buf |= IWINFO_HTMODE_HT20 | IWINFO_HTMODE_HT40; + + if (modes & IWINFO_80211_AC) + *buf |= IWINFO_HTMODE_VHT20 | IWINFO_HTMODE_VHT40 | + IWINFO_HTMODE_VHT80; + + return 0; + } + + return -1; +} + static int wl_get_mbssid_support(const char *ifname, int *buf) { wlc_rev_info_t revinfo; @@ -715,6 +738,7 @@ const struct iwinfo_ops wl_ops = { .quality_max = wl_get_quality_max, .mbssid_support = wl_get_mbssid_support, .hwmodelist = wl_get_hwmodelist, + .htmodelist = wl_get_htmodelist, .mode = wl_get_mode, .ssid = wl_get_ssid, .bssid = wl_get_bssid, |