wlan-ap-Telecominfraproject/feeds/qca/hostapd/patches/r02-003-hostapd-select-channel-based-on-hw_idx-during-single.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

94 lines
3.3 KiB
Diff

From 28c244a521342f9debb681e77dbbd1abfda894bd Mon Sep 17 00:00:00 2001
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
Date: Tue, 10 Oct 2023 15:41:13 +0530
Subject: [PATCH 2/2] hostapd: select channel based on hw_idx during single
wiphy operation
Currently, channel is selected from the current hw_mode. However, not
all channels under current hw_mode might be available for the current
operating underlying hardware.
Commit "hostapd: add support to use underlying hw_idx for multi-hardware under
single phy mode" added support to store the possible underlying hardware info
and set the current operating hardware index.
Add logic to check if the selected channel falls under the current operating
hardware index and only if it falls then continues with the channel.
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
src/ap/dfs.c | 7 +++++++
src/ap/interference.c | 7 +++++++
src/common/hw_features_common.c | 20 ++++++++++++++++++++
src/common/hw_features_common.h | 2 ++
4 files changed, 36 insertions(+)
--- a/src/ap/dfs.c
+++ b/src/ap/dfs.c
@@ -331,6 +331,13 @@ static int dfs_find_channel(struct hosta
for (i = 0; i < mode->num_channels; i++) {
chan = &mode->channels[i];
+ if (!chan_in_current_hw_info(iface->current_hw_info, chan)) {
+ wpa_printf(MSG_DEBUG,
+ "DFS: channel %d (%d) is not under same current hw id",
+ chan->freq, chan->chan);
+ continue;
+ }
+
/* Skip HT40/VHT incompatible channels */
if (iface->conf->ieee80211n &&
iface->conf->secondary_channel &&
--- a/src/ap/interference.c
+++ b/src/ap/interference.c
@@ -242,6 +242,13 @@ static int intf_awgn_find_channel_list(s
for (i = 0; i < mode->num_channels; i++) {
chan = &mode->channels[i];
+ if (!chan_in_current_hw_info(iface->current_hw_info, chan)) {
+ wpa_printf(MSG_DEBUG,
+ "AWGN: channel %d (%d) is not under same current hw id",
+ chan->freq, chan->chan);
+ continue;
+ }
+
/* Skip incompatible chandefs */
if (!intf_awgn_chan_range_available(mode, i, n_chans)) {
wpa_printf(MSG_DEBUG,
--- a/src/common/hw_features_common.c
+++ b/src/common/hw_features_common.c
@@ -1045,3 +1045,23 @@ bool is_punct_bitmap_valid(u16 bw, u16 p
return false;
}
+
+bool chan_in_current_hw_info(struct hostapd_multi_hw_info *current_hw_info,
+ struct hostapd_channel_data *chan)
+{
+ int i;
+
+ /* we assume if current_hw_info is not set then full
+ * iface->current_mode->channels[] can be used to scan for channels
+ * hence we return true
+ */
+ if (!current_hw_info)
+ return true;
+
+ for (i = 0; i < current_hw_info->num_freqs; i++) {
+ if (current_hw_info->freqs[i] == chan->freq)
+ return true;
+ }
+
+ return false;
+}
--- a/src/common/hw_features_common.h
+++ b/src/common/hw_features_common.h
@@ -59,5 +59,7 @@ int chan_pri_allowed(const struct hostap
bool is_punct_bitmap_valid(u16 bw, u16 pri_ch_bit_pos, u16 punct_bitmap);
bool is_ru_punct_bitmap_valid(u16 bw, u16 pri_ch_bit_pos, u16 ru_punct_bitmap,
u8 ru_punct_ofdma);
+bool chan_in_current_hw_info(struct hostapd_multi_hw_info *current_hw_info,
+ struct hostapd_channel_data *chan);
#endif /* HW_FEATURES_COMMON_H */