diff options
author | Nick Hainke <vincent@systemli.org> | 2018-04-26 00:03:05 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-07-30 10:59:25 +0200 |
commit | 74ac74227715aec4b6a3badf7a69bdde13431e04 (patch) | |
tree | c56c26612f2249b105990951238d04353485bba3 /package/network/services/hostapd | |
parent | ae95a8ad3ee08995f16092820aa495b46ddcfdb9 (diff) | |
download | upstream-74ac74227715aec4b6a3badf7a69bdde13431e04.tar.gz upstream-74ac74227715aec4b6a3badf7a69bdde13431e04.tar.bz2 upstream-74ac74227715aec4b6a3badf7a69bdde13431e04.zip |
hostapd: add ubus call for ap features
The call "get_features" allows to gather hostapd config options
via ubus. As first infos we add the ht and vht support.
Although nl80211 supports to gather informations about
ht and vht capabilities, the hostapd configuration can disable
vht and ht. However, it is possible that the iw output is not
representing the actual hostapd configuration.
Signed-off-by: Nick Hainke <vincent@systemli.org>
Diffstat (limited to 'package/network/services/hostapd')
-rw-r--r-- | package/network/services/hostapd/src/src/ap/ubus.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index 37a20ed774..6207b03530 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -198,6 +198,21 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj, return 0; } +static int +hostapd_bss_get_features(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); + + blob_buf_init(&b, 0); + blobmsg_add_u8(&b, "ht_supported", ht_supported(hapd->iface->hw_features)); + blobmsg_add_u8(&b, "vht_supported", vht_supported(hapd->iface->hw_features)); + ubus_send_reply(ctx, req, b.head); + + return 0; +} + enum { NOTIFY_RESPONSE, __NOTIFY_MAX @@ -915,6 +930,7 @@ static const struct ubus_method bss_methods[] = { UBUS_METHOD_NOARG("wps_start", hostapd_bss_wps_start), UBUS_METHOD_NOARG("wps_cancel", hostapd_bss_wps_cancel), UBUS_METHOD_NOARG("update_beacon", hostapd_bss_update_beacon), + UBUS_METHOD_NOARG("get_features", hostapd_bss_get_features), #ifdef NEED_AP_MLME UBUS_METHOD("switch_chan", hostapd_switch_chan, csa_policy), #endif |