From 5b5ff835802f6c6f7cde22c66ffba53d9aa752c2 Mon Sep 17 00:00:00 2001 From: lx9512 <352753852@qq.com> Date: Tue, 18 Feb 2025 22:05:16 +0800 Subject: [PATCH 1/4] add Signed-off-by: lx9512 <352753852@qq.com> --- build | 1 - wpa_supplicant-2.9_standard/src/drivers/driver.h | 7 +++++-- .../src/drivers/driver_nl80211.c | 4 ++-- .../src/drivers/driver_nl80211_event.c | 4 ++++ .../wpa_supplicant/ctrl_iface.c | 15 ++++++++------- .../wpa_supplicant/driver_i.h | 2 +- 6 files changed, 20 insertions(+), 13 deletions(-) delete mode 160000 build diff --git a/build b/build deleted file mode 160000 index 235c1be..0000000 --- a/build +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 235c1be0e9818ce5c86aff7f715638a84773b61b diff --git a/wpa_supplicant-2.9_standard/src/drivers/driver.h b/wpa_supplicant-2.9_standard/src/drivers/driver.h index 062bd30..d9c6544 100644 --- a/wpa_supplicant-2.9_standard/src/drivers/driver.h +++ b/wpa_supplicant-2.9_standard/src/drivers/driver.h @@ -70,6 +70,9 @@ enum hostapd_chan_width_attr { #define HOSTAPD_DFS_REGION_ETSI 2 #define HOSTAPD_DFS_REGION_JP 3 +#define WIFI7_MLO_COFEATURE_STATE_MLSR 2 +#define WIFI7_MLO_COFEATURE_STATE_EMLSR 3 + /** * enum reg_change_initiator - Regulatory change initiator */ @@ -2685,7 +2688,7 @@ struct wpa_signal_info { int center_frq1; int center_frq2; }; -#ifdef CONFIG_MLD_PATCH_EXT +#ifdef CONFIG_MLD_PATCH struct wpa_mlo_signal_info { u16 valid_links; struct wpa_signal_info links[MAX_NUM_MLD_LINKS]; @@ -4354,7 +4357,7 @@ struct wpa_driver_ops { * @signal_info: Connection info structure */ int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info); -#ifdef CONFIG_MLD_PATCH_EXT +#ifdef CONFIG_MLD_PATCH /** * mlo_signal_poll - Get current MLO connection information * @priv: Private driver interface data diff --git a/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211.c b/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211.c index 02b567f..a723c7e 100644 --- a/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211.c +++ b/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211.c @@ -9809,7 +9809,7 @@ static int nl80211_signal_poll(void *priv, struct wpa_signal_info *si) return nl80211_get_link_noise(drv, si); } -#ifdef CONFIG_MLD_PATCH_EXT +#ifdef CONFIG_MLD_PATCH static int get_links_noise(struct nl_msg *msg, void *arg) { struct nlattr *tb[NL80211_ATTR_MAX + 1]; @@ -14186,7 +14186,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { .resume = wpa_driver_nl80211_resume, .signal_monitor = nl80211_signal_monitor, .signal_poll = nl80211_signal_poll, -#ifdef CONFIG_MLD_PATCH_EXT +#ifdef CONFIG_MLD_PATCH .mlo_signal_poll = nl80211_mlo_signal_poll, #endif .channel_info = nl80211_channel_info, diff --git a/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211_event.c b/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211_event.c index 8b6fd35..8370882 100644 --- a/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211_event.c +++ b/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211_event.c @@ -3926,6 +3926,10 @@ static void nl80211_mlo_working_state_event(struct wpa_driver_nl80211_data *drv, event.mlo_work_state_event.state = state; event.mlo_work_state_event.reason_code = reason_code; wpa_supplicant_event(drv->ctx, EVENT_MLO_WORK_STATE, &event); + if (feature == 0 && (state == WIFI7_MLO_COFEATURE_STATE_MLSR || state == WIFI7_MLO_COFEATURE_STATE_MLSR)) { + wpa_printf(MSG_INFO, "nl80211: reflash assoc freq for emlsr"); + nl80211_get_assoc_freq(drv); + } } static void do_process_drv_event(struct i802_bss *bss, int cmd, diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c index bcbe41b..676b68c 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c @@ -12685,7 +12685,7 @@ static int wpa_supplicant_sta_shell_cmd(struct wpa_supplicant *wpa_s, char *para return -1; } } -#ifdef CONFIG_MLD_PATCH_EXT +#ifdef CONFIG_MLD_PATCH static int wpas_ctrl_iface_mlo_signal_poll(struct wpa_supplicant *wpa_s, char *buf, size_t buflen) { @@ -12705,12 +12705,15 @@ static int wpas_ctrl_iface_mlo_signal_poll(struct wpa_supplicant *wpa_s, for_each_link(mlo_si.valid_links, i) { ret = os_snprintf(pos, end - pos, - "LINK_ID=%d\nRSSI=%d\nLINKSPEED=%lu\n" - "NOISE=%d\nFREQUENCY=%u\n", + "LINK_ID=%d\nRSSI=%d\nNOISE=%d\nFREQUENCY=%u\nTXLINKSPEED=%lu\nRXLINKSPEED=%lu\nTXPACKETS=%lu" + "\nRXPACKETS=%lu", i, mlo_si.links[i].data.signal, - mlo_si.links[i].data.current_tx_rate / 1000, mlo_si.links[i].current_noise, - mlo_si.links[i].frequency); + mlo_si.links[i].frequency, + mlo_si.links[i].data.current_tx_rate / 1000, + mlo_si.links[i].data.current_rx_rate / 1000, + mlo_si.links[i].data.tx_packets, + mlo_si.links[i].data.rx_packets); if (os_snprintf_error(end - pos, ret)) return -1; pos += ret; @@ -14295,8 +14298,6 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, } else if (os_strcmp(buf, "MLO_STATUS") == 0) { reply_len = wpas_ctrl_iface_mlo_status(wpa_s, reply, reply_size); -#endif -#ifdef CONFIG_MLD_PATCH_EXT } else if (os_strcmp(buf, "MLO_SIGNAL_POLL") == 0) { reply_len = wpas_ctrl_iface_mlo_signal_poll(wpa_s, reply, reply_size); diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/driver_i.h b/wpa_supplicant-2.9_standard/wpa_supplicant/driver_i.h index 1ac5d7f..b8a60f1 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/driver_i.h +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/driver_i.h @@ -546,7 +546,7 @@ static inline int wpa_drv_signal_monitor(struct wpa_supplicant *wpa_s, int wpa_drv_signal_poll(struct wpa_supplicant *wpa_s, struct wpa_signal_info *si); -#ifdef CONFIG_MLD_PATCH_EXT +#ifdef CONFIG_MLD_PATCH static inline int wpa_drv_mlo_signal_poll(struct wpa_supplicant *wpa_s, struct wpa_mlo_signal_info *mlo_si) { -- Gitee From d03dcb127c0d0d30db8af6e0c8ab308cfc182b18 Mon Sep 17 00:00:00 2001 From: lx9512 <352753852@qq.com> Date: Thu, 20 Feb 2025 15:34:44 +0800 Subject: [PATCH 2/4] add Signed-off-by: lx9512 <352753852@qq.com> --- wpa_supplicant-2.9_standard/src/drivers/driver_nl80211_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211_event.c b/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211_event.c index 8370882..237a0b6 100644 --- a/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211_event.c +++ b/wpa_supplicant-2.9_standard/src/drivers/driver_nl80211_event.c @@ -3926,7 +3926,7 @@ static void nl80211_mlo_working_state_event(struct wpa_driver_nl80211_data *drv, event.mlo_work_state_event.state = state; event.mlo_work_state_event.reason_code = reason_code; wpa_supplicant_event(drv->ctx, EVENT_MLO_WORK_STATE, &event); - if (feature == 0 && (state == WIFI7_MLO_COFEATURE_STATE_MLSR || state == WIFI7_MLO_COFEATURE_STATE_MLSR)) { + if (feature == 0 && (state == WIFI7_MLO_COFEATURE_STATE_MLSR || state == WIFI7_MLO_COFEATURE_STATE_EMLSR)) { wpa_printf(MSG_INFO, "nl80211: reflash assoc freq for emlsr"); nl80211_get_assoc_freq(drv); } -- Gitee From cebd5eab28feccdbb08d3f6b11a84253aaffc558 Mon Sep 17 00:00:00 2001 From: lx9512 <352753852@qq.com> Date: Thu, 20 Feb 2025 17:45:23 +0800 Subject: [PATCH 3/4] add Signed-off-by: lx9512 <352753852@qq.com> --- wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c index 676b68c..be2025c 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c @@ -12706,7 +12706,7 @@ static int wpas_ctrl_iface_mlo_signal_poll(struct wpa_supplicant *wpa_s, for_each_link(mlo_si.valid_links, i) { ret = os_snprintf(pos, end - pos, "LINK_ID=%d\nRSSI=%d\nNOISE=%d\nFREQUENCY=%u\nTXLINKSPEED=%lu\nRXLINKSPEED=%lu\nTXPACKETS=%lu" - "\nRXPACKETS=%lu", + "\nRXPACKETS=%lu\n", i, mlo_si.links[i].data.signal, mlo_si.links[i].current_noise, mlo_si.links[i].frequency, -- Gitee From 804dd93c70b2a703b71a2baeefc256ab3d78e4d7 Mon Sep 17 00:00:00 2001 From: lx9512 <352753852@qq.com> Date: Fri, 21 Feb 2025 14:26:06 +0800 Subject: [PATCH 4/4] add Signed-off-by: lx9512 <352753852@qq.com> --- wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c index be2025c..eab9c9e 100644 --- a/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant-2.9_standard/wpa_supplicant/ctrl_iface.c @@ -101,6 +101,7 @@ #define P2P_160M_MASK 0x08000000 #define DISCOVER_TIMEOUT_S 120 #define DISCOVER_CHANNELID 20000 +#define KBPS_OF_MBPS 1000 #ifdef CONFIG_WIFI_RPT #define DEDAULT_RPT_ID -3 @@ -12710,8 +12711,8 @@ static int wpas_ctrl_iface_mlo_signal_poll(struct wpa_supplicant *wpa_s, i, mlo_si.links[i].data.signal, mlo_si.links[i].current_noise, mlo_si.links[i].frequency, - mlo_si.links[i].data.current_tx_rate / 1000, - mlo_si.links[i].data.current_rx_rate / 1000, + mlo_si.links[i].data.current_tx_rate / KBPS_OF_MBPS, + mlo_si.links[i].data.current_rx_rate / KBPS_OF_MBPS, mlo_si.links[i].data.tx_packets, mlo_si.links[i].data.rx_packets); if (os_snprintf_error(end - pos, ret)) -- Gitee