wlan-ap-Telecominfraproject/feeds/qca/hostapd/patches/r08-03-hostapd-add-driver-capability.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

165 lines
6.2 KiB
Diff

From 2056cd84dde73cc337aecef4745e4a4b83fff89b Mon Sep 17 00:00:00 2001
From: Aloka Dixit <quic_alokad@quicinc.com>
Date: Thu, 7 Dec 2023 14:54:36 -0800
Subject: [PATCH 3/7] hostapd: add driver capability
Extended feature flag NL80211_EXT_FEATURE_DEVICE_BW indicates that
the driver supports different parameters for the device bandwidth
compared to the operating bandwidth. Store the capability.
Modify nl80211_put_freq_params() include a pointer to the driver
context so that the capability can be verified when such parameters
are passed. Driver capabilities flags
WPA_DRIVER_DEVICE_PARAMS_SUPPORTED is set to adevertise this feature
to hostapd
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Signed-off-by: Shivani Tambatkar <quic_stambatk@quicinc.com>
---
src/drivers/driver_nl80211.c | 20 +++++++++++---------
src/drivers/driver_nl80211.h | 1 +
src/drivers/driver_nl80211_capa.c | 3 +++
src/drivers/nl80211_copy.h | 4 ++++
4 files changed, 19 insertions(+), 9 deletions(-)
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -172,7 +172,9 @@ static int nl80211_send_frame_cmd(struct
int link_id);
static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss,
int report);
-
+static int nl80211_put_freq_params(struct wpa_driver_nl80211_data *drv,
+ struct nl_msg *msg,
+ const struct hostapd_freq_params *freq);
#define IFIDX_ANY -1
static void add_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
@@ -4930,9 +4932,9 @@ err:
}
#endif /* CONFIG_DRIVER_NL80211_QCA */
-
-static int nl80211_put_freq_params(struct nl_msg *msg,
- const struct hostapd_freq_params *freq)
+static int nl80211_put_freq_params(struct wpa_driver_nl80211_data *drv,
+ struct nl_msg *msg,
+ const struct hostapd_freq_params *freq)
{
enum hostapd_hw_mode hw_mode;
int is_24ghz;
@@ -5340,7 +5342,7 @@ static int wpa_driver_nl80211_set_ap(voi
nla_nest_end(msg, spr);
}
- if (params->freq && nl80211_put_freq_params(msg, params->freq) < 0)
+ if (params->freq && nl80211_put_freq_params(drv, msg, params->freq) < 0)
goto fail;
if (params->mld_ap) {
@@ -5517,7 +5519,7 @@ static int nl80211_set_channel(struct i8
msg = nl80211_bss_msg(bss, 0, set_chan ? NL80211_CMD_SET_CHANNEL :
NL80211_CMD_SET_WIPHY);
- if (!msg || nl80211_put_freq_params(msg, freq) < 0) {
+ if (!msg || nl80211_put_freq_params(drv, msg, freq) < 0) {
nlmsg_free(msg);
return -1;
}
@@ -6676,7 +6678,7 @@ retry:
os_memcpy(drv->ssid, params->ssid, params->ssid_len);
drv->ssid_len = params->ssid_len;
- if (nl80211_put_freq_params(msg, &params->freq) < 0 ||
+ if (nl80211_put_freq_params(drv, msg, &params->freq) < 0 ||
nl80211_put_beacon_int(msg, params->beacon_int))
goto fail;
@@ -10559,7 +10561,7 @@ static int nl80211_start_radar_detection
}
if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_RADAR_DETECT)) ||
- nl80211_put_freq_params(msg, freq) < 0) {
+ nl80211_put_freq_params(drv, msg, freq) < 0) {
nlmsg_free(msg);
return -1;
}
@@ -10712,7 +10714,7 @@ nl80211_tdls_enable_channel_switch(void
if (!msg ||
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) ||
nla_put_u8(msg, NL80211_ATTR_OPER_CLASS, oper_class) ||
- (ret = nl80211_put_freq_params(msg, params))) {
+ (ret = nl80211_put_freq_params(drv, msg, params))) {
nlmsg_free(msg);
wpa_printf(MSG_DEBUG, "nl80211: Could not build TDLS chan switch");
return ret;
@@ -11317,7 +11319,7 @@ static int nl80211_switch_channel(void *
if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_CHANNEL_SWITCH)) ||
nla_put_u32(msg, NL80211_ATTR_CH_SWITCH_COUNT,
settings->cs_count) ||
- (ret = nl80211_put_freq_params(msg, &settings->freq_params)) ||
+ (ret = nl80211_put_freq_params(drv, msg, &settings->freq_params)) ||
(settings->block_tx &&
nla_put_flag(msg, NL80211_ATTR_CH_SWITCH_BLOCK_TX)) ||
(settings->punct_bitmap &&
@@ -12100,7 +12102,7 @@ static int nl80211_join_mesh(struct i802
wpa_printf(MSG_DEBUG, "nl80211: mesh join (ifindex=%d)", drv->ifindex);
msg = nl80211_drv_msg(drv, 0, NL80211_CMD_JOIN_MESH);
if (!msg ||
- nl80211_put_freq_params(msg, &params->freq) ||
+ nl80211_put_freq_params(drv, msg, &params->freq) ||
nl80211_put_basic_rates(msg, params->basic_rates) ||
nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
nl80211_put_beacon_int(msg, params->beacon_int) ||
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -204,6 +204,7 @@ struct wpa_driver_nl80211_data {
unsigned int secure_ranging_ctx_vendor_cmd_avail:1;
unsigned int puncturing:1;
unsigned int qca_ap_allowed_freqs:1;
+ unsigned int device_bw:1;
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -701,6 +701,9 @@ static void wiphy_info_ext_feature_flags
capa->flags2 |= WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_STA;
capa->flags2 |= WPA_DRIVER_FLAGS2_PROT_RANGE_NEG_AP;
}
+
+ if (ext_feature_isset(ext_features, len, NL80211_EXT_FEATURE_DEVICE_BW))
+ info->drv->device_bw = 1;
}
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
@@ -6642,6 +6642,9 @@ enum nl80211_feature_flags {
* @NL80211_EXT_FEATURE_BEACON_RATE_EHT: Driver supports beacon rate
* configuration (AP/mesh) with EHT rates.
*
+ * @NL80211_EXT_FEATURE_DEVICE_BW: Driver/device supports different parameters for device
+ * bandwidth compared to the operating bandwidth.
+ *
* @NUM_NL80211_EXT_FEATURES: number of extended features.
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
*/
@@ -6716,6 +6719,7 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
NL80211_EXT_FEATURE_STA_MGMT_RTS_CTS,
NL80211_EXT_FEATURE_BEACON_RATE_EHT,
+ NL80211_EXT_FEATURE_DEVICE_BW,
/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2409,7 +2409,6 @@ struct wpa_driver_capa {
/** Driver supports MLO in station/AP mode */
#define WPA_DRIVER_FLAGS2_MLO 0x0000000000004000ULL
u64 flags2;
-
#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
(drv_flags & WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE)