diff --git a/src/agent.c b/src/agent.c index a780ecf9c3d04d09c2a09c7b31931a09a9e4d6fc..e26c77ce5bfe9af40d9883d2b45a8069dde8b829 100644 --- a/src/agent.c +++ b/src/agent.c @@ -2093,6 +2093,25 @@ int wifi_topology_notification(struct agent *a, struct sta *s, char *ifname, uin return 0; } +#if (EASYMESH_VERSION >=6) +static void agent_update_radio_channels(struct agent *a) +{ + struct wifi_radio_element *r; + + list_for_each_entry(r, &a->radiolist, list) { + struct wifi_radio_status radio_status = {}; + + if (wifi_radio_status(r->name, &radio_status)) + continue; + + r->current_channel = radio_status.channel; + r->current_bandwidth = radio_status.bandwidth; + } + + send_oper_channel_report(a, NULL); +} +#endif + static void wifi_chan_change_event_handler(void *c, struct blob_attr *msg) { struct agent *a = c; @@ -2116,8 +2135,20 @@ static void wifi_chan_change_event_handler(void *c, struct blob_attr *msg) event = blobmsg_data(tb[1]); radio = agent_get_radio_with_ifname(a, ifname); - if (!radio) + if (!radio) { +#if (EASYMESH_VERSION >=6) + if (!strcmp(event, "ap-chan-change") || + !strcmp(event, "csa-finished") || + !strcmp(event, "ap-csa-finished")) + /* + * If we get event on mld netdev about channel + * changes update all radios. + */ + if (agent_get_mld_by_ifname(a, ifname)) + agent_update_radio_channels(a); +#endif return; + } if (!strcmp(event, "ap-chan-change")) { static const struct blobmsg_policy data_attr[] = {