public inbox for ath12k@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] wifi: ath12k: Add support for parsing 64-bit TLVs
@ 2024-12-04  7:12 P Praneesh
  2024-12-05  4:45 ` Jeff Johnson
  2024-12-16 16:15 ` Kalle Valo
  0 siblings, 2 replies; 6+ messages in thread
From: P Praneesh @ 2024-12-04  7:12 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, P Praneesh

There is mismatch between the format of monitor destination TLVs received
and the expected format by the current implementation. The received TLVs
are in 64-bit format, while the implementation is designed to handle
32-bit TLVs. This leads to incorrect parsing. Fix it by adding support
for parsing 64-bit TLVs.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1

Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp_mon.c   | 14 +++++++-------
 drivers/net/wireless/ath/ath12k/hal_desc.h |  2 ++
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index 494984133a91..dff14f77f504 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -1199,19 +1199,19 @@ ath12k_dp_mon_parse_rx_dest(struct ath12k_base *ab, struct ath12k_mon_data *pmon
 			    struct sk_buff *skb)
 {
 	struct hal_rx_mon_ppdu_info *ppdu_info = &pmon->mon_ppdu_info;
-	struct hal_tlv_hdr *tlv;
+	struct hal_tlv_64_hdr *tlv;
 	enum hal_rx_mon_status hal_status;
-	u32 tlv_userid = 0;
+	u32 tlv_userid;
 	u16 tlv_tag, tlv_len;
 	u8 *ptr = skb->data;
 
 	memset(ppdu_info, 0, sizeof(struct hal_rx_mon_ppdu_info));
 
 	do {
-		tlv = (struct hal_tlv_hdr *)ptr;
-		tlv_tag = le32_get_bits(tlv->tl, HAL_TLV_HDR_TAG);
-		tlv_len = le32_get_bits(tlv->tl, HAL_TLV_HDR_LEN);
-		tlv_userid = le32_get_bits(tlv->tl, HAL_TLV_USR_ID);
+		tlv = (struct hal_tlv_64_hdr *)ptr;
+		tlv_tag = le64_get_bits(tlv->tl, HAL_TLV_64_HDR_TAG);
+		tlv_len = le64_get_bits(tlv->tl, HAL_TLV_64_HDR_LEN);
+		tlv_userid = le64_get_bits(tlv->tl, HAL_TLV_64_USR_ID);
 		ptr += sizeof(*tlv);
 
 		/* The actual length of PPDU_END is the combined length of many PHY
@@ -1226,7 +1226,7 @@ ath12k_dp_mon_parse_rx_dest(struct ath12k_base *ab, struct ath12k_mon_data *pmon
 		hal_status = ath12k_dp_mon_rx_parse_status_tlv(ab, pmon,
 							       tlv_tag, ptr, tlv_userid);
 		ptr += tlv_len;
-		ptr = PTR_ALIGN(ptr, HAL_TLV_ALIGN);
+		ptr = PTR_ALIGN(ptr, HAL_TLV_64_ALIGN);
 
 		if ((ptr - skb->data) >= DP_RX_BUFFER_SIZE)
 			break;
diff --git a/drivers/net/wireless/ath/ath12k/hal_desc.h b/drivers/net/wireless/ath/ath12k/hal_desc.h
index a460d432288f..b90a6da72e29 100644
--- a/drivers/net/wireless/ath/ath12k/hal_desc.h
+++ b/drivers/net/wireless/ath/ath12k/hal_desc.h
@@ -579,6 +579,8 @@ struct hal_tlv_hdr {
 
 #define HAL_TLV_64_HDR_TAG		GENMASK(9, 1)
 #define HAL_TLV_64_HDR_LEN		GENMASK(21, 10)
+#define HAL_TLV_64_USR_ID		GENMASK(31, 26)
+#define HAL_TLV_64_ALIGN		8
 
 struct hal_tlv_64_hdr {
 	__le64 tl;
-- 
2.34.1



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

* Re: [PATCH] wifi: ath12k: Add support for parsing 64-bit TLVs
  2024-12-04  7:12 [PATCH] wifi: ath12k: Add support for parsing 64-bit TLVs P Praneesh
@ 2024-12-05  4:45 ` Jeff Johnson
  2024-12-16 16:15 ` Kalle Valo
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Johnson @ 2024-12-05  4:45 UTC (permalink / raw)
  To: P Praneesh, ath12k; +Cc: linux-wireless

On 12/3/2024 11:12 PM, P Praneesh wrote:
> There is mismatch between the format of monitor destination TLVs received
> and the expected format by the current implementation. The received TLVs
> are in 64-bit format, while the implementation is designed to handle
> 32-bit TLVs. This leads to incorrect parsing. Fix it by adding support
> for parsing 64-bit TLVs.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
Acked-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>



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

* Re: [PATCH] wifi: ath12k: Add support for parsing 64-bit TLVs
  2024-12-04  7:12 [PATCH] wifi: ath12k: Add support for parsing 64-bit TLVs P Praneesh
  2024-12-05  4:45 ` Jeff Johnson
@ 2024-12-16 16:15 ` Kalle Valo
  2024-12-17  9:30   ` Praneesh P
  1 sibling, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2024-12-16 16:15 UTC (permalink / raw)
  To: P Praneesh; +Cc: ath12k, linux-wireless

P Praneesh <quic_ppranees@quicinc.com> writes:

> There is mismatch between the format of monitor destination TLVs received
> and the expected format by the current implementation. The received TLVs
> are in 64-bit format, while the implementation is designed to handle
> 32-bit TLVs. This leads to incorrect parsing. Fix it by adding support
> for parsing 64-bit TLVs.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>

What about WCN7850? The commit message mentions nothing about it so I
can only assume that this breaks WCN7850.

Please remember that ath12k is not only a QCN9274 project. If I got 0.01
EUR every time I say that...

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

* Re: [PATCH] wifi: ath12k: Add support for parsing 64-bit TLVs
  2024-12-16 16:15 ` Kalle Valo
@ 2024-12-17  9:30   ` Praneesh P
  2024-12-17 19:35     ` Kalle Valo
  0 siblings, 1 reply; 6+ messages in thread
From: Praneesh P @ 2024-12-17  9:30 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath12k, linux-wireless



On 12/16/2024 9:45 PM, Kalle Valo wrote:
> P Praneesh <quic_ppranees@quicinc.com> writes:
> 
>> There is mismatch between the format of monitor destination TLVs received
>> and the expected format by the current implementation. The received TLVs
>> are in 64-bit format, while the implementation is designed to handle
>> 32-bit TLVs. This leads to incorrect parsing. Fix it by adding support
>> for parsing 64-bit TLVs.
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
> 
> What about WCN7850? The commit message mentions nothing about it so I
> can only assume that this breaks WCN7850.
> 
> Please remember that ath12k is not only a QCN9274 project. If I got 0.01
> EUR every time I say that...
> 
This change is common for WCN7850 and QCN9274. Sure, I will add WCN7850 
tested on tag in v2.


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

* Re: [PATCH] wifi: ath12k: Add support for parsing 64-bit TLVs
  2024-12-17  9:30   ` Praneesh P
@ 2024-12-17 19:35     ` Kalle Valo
  2024-12-18 17:06       ` Praneesh P
  0 siblings, 1 reply; 6+ messages in thread
From: Kalle Valo @ 2024-12-17 19:35 UTC (permalink / raw)
  To: Praneesh P; +Cc: ath12k, linux-wireless

Praneesh P <quic_ppranees@quicinc.com> writes:

> On 12/16/2024 9:45 PM, Kalle Valo wrote:
>> P Praneesh <quic_ppranees@quicinc.com> writes:
>> 
>>> There is mismatch between the format of monitor destination TLVs received
>>> and the expected format by the current implementation. The received TLVs
>>> are in 64-bit format, while the implementation is designed to handle
>>> 32-bit TLVs. This leads to incorrect parsing. Fix it by adding support
>>> for parsing 64-bit TLVs.
>>>
>>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>>>
>>> Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
>> What about WCN7850? The commit message mentions nothing about it so
>> I
>> can only assume that this breaks WCN7850.
>> Please remember that ath12k is not only a QCN9274 project. If I got
>> 0.01
>> EUR every time I say that...
>> 
> This change is common for WCN7850 and QCN9274. Sure, I will add
> WCN7850 tested on tag in v2.

I am not exactly looking for a Tested-on tag. What I'm asking is that
people take into account WCN7850 when designing and writing patches
ath12k. For example, is the firmware interface same and similar
functional differences between supported hardware families.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

* Re: [PATCH] wifi: ath12k: Add support for parsing 64-bit TLVs
  2024-12-17 19:35     ` Kalle Valo
@ 2024-12-18 17:06       ` Praneesh P
  0 siblings, 0 replies; 6+ messages in thread
From: Praneesh P @ 2024-12-18 17:06 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath12k, linux-wireless


On 12/18/2024 1:05 AM, Kalle Valo wrote:
> I am not exactly looking for a Tested-on tag. What I'm asking is that
> people take into account WCN7850 when designing and writing patches
> ath12k. For example, is the firmware interface same and similar
> functional differences between supported hardware families.
I'll make sure to keep this in mind for future patches.



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

end of thread, other threads:[~2024-12-18 17:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04  7:12 [PATCH] wifi: ath12k: Add support for parsing 64-bit TLVs P Praneesh
2024-12-05  4:45 ` Jeff Johnson
2024-12-16 16:15 ` Kalle Valo
2024-12-17  9:30   ` Praneesh P
2024-12-17 19:35     ` Kalle Valo
2024-12-18 17:06       ` Praneesh P

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox