From 2c13c27b947903e91a567f0cf338f42e82dfe154 Mon Sep 17 00:00:00 2001 From: PolynomialDivision Date: Tue, 29 May 2018 20:03:51 +0200 Subject: [PATCH] use htmodes --- src/utils/dawn_iwinfo.c | 18 ++++++++++++++++++ src/utils/ubus.c | 2 ++ 2 files changed, 20 insertions(+) diff --git a/src/utils/dawn_iwinfo.c b/src/utils/dawn_iwinfo.c index f6040f3..07f763b 100644 --- a/src/utils/dawn_iwinfo.c +++ b/src/utils/dawn_iwinfo.c @@ -298,4 +298,22 @@ int get_channel_utilization(const char *ifname, uint64_t *last_channel_time, uin printf("GOT SURVEY INFO!\n"); return (int)(dividend * 255 / divisor); iwinfo_finish(); +} + +int support_ht(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 ht_support_bitmask = (1 << 2) | (1 << 3); + int ret = htmodes & ht_support_bitmask; + iwinfo_finish(); + return ret; } \ No newline at end of file diff --git a/src/utils/ubus.c b/src/utils/ubus.c index 8be945d..87e5ac6 100644 --- a/src/utils/ubus.c +++ b/src/utils/ubus.c @@ -724,6 +724,8 @@ static int add_subscriber(char *name) { get_ssid(name, hostapd_entry->ssid); // TODO: here we need to add ht and vht supported!!! + // actually we wanted to use an ubus call but for now we can use libiwinfo + ret = ubus_register_subscriber(ctx, &hostapd_entry->subscriber); ret = ubus_subscribe( ctx, &hostapd_entry->subscriber, id);