use htmodes

This commit is contained in:
PolynomialDivision 2018-05-29 20:03:51 +02:00
parent 3a81f22178
commit 2c13c27b94
2 changed files with 20 additions and 0 deletions

View file

@ -299,3 +299,21 @@ int get_channel_utilization(const char *ifname, uint64_t *last_channel_time, uin
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;
}

View file

@ -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);