wlan-ap-Telecominfraproject/feeds/qca/hostapd/patches/q02-054-hostapd-support-background-DFS.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

179 lines
6.5 KiB
Diff

From 5f78902ce0ec567026ea056bb8ed3fbd08d55a88 Mon Sep 17 00:00:00 2001
From: Harshitha Prem <quic_hprem@quicinc.com>
Date: Sat, 19 Nov 2022 20:47:14 +0530
Subject: [PATCH] hostapd: support background DFS
when any user application triggers background DFS,
example through iw command, it might be considered as
CAC on ongoing channel and hostapd might go to DFS state.
Hence, added changes to parse radar background
nl80211 attribute.
Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
---
src/ap/dfs.c | 16 +++++++++-------
src/ap/dfs.h | 4 ++--
src/ap/drv_callbacks.c | 6 +++---
src/drivers/driver.h | 1 +
src/drivers/driver_nl80211_event.c | 4 ++++
wpa_supplicant/ap.c | 9 ++++++---
6 files changed, 25 insertions(+), 15 deletions(-)
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -1239,7 +1239,7 @@ hostapd_dfs_start_channel_switch_backgro
int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
int ht_enabled, int chan_offset, int chan_width,
- int cf1, int cf2)
+ int cf1, int cf2, bool is_background)
{
wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_COMPLETED
"success=%d freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d",
@@ -1264,13 +1264,14 @@ int hostapd_dfs_complete_cac(struct host
* selected channel and configure the background chain
* to a new DFS channel.
*/
- if (hostapd_dfs_is_background_event(iface, freq)) {
+ if (is_background || hostapd_dfs_is_background_event(iface, freq)) {
iface->radar_background.cac_started = 0;
if (!iface->radar_background.temp_ch)
return 0;
iface->radar_background.temp_ch = 0;
- return hostapd_dfs_start_channel_switch_background(iface);
+ if (iface->conf->enable_background_radar)
+ return hostapd_dfs_start_channel_switch_background(iface);
}
/*
@@ -1289,9 +1290,10 @@ int hostapd_dfs_complete_cac(struct host
iface->cac_started = 0;
}
}
- } else if (hostapd_dfs_is_background_event(iface, freq)) {
+ } else if (is_background || hostapd_dfs_is_background_event(iface, freq)) {
iface->radar_background.cac_started = 0;
- hostpad_dfs_update_background_chain(iface);
+ if (iface->conf->enable_background_radar)
+ hostpad_dfs_update_background_chain(iface);
}
return 0;
@@ -1733,9 +1735,9 @@ int hostapd_is_dfs_required(struct hosta
int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
int ht_enabled, int chan_offset, int chan_width,
- int cf1, int cf2)
+ int cf1, int cf2, bool is_background)
{
- if (hostapd_dfs_is_background_event(iface, freq)) {
+ if (is_background || hostapd_dfs_is_background_event(iface, freq)) {
iface->radar_background.cac_started = 1;
} else {
/* This is called when the driver indicates that an offloaded
--- a/src/ap/dfs.h
+++ b/src/ap/dfs.h
@@ -20,7 +20,7 @@ int hostapd_handle_dfs(struct hostapd_if
int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq,
int ht_enabled, int chan_offset, int chan_width,
- int cf1, int cf2);
+ int cf1, int cf2, bool is_background);
int hostapd_dfs_pre_cac_expired(struct hostapd_iface *iface, int freq,
int ht_enabled, int chan_offset, int chan_width,
int cf1, int cf2);
@@ -35,7 +35,7 @@ int hostapd_is_dfs_required(struct hosta
int hostapd_is_dfs_chan_available(struct hostapd_iface *iface);
int hostapd_dfs_start_cac(struct hostapd_iface *iface, int freq,
int ht_enabled, int chan_offset, int chan_width,
- int cf1, int cf2);
+ int cf1, int cf2, bool is_background);
int hostapd_handle_dfs_offload(struct hostapd_iface *iface);
int hostapd_is_dfs_overlap(struct hostapd_iface *iface, enum chan_width width,
int center_freq);
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -1762,7 +1762,7 @@ static void hostapd_event_dfs_cac_finish
wpa_printf(MSG_DEBUG, "DFS CAC finished on %d MHz", radar->freq);
hostapd_dfs_complete_cac(hapd->iface, 1, radar->freq, radar->ht_enabled,
radar->chan_offset, radar->chan_width,
- radar->cf1, radar->cf2);
+ radar->cf1, radar->cf2, radar->is_background);
}
@@ -1772,7 +1772,7 @@ static void hostapd_event_dfs_cac_aborte
wpa_printf(MSG_DEBUG, "DFS CAC aborted on %d MHz", radar->freq);
hostapd_dfs_complete_cac(hapd->iface, 0, radar->freq, radar->ht_enabled,
radar->chan_offset, radar->chan_width,
- radar->cf1, radar->cf2);
+ radar->cf1, radar->cf2, radar->is_background);
}
@@ -1792,7 +1792,7 @@ static void hostapd_event_dfs_cac_starte
wpa_printf(MSG_DEBUG, "DFS offload CAC started on %d MHz", radar->freq);
hostapd_dfs_start_cac(hapd->iface, radar->freq, radar->ht_enabled,
radar->chan_offset, radar->chan_width,
- radar->cf1, radar->cf2);
+ radar->cf1, radar->cf2, radar->is_background);
}
#endif /* NEED_AP_MLME */
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -6380,6 +6380,7 @@ union wpa_event_data {
int cf1;
int cf2;
u16 radar_bitmap;
+ bool is_background;
} dfs_event;
/**
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -1958,6 +1958,10 @@ static void nl80211_radar_event(struct w
}
}
+ if ((drv->capa.flags2 & WPA_DRIVER_RADAR_BACKGROUND) &&
+ tb[NL80211_ATTR_RADAR_BACKGROUND]) {
+ data.dfs_event.is_background = true;
+ }
/* Get VHT params */
if (tb[NL80211_ATTR_CHANNEL_WIDTH])
data.dfs_event.chan_width =
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -2107,7 +2107,8 @@ void wpas_ap_event_dfs_cac_started(struc
wpa_printf(MSG_DEBUG, "DFS CAC started on %d MHz", radar->freq);
hostapd_dfs_start_cac(iface, radar->freq,
radar->ht_enabled, radar->chan_offset,
- radar->chan_width, radar->cf1, radar->cf2);
+ radar->chan_width, radar->cf1, radar->cf2,
+ radar->is_background);
}
@@ -2123,7 +2124,8 @@ void wpas_ap_event_dfs_cac_finished(stru
wpa_printf(MSG_DEBUG, "DFS CAC finished on %d MHz", radar->freq);
hostapd_dfs_complete_cac(iface, 1, radar->freq,
radar->ht_enabled, radar->chan_offset,
- radar->chan_width, radar->cf1, radar->cf2);
+ radar->chan_width, radar->cf1, radar->cf2,
+ radar->is_background);
}
@@ -2139,7 +2141,8 @@ void wpas_ap_event_dfs_cac_aborted(struc
wpa_printf(MSG_DEBUG, "DFS CAC aborted on %d MHz", radar->freq);
hostapd_dfs_complete_cac(iface, 0, radar->freq,
radar->ht_enabled, radar->chan_offset,
- radar->chan_width, radar->cf1, radar->cf2);
+ radar->chan_width, radar->cf1, radar->cf2,
+ radar->is_background);
}