linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [wireless-next 0/2] wifi: support S1G TIM encoding
@ 2025-07-22  7:16 Lachlan Hodges
  2025-07-22  7:16 ` [wireless-next 1/2] wifi: mac80211: support encoding S1G TIM PVB Lachlan Hodges
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Lachlan Hodges @ 2025-07-22  7:16 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, arien.judge, Lachlan Hodges

An S1G PPDU formats the TIM differently compared to non-S1G PPDU's,
meaning in order for an S1G STA and AP to correctly coordinate
power save, the TIM PVB shall be encoded as per IEEE80211-2024
9.4.2.5.1 Figure 9-213.

An S1G PPDU uses the notion of "pages" where each page can represent
2048 AIDs, for a maximum theoretical limit of 8192 AIDs. However as
there is no page slicing support, we will be limiting the PVB to
a single page describing entire range of AIDs within the bitmap.
This is permitted as per IEEE80211-2024 9.4.2.5.1:

"If the Page Slice Number subfield is 31, then the entire page indicated
by the Page Index subfield value is encoded in the Partial Virtual Bitmap
field of the TIM elements with the same page index."

When this configuration is used, the PVB is broken down into a list of
encoded blocks. Each encoded block has a maximum length of 10 bytes and
can describe 64 AIDs. We currently only support block bitmap encoding.
Each encoded block contains a block control byte, which contains the
block offset. The block offset represents the block index the current
encoded block describes. Following the block control is the block
bitmap and between 0 and 8 subblocks. Each subblock is 1 byte and can
describe at most 8 AIDs, where the respective bit set in the block bitmap
indicates the presence of the subblock.

However, there are some further limitations. Firstly, the TIM element
has a maximum length of 255 bytes - and given that each encoded block
has a maximum length of 10 bytes, 32 * 10 = 320 this exceeds the maximum
TIM element length. As a comprimise until page slicing is implemented,
we set a maximum block count of 25 (25 * 10 + 1 + 1 + 1) meaning we can
describe 25 * 64 = 1600 AIDs. This fits within the existing mac80211 bitmap
and is more than enough for current implementations. In the future, when
page slicing support is added this will need to be modified.

Parsing support for the S1G PPDU PVB format is added on the STA side to
allow full power save support for S1G drivers.

Notes:

(1) I've run hwsim tests and (obviously) tested the S1G power save path,
    but the 2 hwsim power save tests only check multicast traffic and
    even then only 1 sta. So would be good for someone to confirm that this
    hasn't broken non-S1G tim encoding. Even though it's only code being
    shuffled around, that wouldn't be ideal :)

Trace Example:

Tag: Traffic Indication Map (TIM): DTIM 2 of 10 bitmap
    Tag Number: Traffic Indication Map (TIM) (5)
    Tag length: 6
    DTIM count: 2
    DTIM period: 10
    Bitmap Control: 0x3e
        .... ...0 = Traffic Indication: 0x0
        ..11 111. = Page Slice Number: 31
        00.. .... = Page Index: 0
    Partial Virtual Bitmap
        Encoded Block 0
            Block Control Byte: 0x00
            Block Bitmap
                Block Bitmap: 0x01, Subblock 1 present
                Subblock 0
                    .... ..1. = STA AID13:  0x1
		    .... .1.. = STA AID13:  0x2

Lachlan Hodges (2):
  wifi: mac80211: support encoding S1G TIM PVB
  wifi: mac80211: support parsing S1G TIM PVB

 drivers/net/wireless/ath/carl9170/rx.c        |   2 +-
 drivers/net/wireless/intersil/p54/txrx.c      |   2 +-
 .../net/wireless/ralink/rt2x00/rt2x00dev.c    |   2 +-
 drivers/net/wireless/realtek/rtlwifi/ps.c     |   2 +-
 include/linux/ieee80211.h                     | 110 ++++++++++-
 net/mac80211/mesh_ps.c                        |   2 +-
 net/mac80211/mlme.c                           |  15 +-
 net/mac80211/tx.c                             | 173 ++++++++++++++----
 8 files changed, 257 insertions(+), 51 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-07-23  9:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22  7:16 [wireless-next 0/2] wifi: support S1G TIM encoding Lachlan Hodges
2025-07-22  7:16 ` [wireless-next 1/2] wifi: mac80211: support encoding S1G TIM PVB Lachlan Hodges
2025-07-22 11:17   ` Johannes Berg
2025-07-23  8:04   ` Johannes Berg
2025-07-23  8:22     ` Johannes Berg
2025-07-23  9:04     ` Lachlan Hodges
2025-07-22  7:16 ` [wireless-next 2/2] wifi: mac80211: support parsing " Lachlan Hodges
2025-07-22 11:25   ` Johannes Berg
2025-07-22 12:30     ` Lachlan Hodges
2025-07-22 13:55       ` Johannes Berg
2025-07-23  2:29         ` Lachlan Hodges
2025-07-23  7:39           ` Johannes Berg
2025-07-23  8:52             ` Lachlan Hodges
2025-07-22  7:22 ` [wireless-next 0/2] wifi: support S1G TIM encoding Lachlan Hodges
2025-07-22  7:34   ` Johannes Berg
2025-07-22 14:10     ` Arien Judge
2025-07-22 11:35   ` Johannes Berg
2025-07-22 12:39     ` Lachlan Hodges

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).