wlan-ap-Telecominfraproject/feeds/ipq95xx/mac80211/patches/qca/577-mac80211-EHT-operation-element-support-in-AP-mode.patch
John Crispin 144c5d00f4 ipq95xx/mac80211: update to ATH12.3-CS
Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

95 lines
3.1 KiB
Diff

From 5461720e055c5acdf69432f9762dc8b691cf2d4e Mon Sep 17 00:00:00 2001
From: Aloka Dixit <quic_alokad@quicinc.com>
Date: Tue, 21 Sep 2021 11:55:02 -0700
Subject: [PATCH 15/27] mac80211: EHT operation element support in AP mode
Add new parameters to struct ieee80211_bss_conf for EHT operation
element data in AP mode.
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
---
include/net/mac80211.h | 7 +++++++
net/mac80211/cfg.c | 8 ++++++++
net/mac80211/eht.c | 11 +++++++++++
net/mac80211/ieee80211_i.h | 2 ++
4 files changed, 28 insertions(+)
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -682,6 +682,8 @@ struct ieee80211_fils_discovery {
* @color_change_color: the bss color that will be used after the change.
* @nss_ap_isolate: Used for notifying the NSS host about AP isolate feature
* @beacon_tx_mode: Beacon Tx Mode setting.
+ * @eht_oper: EHT operation information of the BSS (AP/Mesh) or of the AP we
+ * are connected to (STA)
*/
struct ieee80211_bss_conf {
const u8 *bssid;
@@ -753,6 +755,12 @@ struct ieee80211_bss_conf {
u8 tx_pwr_env_num;
u8 pwr_reduction;
bool eht_support;
+ struct {
+ u8 chan_width;
+ u8 ccfs0;
+ u8 ccfs1;
+ u8 present_bm;
+ } eht_oper;
bool csa_active;
bool mu_mimo_owner;
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1244,6 +1244,14 @@ static int ieee80211_start_ap(struct wip
IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO;
}
+ if (params->eht_cap && params->eht_oper) {
+ if (!sdata->vif.bss_conf.he_support)
+ return -EOPNOTSUPP;
+
+ sdata->vif.bss_conf.eht_support = true;
+ ieee80211_eht_op_ie_to_bss_conf(&sdata->vif, params->eht_oper);
+ }
+
mutex_lock(&local->mtx);
err = ieee80211_link_use_channel(link, &params->chandef,
IEEE80211_CHANCTX_SHARED);
--- a/net/mac80211/eht.c
+++ b/net/mac80211/eht.c
@@ -75,3 +75,25 @@ ieee80211_eht_cap_ie_to_sta_eht_cap(stru
link_sta->cur_max_bandwidth = ieee80211_sta_cap_rx_bw(link_sta);
link_sta->pub->bandwidth = ieee80211_sta_cur_vht_bw(link_sta);
}
+
+void ieee80211_eht_op_ie_to_bss_conf(struct ieee80211_vif *vif,
+ const struct ieee80211_eht_operation *op_ie)
+{
+ struct ieee80211_eht_operation_info *eht_oper_info;
+
+ if (!op_ie)
+ return;
+
+ if (op_ie->params && IEEE80211_EHT_OPER_INFO_PRESENT) {
+ eht_oper_info = op_ie->optional;
+
+ vif->bss_conf.eht_oper.chan_width =
+ u8_get_bits(eht_oper_info->control,
+ IEEE80211_EHT_OPER_CHAN_WIDTH);
+ vif->bss_conf.eht_oper.ccfs0 = eht_oper_info->ccfs0;
+ vif->bss_conf.eht_oper.ccfs1 = eht_oper_info->ccfs1;
+ vif->bss_conf.eht_oper.present_bm =
+ u8_get_bits(eht_oper_info->control,
+ IEEE80211_EHT_OPER_DISABLED_SUBCHANNEL_BITMAP_PRESENT);
+ }
+}
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2550,4 +2550,6 @@ ieee80211_eht_cap_ie_to_sta_eht_cap(stru
const struct ieee80211_eht_cap_elem *eht_cap_ie_elem,
u8 eht_cap_len,
struct link_sta_info *link_sta);
+void ieee80211_eht_op_ie_to_bss_conf(struct ieee80211_vif *vif,
+ const struct ieee80211_eht_operation *op_ie);
#endif /* IEEE80211_I_H */