linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ath-next 0/2] wifi: ath12k: Extend support to parse wmi service bit
@ 2025-07-17  6:45 Tamizh Chelvam Raja
  2025-07-17  6:45 ` [PATCH ath-next 1/2] wifi: ath12k: Use __le32_to_cpu() conversion while parsing " Tamizh Chelvam Raja
  2025-07-17  6:45 ` [PATCH ath-next 2/2] wifi: ath12k: Add support to parse max ext2 " Tamizh Chelvam Raja
  0 siblings, 2 replies; 5+ messages in thread
From: Tamizh Chelvam Raja @ 2025-07-17  6:45 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Tamizh Chelvam Raja

Extend support to parse wmi service bit till the last value firmware
is advertising and use endian conversion while accessing the wmi_ext2_service_bitmap
value in ath12k_wmi_tlv_services_parser().

Tamizh Chelvam Raja (2):
  wifi: ath12k: Use __le32_to_cpu() conversion while parsing wmi service
    bit
  wifi: ath12k: Add support to parse max ext2 wmi service bit

 drivers/net/wireless/ath/ath12k/wmi.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)


base-commit: 65c12b104cb942d588a1a093acc4537fb3d3b129
-- 
2.34.1


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

* [PATCH ath-next 1/2] wifi: ath12k: Use __le32_to_cpu() conversion while parsing wmi service bit
  2025-07-17  6:45 [PATCH ath-next 0/2] wifi: ath12k: Extend support to parse wmi service bit Tamizh Chelvam Raja
@ 2025-07-17  6:45 ` Tamizh Chelvam Raja
  2025-07-17 17:14   ` Vasanthakumar Thiagarajan
  2025-07-17  6:45 ` [PATCH ath-next 2/2] wifi: ath12k: Add support to parse max ext2 " Tamizh Chelvam Raja
  1 sibling, 1 reply; 5+ messages in thread
From: Tamizh Chelvam Raja @ 2025-07-17  6:45 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Tamizh Chelvam Raja

Currently there is no endian conversion in ath12k_wmi_tlv_services_parser()
so the service bit parsing will be incorrect on a big endian platform and
to fix this by using appropriate endian conversion.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00217-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Fixes: 342527f35338 ("wifi: ath12k: Add support to parse new WMI event for 6 GHz regulatory")
Signed-off-by: Tamizh Chelvam Raja <tamizh.raja@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/wmi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index ed3c08dbd899..535c9849b98c 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -7581,7 +7581,7 @@ static int ath12k_wmi_tlv_services_parser(struct ath12k_base *ab,
 					  void *data)
 {
 	const struct wmi_service_available_event *ev;
-	u32 *wmi_ext2_service_bitmap;
+	__le32 *wmi_ext2_service_bitmap;
 	int i, j;
 	u16 expected_len;
 
@@ -7613,12 +7613,12 @@ static int ath12k_wmi_tlv_services_parser(struct ath12k_base *ab,
 			   ev->wmi_service_segment_bitmap[3]);
 		break;
 	case WMI_TAG_ARRAY_UINT32:
-		wmi_ext2_service_bitmap = (u32 *)ptr;
+		wmi_ext2_service_bitmap = (__le32 *)ptr;
 		for (i = 0, j = WMI_MAX_EXT_SERVICE;
 		     i < WMI_SERVICE_SEGMENT_BM_SIZE32 && j < WMI_MAX_EXT2_SERVICE;
 		     i++) {
 			do {
-				if (wmi_ext2_service_bitmap[i] &
+				if (__le32_to_cpu(wmi_ext2_service_bitmap[i]) &
 				    BIT(j % WMI_AVAIL_SERVICE_BITS_IN_SIZE32))
 					set_bit(j, ab->wmi_ab.svc_map);
 			} while (++j % WMI_AVAIL_SERVICE_BITS_IN_SIZE32);
@@ -7626,8 +7626,10 @@ static int ath12k_wmi_tlv_services_parser(struct ath12k_base *ab,
 
 		ath12k_dbg(ab, ATH12K_DBG_WMI,
 			   "wmi_ext2_service_bitmap 0x%04x 0x%04x 0x%04x 0x%04x",
-			   wmi_ext2_service_bitmap[0], wmi_ext2_service_bitmap[1],
-			   wmi_ext2_service_bitmap[2], wmi_ext2_service_bitmap[3]);
+			   __le32_to_cpu(wmi_ext2_service_bitmap[0]),
+			   __le32_to_cpu(wmi_ext2_service_bitmap[1]),
+			   __le32_to_cpu(wmi_ext2_service_bitmap[2]),
+			   __le32_to_cpu(wmi_ext2_service_bitmap[3]));
 		break;
 	}
 	return 0;
-- 
2.34.1


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

* [PATCH ath-next 2/2] wifi: ath12k: Add support to parse max ext2 wmi service bit
  2025-07-17  6:45 [PATCH ath-next 0/2] wifi: ath12k: Extend support to parse wmi service bit Tamizh Chelvam Raja
  2025-07-17  6:45 ` [PATCH ath-next 1/2] wifi: ath12k: Use __le32_to_cpu() conversion while parsing " Tamizh Chelvam Raja
@ 2025-07-17  6:45 ` Tamizh Chelvam Raja
  2025-07-17 17:18   ` Vasanthakumar Thiagarajan
  1 sibling, 1 reply; 5+ messages in thread
From: Tamizh Chelvam Raja @ 2025-07-17  6:45 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Tamizh Chelvam Raja

Update the host logic to dynamically parse WMI extended service
bits beyond the current fixed size of 4 * 32 (i.e., 384 bits)
after WMI_MAX_EXT_SERVICE (256).
The current implementation misses service bits advertised beyond this
range, leading to not enabling some of the features supported by firmware.

Implement dynamic length parsing to iterate up to the maximum
service bit index advertised by the firmware.
This ensures all supported features are correctly recognized and enabled.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00217-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Depends-On:
[PATCH ath-next v5] wifi: ath12k: Fix using __le32_to_cpu() conversion while parsing wmi service bit

Signed-off-by: Tamizh Chelvam Raja <tamizh.raja@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/wmi.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 535c9849b98c..a2a493928d08 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -7581,6 +7581,7 @@ static int ath12k_wmi_tlv_services_parser(struct ath12k_base *ab,
 					  void *data)
 {
 	const struct wmi_service_available_event *ev;
+	u16 wmi_ext2_service_words;
 	__le32 *wmi_ext2_service_bitmap;
 	int i, j;
 	u16 expected_len;
@@ -7614,22 +7615,20 @@ static int ath12k_wmi_tlv_services_parser(struct ath12k_base *ab,
 		break;
 	case WMI_TAG_ARRAY_UINT32:
 		wmi_ext2_service_bitmap = (__le32 *)ptr;
+		wmi_ext2_service_words = len / sizeof(u32);
 		for (i = 0, j = WMI_MAX_EXT_SERVICE;
-		     i < WMI_SERVICE_SEGMENT_BM_SIZE32 && j < WMI_MAX_EXT2_SERVICE;
+		     i < wmi_ext2_service_words && j < WMI_MAX_EXT2_SERVICE;
 		     i++) {
 			do {
 				if (__le32_to_cpu(wmi_ext2_service_bitmap[i]) &
 				    BIT(j % WMI_AVAIL_SERVICE_BITS_IN_SIZE32))
 					set_bit(j, ab->wmi_ab.svc_map);
 			} while (++j % WMI_AVAIL_SERVICE_BITS_IN_SIZE32);
+			ath12k_dbg(ab, ATH12K_DBG_WMI,
+				   "wmi_ext2_service bitmap 0x%08x\n",
+				   __le32_to_cpu(wmi_ext2_service_bitmap[i]));
 		}
 
-		ath12k_dbg(ab, ATH12K_DBG_WMI,
-			   "wmi_ext2_service_bitmap 0x%04x 0x%04x 0x%04x 0x%04x",
-			   __le32_to_cpu(wmi_ext2_service_bitmap[0]),
-			   __le32_to_cpu(wmi_ext2_service_bitmap[1]),
-			   __le32_to_cpu(wmi_ext2_service_bitmap[2]),
-			   __le32_to_cpu(wmi_ext2_service_bitmap[3]));
 		break;
 	}
 	return 0;
-- 
2.34.1


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

* Re: [PATCH ath-next 1/2] wifi: ath12k: Use __le32_to_cpu() conversion while parsing wmi service bit
  2025-07-17  6:45 ` [PATCH ath-next 1/2] wifi: ath12k: Use __le32_to_cpu() conversion while parsing " Tamizh Chelvam Raja
@ 2025-07-17 17:14   ` Vasanthakumar Thiagarajan
  0 siblings, 0 replies; 5+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-07-17 17:14 UTC (permalink / raw)
  To: Tamizh Chelvam Raja, ath12k; +Cc: linux-wireless


Instead how about title something like below
"wifi: ath12k: fix endianness handling while accessing wmi service bit"

On 7/17/2025 12:15 PM, Tamizh Chelvam Raja wrote:
> Currently there is no endian conversion in ath12k_wmi_tlv_services_parser()
> so the service bit parsing will be incorrect on a big endian platform and
> to fix this by using appropriate endian conversion.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00217-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
> 
> Fixes: 342527f35338 ("wifi: ath12k: Add support to parse new WMI event for 6 GHz regulatory")
> Signed-off-by: Tamizh Chelvam Raja <tamizh.raja@oss.qualcomm.com>

Other than that

Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>

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

* Re: [PATCH ath-next 2/2] wifi: ath12k: Add support to parse max ext2 wmi service bit
  2025-07-17  6:45 ` [PATCH ath-next 2/2] wifi: ath12k: Add support to parse max ext2 " Tamizh Chelvam Raja
@ 2025-07-17 17:18   ` Vasanthakumar Thiagarajan
  0 siblings, 0 replies; 5+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-07-17 17:18 UTC (permalink / raw)
  To: Tamizh Chelvam Raja, ath12k; +Cc: linux-wireless



On 7/17/2025 12:15 PM, Tamizh Chelvam Raja wrote:
> Update the host logic to dynamically parse WMI extended service
> bits beyond the current fixed size of 4 * 32 (i.e., 384 bits)
> after WMI_MAX_EXT_SERVICE (256).
> The current implementation misses service bits advertised beyond this
> range, leading to not enabling some of the features supported by firmware.
> 
> Implement dynamic length parsing to iterate up to the maximum
> service bit index advertised by the firmware.
> This ensures all supported features are correctly recognized and enabled.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00217-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
> 
> Depends-On:
> [PATCH ath-next v5] wifi: ath12k: Fix using __le32_to_cpu() conversion while parsing wmi service bit

Anything which does not need to be part of the commit message should be added below
where diff stats is there. More over this depends on patch does not look correct
as it may try to refer a patch which is already part of this patch series :)

Vasanth

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

end of thread, other threads:[~2025-07-17 17:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-17  6:45 [PATCH ath-next 0/2] wifi: ath12k: Extend support to parse wmi service bit Tamizh Chelvam Raja
2025-07-17  6:45 ` [PATCH ath-next 1/2] wifi: ath12k: Use __le32_to_cpu() conversion while parsing " Tamizh Chelvam Raja
2025-07-17 17:14   ` Vasanthakumar Thiagarajan
2025-07-17  6:45 ` [PATCH ath-next 2/2] wifi: ath12k: Add support to parse max ext2 " Tamizh Chelvam Raja
2025-07-17 17:18   ` Vasanthakumar Thiagarajan

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).