developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 1 | From d71c29484010bcb0bda82eb529689d0748bd653e Mon Sep 17 00:00:00 2001 |
| 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Wed, 31 Jan 2024 10:39:08 +0800 |
| 4 | Subject: [PATCH 090/104] mtk: hostapd: add link id to hostapd cli chan switch |
| 5 | |
| 6 | temporary workaround for mlo channel switch |
| 7 | |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 8 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 9 | --- |
| 10 | hostapd/ctrl_iface.c | 3 +-- |
| 11 | hostapd/hostapd_cli.c | 2 +- |
| 12 | src/ap/ctrl_iface_ap.c | 2 ++ |
| 13 | 3 files changed, 4 insertions(+), 3 deletions(-) |
| 14 | |
| 15 | diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c |
| 16 | index c5540f5fd..f0c990314 100644 |
| 17 | --- a/hostapd/ctrl_iface.c |
| 18 | +++ b/hostapd/ctrl_iface.c |
| 19 | @@ -2801,10 +2801,9 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, |
| 20 | if (ret) |
| 21 | return ret; |
| 22 | |
| 23 | - settings.link_id = -1; |
| 24 | #ifdef CONFIG_IEEE80211BE |
| 25 | if (iface->num_bss && iface->bss[0]->conf->mld_ap) |
| 26 | - settings.link_id = iface->bss[0]->mld_link_id; |
| 27 | + iface = iface->interfaces->iface[settings.link_id]; |
| 28 | #endif /* CONFIG_IEEE80211BE */ |
| 29 | |
| 30 | ret = hostapd_ctrl_check_freq_params(&settings.freq_params, |
| 31 | diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c |
| 32 | index 100896c34..acfa3b1d1 100644 |
| 33 | --- a/hostapd/hostapd_cli.c |
| 34 | +++ b/hostapd/hostapd_cli.c |
| 35 | @@ -1195,7 +1195,7 @@ static int hostapd_cli_cmd_chan_switch(struct wpa_ctrl *ctrl, |
| 36 | printf("Invalid chan_switch command: needs at least two " |
| 37 | "arguments (count and freq)\n" |
| 38 | "usage: <cs_count> <freq> [sec_channel_offset=] " |
| 39 | - "[center_freq1=] [center_freq2=] [bandwidth=] " |
| 40 | + "[center_freq1=] [center_freq2=] [bandwidth=] [link_id=] " |
| 41 | "[blocktx] [ht|vht|he|eht]\n"); |
| 42 | return -1; |
| 43 | } |
| 44 | diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c |
| 45 | index b92311e32..ca4e3e7a4 100644 |
| 46 | --- a/src/ap/ctrl_iface_ap.c |
| 47 | +++ b/src/ap/ctrl_iface_ap.c |
| 48 | @@ -1108,6 +1108,8 @@ int hostapd_parse_csa_settings(const char *pos, |
| 49 | } \ |
| 50 | } while (0) |
| 51 | |
| 52 | + SET_CSA_SETTING(link_id); |
| 53 | + settings->link_id = settings->freq_params.link_id; |
| 54 | SET_CSA_SETTING(center_freq1); |
| 55 | SET_CSA_SETTING(center_freq2); |
| 56 | SET_CSA_SETTING(bandwidth); |
| 57 | -- |
| 58 | 2.39.2 |
| 59 | |