wlan-ap-Telecominfraproject/feeds/qca/hostapd/patches/r08-04-nl80211-add-support-for-device-bandwidth-params.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

117 lines
3.7 KiB
Diff

From 78c11c9a5a6ee954efd0a76703a4484aca093472 Mon Sep 17 00:00:00 2001
From: Shivani Tambatkar <quic_stambatk@quicinc.com>
Date: Sun, 3 Dec 2023 00:06:59 -0800
Subject: [PATCH 4/7] nl80211: add support for device bandwidth params
Add NL80211_ATTR_CHANNEL_WIDTH_DEVICE and NL80211_ATTR_CENTER_FREQ_DEVICE
to be used to pass device bandwidth parameters to kernel.
Signed-off-by: Shivani Tambatkar <quic_stambatk@quicinc.com>
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
src/drivers/driver_nl80211.c | 59 ++++++++++++++++++++++++++++++++++++
src/drivers/nl80211_copy.h | 10 ++++++
2 files changed, 69 insertions(+)
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4932,6 +4932,60 @@ err:
}
#endif /* CONFIG_DRIVER_NL80211_QCA */
+static int nl80211_put_freq_params_device(struct wpa_driver_nl80211_data *drv,
+ struct nl_msg *msg,
+ const struct hostapd_freq_params *freq)
+{
+ enum nl80211_chan_width width_device;
+
+ if (freq->center_freq_device == 0 && freq->bandwidth_device == 0)
+ return 0;
+
+ if (!drv->device_bw) {
+ wpa_printf(MSG_ERROR,
+ "nl80211: Driver does not support device BW parameters separate from operating BW");
+ return -EOPNOTSUPP;
+ }
+
+ if (!freq->eht_enabled) {
+ wpa_printf(MSG_ERROR,
+ "Device Parameters are supported only for EHT mode");
+ return -EINVAL;
+ }
+
+ if (freq->center_freq_device == 0 || freq->bandwidth_device == 0) {
+ wpa_printf(MSG_ERROR,
+ "Invalid input: bandwidth_device=%d center_freq_device=%d\n",
+ freq->bandwidth_device, freq->center_freq_device);
+ return -EINVAL;
+ }
+
+ switch (freq->bandwidth_device) {
+ case 40:
+ width_device = NL80211_CHAN_WIDTH_40;
+ break;
+ case 80:
+ width_device = NL80211_CHAN_WIDTH_80;
+ break;
+ case 160:
+ width_device = NL80211_CHAN_WIDTH_160;
+ break;
+ case 320:
+ width_device = NL80211_CHAN_WIDTH_320;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ_DEVICE, freq->center_freq_device);
+ nla_put_u32(msg, NL80211_ATTR_CHANNEL_WIDTH_DEVICE, width_device);
+ wpa_printf(MSG_DEBUG,
+ " * bandwidth_device=%d * center_freq_device=%d\n",
+ freq->bandwidth_device, freq->center_freq_device);
+ return 0;
+}
+
+
static int nl80211_put_freq_params(struct wpa_driver_nl80211_data *drv,
struct nl_msg *msg,
const struct hostapd_freq_params *freq)
@@ -5041,6 +5095,12 @@ static int nl80211_put_freq_params(struc
NL80211_CHAN_NO_HT))
return -ENOBUFS;
}
+
+ if (nl80211_put_freq_params_device(drv, msg, freq)) {
+ wpa_printf(MSG_ERROR, "Failed to add device parameters");
+ return -EINVAL;
+ }
+
if (freq->radar_background &&
nla_put_flag(msg, NL80211_ATTR_RADAR_BACKGROUND))
return -ENOBUFS;
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
@@ -2885,6 +2885,13 @@ enum nl80211_commands {
* @NL80211_ATTR_SET_CRITICAL_UPDATE: set critical update for the bss
* (see &enum nl80211_set_cu).
*
+ * @NL80211_ATTR_CHANNEL_WIDTH_DEVICE: Device channel width (u32). Value
+ * must be zero or twice @NL80211_ATTR_CHANNEL_WIDTH which is the
+ * operating channel width. Minimum value is 40 MHz.
+ *
+ * @NL80211_ATTR_CENTER_FREQ_DEVICE: Device center frequency (u32). The value
+ * must coincide with one edge of the operating bandwidth.
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3447,6 +3454,8 @@ enum nl80211_attrs {
NL80211_ATTR_DEL_MULTI_CHAN,
NL80211_ATTR_RXMGMT_CRITICAL_UPDATE,
NL80211_ATTR_SET_CRITICAL_UPDATE,
+ NL80211_ATTR_CHANNEL_WIDTH_DEVICE,
+ NL80211_ATTR_CENTER_FREQ_DEVICE,
/* add attributes here, update the policy in nl80211.c */