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