Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wifi: mac80211: update TIM for S1G specification changes

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>
Co-developed-by: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
Signed-off-by: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
Link: https://lore.kernel.org/r/20221106221602.25714-1-gilad.itzkovitch@morsemicro.com
[use skb_put_data/skb_put_u8]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Kieran Frewen and committed by
Johannes Berg
209d70d3 8950b598

+9 -5
+9 -5
net/mac80211/tx.c
··· 4774 4774 ps->dtim_count--; 4775 4775 } 4776 4776 4777 - tim = pos = skb_put(skb, 6); 4777 + tim = pos = skb_put(skb, 5); 4778 4778 *pos++ = WLAN_EID_TIM; 4779 - *pos++ = 4; 4779 + *pos++ = 3; 4780 4780 *pos++ = ps->dtim_count; 4781 4781 *pos++ = link_conf->dtim_period; 4782 4782 ··· 4807 4807 /* Bitmap control */ 4808 4808 *pos++ = n1 | aid0; 4809 4809 /* Part Virt Bitmap */ 4810 - skb_put(skb, n2 - n1); 4811 - memcpy(pos, ps->tim + n1, n2 - n1 + 1); 4810 + skb_put_data(skb, ps->tim + n1, n2 - n1 + 1); 4812 4811 4813 4812 tim[1] = n2 - n1 + 4; 4814 4813 } else { 4815 4814 *pos++ = aid0; /* Bitmap control */ 4816 - *pos++ = 0; /* Part Virt Bitmap */ 4815 + 4816 + if (ieee80211_get_link_sband(link)->band != NL80211_BAND_S1GHZ) { 4817 + tim[1] = 4; 4818 + /* Part Virt Bitmap */ 4819 + skb_put_u8(skb, 0); 4820 + } 4817 4821 } 4818 4822 } 4819 4823