iwinfo: add he and eht operation info to wifi scan
authorAleksander Jan Bajkowski <[email protected]>
Sat, 15 Mar 2025 16:03:33 +0000 (17:03 +0100)
committerRobert Marko <[email protected]>
Fri, 7 Nov 2025 11:21:58 +0000 (12:21 +0100)
Iwinfo exports he and eht operation info useful to get channel info of
nearby stations. Add these new info to ubus output.

Signed-off-by: Aleksander Jan Bajkowski <[email protected]>
Link: https://github.com/openwrt/rpcd/pull/11
Signed-off-by: Robert Marko <[email protected]>
iwinfo.c

index ff0f38b7face5fb66cea0cad73542de2a5ab2315..2a223ed40b10be1a444e5366ffcbdc58e1e4c83f 100644 (file)
--- a/iwinfo.c
+++ b/iwinfo.c
@@ -437,6 +437,22 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct ubus_object *obj,
                                blobmsg_close_table(&buf, t);
                        }
 
+                       if (e->he_chan_info.center_chan_1) {
+                               t = blobmsg_open_table(&buf, "he_operation");
+                               blobmsg_add_u32(&buf, "channel_width", eht_chan_width[e->he_chan_info.chan_width]);
+                               blobmsg_add_u32(&buf, "center_freq_1", e->he_chan_info.center_chan_1);
+                               blobmsg_add_u32(&buf, "center_freq_2", e->he_chan_info.center_chan_2);
+                               blobmsg_close_table(&buf, t);
+                       }
+
+                       if (e->eht_chan_info.center_chan_1) {
+                               t = blobmsg_open_table(&buf, "eht_operation");
+                               blobmsg_add_u32(&buf, "channel_width", eht_chan_width[e->eht_chan_info.chan_width]);
+                               blobmsg_add_u32(&buf, "center_freq_1", e->eht_chan_info.center_chan_1);
+                               blobmsg_add_u32(&buf, "center_freq_2", e->eht_chan_info.center_chan_2);
+                               blobmsg_close_table(&buf, t);
+                       }
+
                        rpc_iwinfo_add_encryption("encryption", &e->crypto);
 
                        blobmsg_close_table(&buf, d);