[PATCH wireless-next v4 1/2] wifi: UHR: define DPS/DBE/P-EDCA elements and fix size parsing
Karthikeyan Kathirvel
karthikeyan.kathirvel at oss.qualcomm.com
Tue Mar 3 02:11:46 PST 2026
On 2/24/2026 10:02 PM, Johannes Berg wrote:
> On Tue, 2026-02-17 at 11:17 +0530, Karthikeyan Kathirvel wrote:
>>
>> + * Refer to IEEE80211_UHR_P_EDCA*
>> + * @p_edca_ec: The P-EDCA ECWmin, P-EDCA and ECWmax
>
> that seems unclear?
>
>
>> + * @p_edca_params: The AIFSN field indicate the AIFSN value that are
>
> "indicates", "value that is used"? I think it's one? Or "values that are
> used"
>
>> + * used by a P-EDCA STA during P-EDCA contention.
>> + * The CW DS field indicate the value used
>
> indicates
>
>> + * for the randomization of the transmission slot of the DS-CTS
>> + * frame. The value 3 is reserved. The value 0 indicate that
>
> indicates
>
Will address this grammatical errors in next version
>> + * randomization not enabled.
>> + * The P-EDCA PSRC threshold field indicates the maximum number
>> + * of allowed consecutive DS-CTS transmissions. The value 0 and
>> + * values greater than 4 are reserved
>> + * The P-EDCA QSRC threshold field indicates the value of the
>> + * QSRC[AC_VO] counter to be allowed to start P-EDCA contention.
>> + * The value 0 is reserved.
>> + */
>> +struct ieee80211_uhr_p_edca_info {
>> + u8 p_edca_ec;
>> + __le16 p_edca_params;
>> +} __packed;
>> +
>> static inline bool ieee80211_uhr_oper_size_ok(const u8 *data, u8 len,
>> bool beacon)
>> {
>> @@ -47,19 +232,52 @@ static inline bool ieee80211_uhr_oper_size_ok(const u8 *data, u8 len,
>> if (beacon)
>> return true;
>>
>> - /* FIXME: DPS, DBE, P-EDCA (consider order, also relative to NPCA) */
>> + /* DPS Operation Parameters (fixed 4 bytes) */
>> + if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_DPS_ENA)) {
>> + needed += sizeof(struct ieee80211_uhr_dps_info);
>> + if (len < needed)
>> + return false;
>> + }
>>
>> + /* NPCA Operation Parameters (fixed 4 bytes + optional 2 bytes) */
>> if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_NPCA_ENA)) {
>> const struct ieee80211_uhr_npca_info *npca =
>> - (const void *)oper->variable;
>> + (const void *)(data + needed);
>>
>> needed += sizeof(*npca);
>> -
>> if (len < needed)
>> return false;
>>
>> - if (npca->params & cpu_to_le32(IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES))
>> + if (npca->params &
>> + cpu_to_le32(IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES)) {
>> needed += sizeof(npca->dis_subch_bmap[0]);
>> + if (len < needed)
>> + return false;
>> + }
>> + }
>> +
>> + /* P-EDCA Operation Parameters (fixed 3 bytes) */
>> + if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_PEDCA_ENA)) {
>> + needed += sizeof(struct ieee80211_uhr_p_edca_info);
>> + if (len < needed)
>> + return false;
>> + }
>> +
>> + /* DBE Operation Parameters (fixed 1 byte + optional 2 bytes) */
>> + if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_DBE_ENA)) {
>> + const struct ieee80211_uhr_dbe_info *dbe =
>> + (const void *)(data + needed);
>> +
>> + needed += sizeof(*dbe);
>> + if (len < needed)
>> + return false;
>> +
>> + if (dbe->dbe_params &
>> + IEEE80211_UHR_DBE_OPER_DIS_SUBCHANNEL_BITMAP_PRES) {
>> + needed += sizeof(dbe->dis_subch_bmap[0]);
>> + if (len < needed)
>> + return false;
>> + }
>> }
>>
>> return len >= needed;
>> @@ -72,12 +290,15 @@ static inline bool ieee80211_uhr_oper_size_ok(const u8 *data, u8 len,
>> static inline const struct ieee80211_uhr_npca_info *
>> ieee80211_uhr_npca_info(const struct ieee80211_uhr_operation *oper)
>> {
>> + const u8 *pos = oper->variable;
>> +
>> if (!(oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_NPCA_ENA)))
>> return NULL;
>>
>> - /* FIXME: DPS */
>> + if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_DPS_ENA))
>> + pos += sizeof(struct ieee80211_uhr_dps_info);
>>
>> - return (const void *)oper->variable;
>> + return (const void *)pos;
>> }
>>
>> static inline const __le16 *
>> @@ -131,6 +352,25 @@ ieee80211_uhr_npca_dis_subch_bitmap(const struct ieee80211_uhr_operation *oper)
>> #define IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_160_PRES 0x08
>> #define IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_320_PRES 0x10
>>
>> +/**
>> + * enum ieee80211_dbe_bandwidth - DBE Bandwidth
>> + *
>> + * As per spec P802.11bn_D1.3 "Table 9-bb5—Encoding of the DBE Maximum
>> + * Supported Bandwidth field"
>> + *
>> + * @IEEE80211_DBE_BANDWIDTH_40MHZ: Indicate 40 MHz DBE bandwidth
>> + * @IEEE80211_DBE_BANDWIDTH_80MHZ: Indicate 80 MHz DBE bandwidth
>> + * @IEEE80211_DBE_BANDWIDTH_160MHZ: Indicate 160 MHz DBE bandwidth
>> + * @IEEE80211_DBE_BANDWIDTH_320MHZ: Indicate 320 MHz DBE bandwidth
>> + *
>> + */
>> +enum ieee80211_dbe_bandwidth {
>> + IEEE80211_DBE_BANDWIDTH_40MHZ = 1,
>> + IEEE80211_DBE_BANDWIDTH_80MHZ = 2,
>> + IEEE80211_DBE_BANDWIDTH_160MHZ = 3,
>> + IEEE80211_DBE_BANDWIDTH_320MHZ = 4,
>> +};
>> +
>> struct ieee80211_uhr_cap_mac {
>> u8 mac_cap[5];
>> } __packed;
More information about the ath12k
mailing list