wlan-ap-Telecominfraproject/feeds/qca/hostapd/patches/r04-006-wpa_supplicant-Add-radar-detected-event-wpa_msg-prin.patch
John Crispin 008ca9618d
Some checks failed
Build OpenWrt/uCentral images / build (cig_wf186h) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf186w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf188n) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf189) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf196) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-a1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-b1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap102) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap104) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap105) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap111) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap112) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_3) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xe) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (indio_um-305ax) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sercomm_ap72tip) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630c-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-211g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-id2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-od2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr5018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018-v4) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax820) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax840) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap640) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap650) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap655) (push) Has been cancelled
Build OpenWrt/uCentral images / trigger-testing (push) Has been cancelled
Build OpenWrt/uCentral images / create-x64_vm-ami (push) Has been cancelled
ipq95xx: import ath12.4-cs kernel and drivers
Signed-off-by: John Crispin <john@phrozen.org>
2024-10-20 09:25:13 +02:00

90 lines
3.7 KiB
Diff

From bcec542027144ad0e16403f725cd09bde792c261 Mon Sep 17 00:00:00 2001
From: Amith A <quic_amitajit@quicinc.com>
Date: Thu, 18 Jan 2024 14:03:28 +0530
Subject: [PATCH] wpa_supplicant: Add radar detected event wpa_msg print
When a WDS repeater detects radar, the AP VAP is brought down as channel
change is not possible since the STA VAP would still be connected to the
root AP. The STA VAP stays connected to the Root AP on the radar affected
channel till the apsta_mode script brings it down and this is a violation.
In order to prevent this, the STA VAP should be brought down as soon as it
receives the radar-detected event. Add a wpa_msg printing the reception
of DFS_EVENT_RADAR_DETECTED so that the script listening to the events
can bring down the STA VAP when it sees the msg. Also, send the radar
event to supplicant after checking if the VAP is a STA VAP.
Signed-off-by: Amith A <quic_amitajit@quicinc.com>
---
src/drivers/driver_nl80211_event.c | 7 +++++--
wpa_supplicant/events.c | 5 ++++-
wpa_supplicant/wpa_cli.c | 2 ++
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index d503b61..b565004 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -2472,7 +2472,7 @@ static void nl80211_process_radar_event(void *ctx ,union wpa_event_data *data,
enum nl80211_radar_event event_type,
struct i802_link *mld_link)
{
- if (mld_link->link_id != NL80211_DRV_LINK_ID_NA) {
+ if (mld_link && mld_link->link_id != NL80211_DRV_LINK_ID_NA) {
wpa_printf(MSG_DEBUG, "nl80211: DFS event for link_id %d",
mld_link->link_id);
ctx = mld_link->ctx;
@@ -2508,7 +2508,7 @@ static void nl80211_process_radar_event(void *ctx ,union wpa_event_data *data,
static void nl80211_radar_event(struct i802_bss *bss, struct nlattr **tb)
{
struct wpa_driver_nl80211_data *drv = bss->drv;
- struct i802_link *mld_link;
+ struct i802_link *mld_link = NULL;
union wpa_event_data data;
enum nl80211_radar_event event_type;
void *ctx = bss->ctx;
@@ -2565,6 +2565,9 @@ static void nl80211_radar_event(struct i802_bss *bss, struct nlattr **tb)
data.dfs_event.chan_offset, data.dfs_event.chan_width,
data.dfs_event.cf1, data.dfs_event.cf2, data.dfs_event.radar_bitmap);
+ if (is_sta_interface(drv->nlmode))
+ return nl80211_process_radar_event(ctx, &data, event_type, mld_link);
+
ret = wpa_is_freq_in_bss(bss, data.dfs_event.freq, &mld_link);
if (ret) {
if (ret == 2)
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 0aae4ed..ceeb991 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -5822,9 +5822,12 @@ void supplicant_event(void *ctx, enum wpa_event_type event,
#ifdef CONFIG_AP
#ifdef NEED_AP_MLME
case EVENT_DFS_RADAR_DETECTED:
- if (data)
+ if (data) {
+ wpa_msg(wpa_s, MSG_INFO, "%s on %d MHz", DFS_EVENT_RADAR_DETECTED,
+ data->dfs_event.freq);
wpas_ap_event_dfs_radar_detected(wpa_s,
&data->dfs_event);
+ }
break;
case EVENT_DFS_NOP_FINISHED:
if (data)
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index d81cb1c..cbc3781 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -4429,6 +4429,8 @@ static void wpa_cli_action_process(const char *msg)
wpa_cli_exec(action_file, ifname, pos);
} else if (str_starts(pos, DPP_EVENT_NET_ACCESS_KEY)) {
wpa_cli_exec(action_file, ifname, pos);
+ } else if (str_starts(pos, DFS_EVENT_RADAR_DETECTED)) {
+ wpa_cli_exec(action_file, ifname, pos);
} else if (str_starts(pos, WPA_EVENT_TERMINATING)) {
printf("wpa_supplicant is terminating - stop monitoring\n");
if (!reconnect)
--
2.17.1