hostapd: move ubus.c changes from patches to src

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau
2023-09-14 11:22:36 +02:00
committed by John Crispin
parent 48cda63dc5
commit 95032994fe
5 changed files with 1885 additions and 73 deletions

View File

@@ -19,18 +19,6 @@
enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
--- a/src/ap/ubus.c
+++ b/src/ap/ubus.c
@@ -424,6 +424,9 @@ hostapd_bss_get_status(struct ubus_conte
hapd->iface->cac_started ? hapd->iface->dfs_cac_ms / 1000 - now.sec : 0);
blobmsg_close_table(&b, dfs_table);
+ if (hapd->conf->uci_section)
+ blobmsg_add_string(&b, "uci_section", hapd->conf->uci_section);
+
ubus_send_reply(ctx, req, b.head);
return 0;
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -785,6 +785,7 @@ void hostapd_config_free_bss(struct host

View File

@@ -50,42 +50,4 @@
return NL_SKIP;
}
--- a/src/ap/ubus.c
+++ b/src/ap/ubus.c
@@ -306,6 +306,36 @@ hostapd_bss_get_clients(struct ubus_cont
blobmsg_add_u32(&b, "tx", sta_driver_data.current_tx_rate * 100);
blobmsg_close_table(&b, r);
blobmsg_add_u32(&b, "signal", sta_driver_data.signal);
+
+ r = blobmsg_open_table(&b, "mcs");
+ if (sta_driver_data.rx_hemcs) {
+ blobmsg_add_u32(&b, "he", 1);
+ blobmsg_add_u32(&b, "rx", sta_driver_data.rx_hemcs);
+ blobmsg_add_u32(&b, "tx", sta_driver_data.tx_hemcs);
+ } else if (sta_driver_data.rx_vhtmcs) {
+ blobmsg_add_u32(&b, "vht", 1);
+ blobmsg_add_u32(&b, "rx", sta_driver_data.rx_vhtmcs);
+ blobmsg_add_u32(&b, "tx", sta_driver_data.tx_vhtmcs);
+ } else {
+ blobmsg_add_u32(&b, "rx", sta_driver_data.rx_mcs);
+ blobmsg_add_u32(&b, "tx", sta_driver_data.tx_mcs);
+ }
+ blobmsg_close_table(&b, r);
+
+ r = blobmsg_open_table(&b, "nss");
+ if (sta_driver_data.rx_he_nss) {
+ blobmsg_add_u32(&b, "he", 1);
+ blobmsg_add_u32(&b, "rx", sta_driver_data.rx_he_nss);
+ blobmsg_add_u32(&b, "tx", sta_driver_data.tx_he_nss);
+ } else if (sta_driver_data.rx_vht_nss) {
+ blobmsg_add_u32(&b, "vht", 1);
+ blobmsg_add_u32(&b, "rx", sta_driver_data.rx_vht_nss);
+ blobmsg_add_u32(&b, "tx", sta_driver_data.tx_vht_nss);
+ } else {
+ blobmsg_add_u32(&b, "rx", sta_driver_data.rx_mcs);
+ blobmsg_add_u32(&b, "tx", sta_driver_data.tx_mcs);
+ }
+ blobmsg_close_table(&b, r);
}
hostapd_parse_capab_blobmsg(sta);

View File

@@ -61,28 +61,6 @@
};
--- a/src/ap/ubus.c
+++ b/src/ap/ubus.c
@@ -336,6 +336,9 @@ hostapd_bss_get_clients(struct ubus_cont
blobmsg_add_u32(&b, "tx", sta_driver_data.tx_mcs);
}
blobmsg_close_table(&b, r);
+
+ if (sta->signal_mgmt)
+ blobmsg_add_u32(&b, "signal_mgmt", sta->signal_mgmt);
}
hostapd_parse_capab_blobmsg(sta);
@@ -457,6 +460,9 @@ hostapd_bss_get_status(struct ubus_conte
if (hapd->conf->uci_section)
blobmsg_add_string(&b, "uci_section", hapd->conf->uci_section);
+ if (hapd->signal_mgmt)
+ blobmsg_add_u32(&b, "signal_mgmt", hapd->signal_mgmt);
+
ubus_send_reply(ctx, req, b.head);
return 0;
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -451,6 +451,7 @@ struct hostapd_data {

View File

@@ -306,6 +306,39 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj,
blobmsg_add_u32(&b, "tx", sta_driver_data.current_tx_rate * 100);
blobmsg_close_table(&b, r);
blobmsg_add_u32(&b, "signal", sta_driver_data.signal);
r = blobmsg_open_table(&b, "mcs");
if (sta_driver_data.rx_hemcs) {
blobmsg_add_u32(&b, "he", 1);
blobmsg_add_u32(&b, "rx", sta_driver_data.rx_hemcs);
blobmsg_add_u32(&b, "tx", sta_driver_data.tx_hemcs);
} else if (sta_driver_data.rx_vhtmcs) {
blobmsg_add_u32(&b, "vht", 1);
blobmsg_add_u32(&b, "rx", sta_driver_data.rx_vhtmcs);
blobmsg_add_u32(&b, "tx", sta_driver_data.tx_vhtmcs);
} else {
blobmsg_add_u32(&b, "rx", sta_driver_data.rx_mcs);
blobmsg_add_u32(&b, "tx", sta_driver_data.tx_mcs);
}
blobmsg_close_table(&b, r);
r = blobmsg_open_table(&b, "nss");
if (sta_driver_data.rx_he_nss) {
blobmsg_add_u32(&b, "he", 1);
blobmsg_add_u32(&b, "rx", sta_driver_data.rx_he_nss);
blobmsg_add_u32(&b, "tx", sta_driver_data.tx_he_nss);
} else if (sta_driver_data.rx_vht_nss) {
blobmsg_add_u32(&b, "vht", 1);
blobmsg_add_u32(&b, "rx", sta_driver_data.rx_vht_nss);
blobmsg_add_u32(&b, "tx", sta_driver_data.tx_vht_nss);
} else {
blobmsg_add_u32(&b, "rx", sta_driver_data.rx_mcs);
blobmsg_add_u32(&b, "tx", sta_driver_data.tx_mcs);
}
blobmsg_close_table(&b, r);
if (sta->signal_mgmt)
blobmsg_add_u32(&b, "signal_mgmt", sta->signal_mgmt);
}
hostapd_parse_capab_blobmsg(sta);
@@ -424,6 +457,12 @@ hostapd_bss_get_status(struct ubus_context *ctx, struct ubus_object *obj,
hapd->iface->cac_started ? hapd->iface->dfs_cac_ms / 1000 - now.sec : 0);
blobmsg_close_table(&b, dfs_table);
if (hapd->conf->uci_section)
blobmsg_add_string(&b, "uci_section", hapd->conf->uci_section);
if (hapd->signal_mgmt)
blobmsg_add_u32(&b, "signal_mgmt", hapd->signal_mgmt);
ubus_send_reply(ctx, req, b.head);
return 0;

File diff suppressed because it is too large Load Diff