diff mbox series

[v2,1/2] mac80211: add support to configure 6GHz non-ht duplicate transmission

Message ID 1647841395-20213-2-git-send-email-quic_ramess@quicinc.com
State New
Headers show
Series Add support to configure 6GHz non-ht duplicate transmission | expand

Commit Message

Rameshkumar Sundaram March 21, 2022, 5:43 a.m. UTC
A 6GHz AP can decide to transmit Beacon, Broadcast probe response
and FILS discovery frames in a non-HT duplicate PPDU when
operating in non 20MHz Bandwidth to enhance its discoverability.
(IEEE Std 802.11ax‐2021-26.17.2.2)

Add changes to configure 6GHz non-HT duplicate beacon transmission
based on Duplicate Beacon subfield of 6GHz Operation Information
field of the HE Operation element in Beacon.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
---
 include/net/mac80211.h |  3 +++
 net/mac80211/cfg.c     | 15 +++++++++++++++
 2 files changed, 18 insertions(+)
diff mbox series

Patch

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c50221d..1472ca0 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -630,6 +630,8 @@  struct ieee80211_fils_discovery {
  * @unsol_bcast_probe_resp_interval: Unsolicited broadcast probe response
  *	interval.
  * @s1g: BSS is S1G BSS (affects Association Request format).
+ * @he_6g_nonht_dup_beacon_set: if set, indicates that HE 6GHz non-HT duplicate
+ *	beacon transmission is enabled for this BSS.
  * @beacon_tx_rate: The configured beacon transmit rate that needs to be passed
  *	to driver when rate control is offloaded to firmware.
  * @power_type: power type of BSS for 6 GHz
@@ -704,6 +706,7 @@  struct ieee80211_bss_conf {
 	struct cfg80211_he_bss_color he_bss_color;
 	struct ieee80211_fils_discovery fils_discovery;
 	u32 unsol_bcast_probe_resp_interval;
+	bool he_6g_nonht_dup_beacon_set;
 	bool s1g;
 	struct cfg80211_bitrate_mask beacon_tx_rate;
 	enum ieee80211_ap_reg_power power_type;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 87a2080..077e1bd 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -997,6 +997,9 @@  static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
 	struct beacon_data *new, *old;
 	int new_head_len, new_tail_len;
 	int size, err;
+	const struct element *cap;
+	struct ieee80211_he_operation *he_oper;
+	const struct ieee80211_he_6ghz_oper *he_6ghz_oper;
 	u32 changed = BSS_CHANGED_BEACON;
 
 	old = sdata_dereference(sdata->u.ap.beacon, sdata);
@@ -1084,6 +1087,18 @@  static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
 		changed |= BSS_CHANGED_FTM_RESPONDER;
 	}
 
+	cap = cfg80211_find_ext_elem(WLAN_EID_EXT_HE_OPERATION,
+				     params->tail, params->tail_len);
+	if (cap && cap->datalen >= sizeof(*he_oper) + 1) {
+		he_oper = (void *)(cap->data + 1);
+		he_6ghz_oper = ieee80211_he_6ghz_oper(he_oper);
+		if (he_6ghz_oper) {
+			sdata->vif.bss_conf.he_6g_nonht_dup_beacon_set = false;
+			if (he_6ghz_oper->control & IEEE80211_HE_6GHZ_OPER_CTRL_DUP_BEACON)
+				sdata->vif.bss_conf.he_6g_nonht_dup_beacon_set = true;
+		}
+	}
+
 	rcu_assign_pointer(sdata->u.ap.beacon, new);
 
 	if (old)