[PATCH ath-next 3/5] wifi: ath12k: add HAL ops for monitor TLV header decode and alignment

Vasanthakumar Thiagarajan vasanthakumar.thiagarajan at oss.qualcomm.com
Thu Jun 18 02:22:17 PDT 2026



On 6/18/2026 2:43 PM, Vasanthakumar Thiagarajan wrote:
> 
> 
> On 5/9/2026 8:28 AM, Miaoqing Pan wrote:
>> Wi-Fi 7 monitor RX status TLV parsing needs to decode TLV headers and
>> advance the pointer with the correct header alignment. Different targets
>> use different TLV header layouts (32-bit vs 64-bit), but the HAL ops for
>> dp_mon RX status header decode and header alignment were not populated
>> for all wifi7 targets.
>>
>> Add dp_mon RX status TLV header decode callbacks and TLV header alignment
>> helpers to the wifi7 HAL ops for QCC2072, QCN9274 and WCN7850. Export
>> helpers to query the required TLV header alignment for 32-bit and 64-bit
>> TLV headers so the caller can align the TLV walk correctly across targets.
>>
>> Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1
>> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3
>>
>> Signed-off-by: Miaoqing Pan <miaoqing.pan at oss.qualcomm.com>
>> ---
>>   drivers/net/wireless/ath/ath12k/hal.c               | 12 ++++++++++++
>>   drivers/net/wireless/ath/ath12k/hal.h               |  4 ++++
>>   drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c |  2 ++
>>   drivers/net/wireless/ath/ath12k/wifi7/hal_qcn9274.c |  2 ++
>>   drivers/net/wireless/ath/ath12k/wifi7/hal_wcn7850.c |  2 ++
>>   5 files changed, 22 insertions(+)
>>
>> diff --git a/drivers/net/wireless/ath/ath12k/hal.c b/drivers/net/wireless/ath/ath12k/hal.c
>> index d940f83cd92f..c0c3d2f047ef 100644
>> --- a/drivers/net/wireless/ath/ath12k/hal.c
>> +++ b/drivers/net/wireless/ath/ath12k/hal.c
>> @@ -875,3 +875,15 @@ void *ath12k_hal_decode_tlv32_hdr(void *tlv, u16 *tag, u16 *len, 
>> u16 *usrid)
>>       return tlv32->value;
>>   }
>>   EXPORT_SYMBOL(ath12k_hal_decode_tlv32_hdr);
>> +
>> +u32 ath12k_hal_get_tlv64_hdr_align(void)
>> +{
>> +    return HAL_TLV_64_ALIGN;
>> +}
>> +EXPORT_SYMBOL(ath12k_hal_get_tlv64_hdr_align);
>> +
>> +u32 ath12k_hal_get_tlv32_hdr_align(void)
>> +{
>> +    return HAL_TLV_ALIGN;
>> +}
>> +EXPORT_SYMBOL(ath12k_hal_get_tlv32_hdr_align);
>> diff --git a/drivers/net/wireless/ath/ath12k/hal.h b/drivers/net/wireless/ath/ath12k/hal.h
>> index 3158c1881c76..312993d3d5d4 100644
>> --- a/drivers/net/wireless/ath/ath12k/hal.h
>> +++ b/drivers/net/wireless/ath/ath12k/hal.h
>> @@ -1439,6 +1439,8 @@ struct hal_ops {
>>                        u8 *rbm, u32 *msdu_cnt);
>>       void *(*reo_cmd_enc_tlv_hdr)(void *tlv, u64 tag, u64 len);
>>       u16 (*reo_status_dec_tlv_hdr)(void *tlv, void **desc);
>> +    void *(*mon_rx_status_dec_tlv_hdr)(void *tlv, u16 *tag, u16 *len, u16 *usrid);
>> +    u32 (*get_tlv_hdr_align)(void);
>>   };
>>   #define HAL_TLV_HDR_TAG        GENMASK(9, 1)
>> @@ -1553,4 +1555,6 @@ void *ath12k_hal_encode_tlv64_hdr(void *tlv, u64 tag, u64 len);
>>   void *ath12k_hal_encode_tlv32_hdr(void *tlv, u64 tag, u64 len);
>>   void *ath12k_hal_decode_tlv64_hdr(void *tlv, u16 *tag, u16 *len, u16 *usrid);
>>   void *ath12k_hal_decode_tlv32_hdr(void *tlv, u16 *tag, u16 *len, u16 *usrid);
>> +u32 ath12k_hal_get_tlv64_hdr_align(void);
>> +u32 ath12k_hal_get_tlv32_hdr_align(void);
>>   #endif
>> diff --git a/drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c 
>> b/drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c
>> index c0583c3a2191..80ffadc47d48 100644
>> --- a/drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c
>> +++ b/drivers/net/wireless/ath/ath12k/wifi7/hal_qcc2072.c
>> @@ -490,6 +490,8 @@ const struct hal_ops hal_qcc2072_ops = {
>>       .rx_reo_ent_buf_paddr_get = ath12k_wifi7_hal_rx_reo_ent_buf_paddr_get,
>>       .reo_cmd_enc_tlv_hdr = ath12k_hal_encode_tlv32_hdr,
>>       .reo_status_dec_tlv_hdr = ath12k_hal_reo_status_dec_tlv_hdr_qcc2072,
>> +    .mon_rx_status_dec_tlv_hdr = ath12k_hal_decode_tlv32_hdr,
>> +    .get_tlv_hdr_align = ath12k_hal_get_tlv32_hdr_align,
> 
> ops get_tlv_hdr_align() seems unused, may be patch 4/5 is supposed to
> used this ops instead of removing the alignment?

My bad, somehow overlooked it, it is indeed used in the patch 4/5.



More information about the ath12k mailing list