diff mbox series

[v3,02/12] mac80211: update TIM for S1G specification changes

Message ID 20220906044812.7609-3-kieran.frewen@morsemicro.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show
Series Additional Support for 802.11ah (S1G) | expand

Commit Message

Kieran Frewen Sept. 6, 2022, 4:48 a.m. UTC
Updates to the TIM information element to match changes made in the
IEEE Std 802.11ah-2020.

Signed-off-by: Kieran Frewen <kieran.frewen@morsemicro.com>
---
 net/mac80211/tx.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Johannes Berg Sept. 6, 2022, 9:38 a.m. UTC | #1
On Tue, 2022-09-06 at 16:48 +1200, Kieran Frewen wrote:
> Updates to the TIM information element to match changes made in the
> IEEE Std 802.11ah-2020.
> 
> +		if (ieee80211_get_sband(sdata)->band != NL80211_BAND_S1GHZ) {
> 

You probably should use ieee80211_get_link_sband() here now.

I'm not sure it _matters_ much since we shouldn't get here with MLO, but
it also doesn't really make a big difference for the code, and then we
won't keep thinking about whether it should be link or not :)

johannes
diff mbox series

Patch

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 45df9932d0ba..bf85a01fcf9d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -4749,9 +4749,9 @@  static void __ieee80211_beacon_add_tim(struct ieee80211_sub_if_data *sdata,
 			ps->dtim_count--;
 	}
 
-	tim = pos = skb_put(skb, 6);
+	tim = pos = skb_put(skb, 5);
 	*pos++ = WLAN_EID_TIM;
-	*pos++ = 4;
+	*pos++ = 3;
 	*pos++ = ps->dtim_count;
 	*pos++ = link_conf->dtim_period;
 
@@ -4782,13 +4782,18 @@  static void __ieee80211_beacon_add_tim(struct ieee80211_sub_if_data *sdata,
 		/* Bitmap control */
 		*pos++ = n1 | aid0;
 		/* Part Virt Bitmap */
-		skb_put(skb, n2 - n1);
+		skb_put(skb, n2 - n1 + 1);
 		memcpy(pos, ps->tim + n1, n2 - n1 + 1);
 
 		tim[1] = n2 - n1 + 4;
 	} else {
 		*pos++ = aid0; /* Bitmap control */
-		*pos++ = 0; /* Part Virt Bitmap */
+
+		if (ieee80211_get_sband(sdata)->band != NL80211_BAND_S1GHZ) {
+			skb_put(skb, 1);
+			tim[1] = 4;
+			*pos++ = 0; /* Part Virt Bitmap */
+		}
 	}
 }