From 237437e847fc50c5fe06027e919284e996faaa1a Mon Sep 17 00:00:00 2001 From: PolynomialDivision Date: Tue, 29 May 2018 20:06:27 +0200 Subject: [PATCH] support vht --- src/include/dawn_iwinfo.h | 4 ++++ src/utils/dawn_iwinfo.c | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/include/dawn_iwinfo.h b/src/include/dawn_iwinfo.h index 8878223..5b143b5 100644 --- a/src/include/dawn_iwinfo.h +++ b/src/include/dawn_iwinfo.h @@ -61,4 +61,8 @@ int get_ssid(const char *ifname, char *ssid); int get_channel_utilization(const char *ifname, uint64_t *last_channel_time, uint64_t *last_channel_time_busy); +int support_ht(const char *ifname); + +int support_vht(const char *ifname); + #endif //DAWN_RSSI_H diff --git a/src/utils/dawn_iwinfo.c b/src/utils/dawn_iwinfo.c index 07f763b..028c0f1 100644 --- a/src/utils/dawn_iwinfo.c +++ b/src/utils/dawn_iwinfo.c @@ -312,8 +312,26 @@ int support_ht(const char *ifname) { return 0; } - uint32_t ht_support_bitmask = (1 << 2) | (1 << 3); + uint32_t ht_support_bitmask = (1 << 0) | (1 << 2); int ret = htmodes & ht_support_bitmask; iwinfo_finish(); return ret; +} + +int support_vht(const char *ifname) { + const struct iwinfo_ops *iw; + + iw = iwinfo_backend(ifname); + int htmodes = 0; + + if (iw->htmodelist(ifname, &htmodes)) + { + printf("No HT mode information available\n"); + return 0; + } + + uint32_t vht_support_bitmask = (1 << 2) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 6); + int ret = htmodes & vht_support_bitmask; + iwinfo_finish(); + return ret; } \ No newline at end of file