Re: [PATCH wireless-next v4 04/21] wifi: cfg80211: define layouts for SMD BSS Transition context

From: Pooventhiran G

Date: Wed Nov 18 2026 - 09:06:24 EST




On 11/16/2026 04:24 pm, Johannes Berg wrote:
> On Fri, 2026-11-13 at 23:45 +0530, Pooventhiran G wrote:
>>
>> On 11/11/2026 12:09 am, Johannes Berg wrote:
>>> On Fri, 2026-11-06 at 13:28 +0530, Pooventhiran G wrote:
>>>> IEEE P802.11bn/D2.0
>>>>
>>>
>>> It probably didn't change here, but there's D2.1 :)
>>>
>>
>> From the looks of it, D2.1 doesn't seem to modify the context layout but Dual
>> BA :)
>>
>>>> +#define IEEE80211_SMD_CTX_MAX_PN_LEN 16
>>>
>>> Huh?
>>>
>>
>> There is no cfg80211-equivalent for IEEE80211_MAX_PN_LEN as defined in mac80211.
>
> We could move it, but I was much more questioning the *value*.
>

Got it. 16-byte was kept because of the (wildcard) max value. But yes, doesn't
make sense here, I will change it to the standard size.

>>>> + * @buffer_size: Reorder buffer size from ADDBA Request (10-bit, max 1023)
>>>
>>> It's probably literally in this spec this way, but I see absolutely no
>>> reason to split it up like that (with ext_buffer_size) in what's
>>> effectively an internal API?!
>>>
>>
>> Buffer size was sent this way so that hostapd can directly use that to report
>> the DL BA Info and UL BA Info in the ST Preparation Response frame (Figure
>> 9-aa53 — Extended BA Parameters Info field format).
>>
>> I can combine these into one single @buffer_size and let hostapd split it for
>> preparing the OTA frame (as it is only needed there) but would still need to
>> send ext_no_frag and extfrag_level as part of the context. Would it be okay?
>
> Oh I was just thinking of why you were splitting the buffer size in
> internal APIs that way - much simpler to just have a single u16 (since
> we don't have C23 yet) value?
>

Sure, Johannes.

>>>> +/**
>>>> + * struct ieee80211_smd_ctx - IEEE 802.11bn SMD Roaming Context (refer
>>>> + * IEEE P802.11bn/D2.0, Aug 2026, subclause 37.16.9)
>>>> + *
>>>> + * @dl_sn_valid: if downlink (DL) SN Transfer is requested or not
>>>> + * @ul_sn_valid: if uplink (UL) SN Transfer is requested or not
>>>
>>> Hmm. It might make more sense to invert that like in the frames?
>>>
>>
>> Sure, will reorder this as UL, DL.
>
> Oh I didn't mean the _order_, I don't even know what the order was, I
> meant _invert_, i.e. "no_dl_sn_transfer" or something? That's how it's
> in the frames, IIRC.
>

Got it. Since it used to be a BITMAP, I visualized it as some sort of a
presence bitmap. Now that it has become valid bits, I can align the name with
spec text.

>>>> + * @pn_valid: if PN is transferred or not
>>>
>>> This being false is not a thing (any more)?
>>>
>>
>> PN is still defined to be transferred in the Prep context (at least as per
>> D2.0 37.16.9). Even if drivers choose to send this in the Exec context, it may
>> not be present in both Prep and Exec contexts? Should we make it so that PN is
>> transferred in both?
>
> Oh ... no strong opinion, but the documentation literally says "is
> transferred or not" and ... there's no "isn't transferred" option in the
> spec (any more).
>

Got it, will keep PN as an optional data in the context (because it might be
sent in one of Prep or Exec contexts) and update the doc properly.

>>
>>>> + * @ba_params_valid: if BlockAck parameters are transferred or not
>>>> + * @mgmt_tid_valid: if management information is transferred or not.
>>>> + * @{d,u}l.mgmt_sn and @ul.mgmt_pn are still bounded by @{d,u}l_sn_valid
>>>> + * and @pn_valid fields.
>>>> + * @pn_len: Length of PN in bytes; varies by cipher type
>>>> + * (e.g. CCMP (6), GCMP-256 (16))
>>>
>>> ??
>>>
>>
>> Especially while filling in the data in nl80211 to report to userspace or when
>> we parse the SET_SMD_CTX from userspace, this eliminates the dependency on
>> key_conf to derive the length from the cipher type. But is the preference here
>> exactly that?
>
> No, see above, what's with 16-byte PNs, there's no such thing.
>
> johannes