Thread (11 messages) 11 messages, 2 authors, 2022-01-14

Re: [v13 1/3] mac80211: split beacon retrieval functions

From: Aloka Dixit <hidden>
Date: 2021-10-06 20:20:14

On 2021-10-05 21:09, Aloka Dixit wrote:
quoted hunk ↗ jump to hunk
Split __ieee80211_beacon_get() into a separate function for AP mode
ieee80211_beacon_get_ap().
Also, move the code common to all modes (AP, adhoc and mesh) to
a separate function ieee80211_beacon_get_finish().

Signed-off-by: Aloka Dixit <redacted>
---
v13:New addition to the patch series compared to v12.
This change is added in a separate patch for better readability.

 net/mac80211/tx.c | 203 +++++++++++++++++++++++++++-------------------
 1 file changed, 118 insertions(+), 85 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2d1193ed3eb5..ac9ab007dc6f 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4979,6 +4979,115 @@ static int ieee80211_beacon_protect(struct 
sk_buff *skb,
 	return 0;
 }

+static void
+ieee80211_beacon_get_finish(struct ieee80211_hw *hw,
+			    struct ieee80211_vif *vif,
+			    struct ieee80211_mutable_offsets *offs,
+			    struct beacon_data *beacon,
+			    struct sk_buff *skb,
+			    struct ieee80211_chanctx_conf *chanctx_conf,
+			    u16 csa_off_base)
+{
+	struct ieee80211_local *local = hw_to_local(hw);
+	struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
+	struct ieee80211_tx_info *info;
+	enum nl80211_band band;
+	struct ieee80211_tx_rate_control txrc;
+
+	/* CSA offsets */
+	if (offs && beacon) {
+		u16 i;
+
+		for (i = 0; i < IEEE80211_MAX_CNTDWN_COUNTERS_NUM; i++) {
+			u16 csa_off = beacon->cntdwn_counter_offsets[i];
+
+			if (!csa_off)
+				continue;
+
+			offs->cntdwn_counter_offs[i] = csa_off_base + csa_off;
+		}
+	}
+
I just now realized that the CSA offset part can be moved to the AP 
specific function.
ieee80211_beacon_get_finish() won't even need csa_off_base as an input 
in that case.
Will wait for other comments and then move it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help