From: Tamizh Chelvam Raja Date: Thu, 17 Jul 2025 17:35:39 +0000 (+0530) Subject: wifi: ath12k: Add support to parse max ext2 wmi service bit X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a50c5ca394ab1b3a30094eda2354bcfc00f9909;p=thirdparty%2Flinux.git wifi: ath12k: Add support to parse max ext2 wmi service bit 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 Signed-off-by: Tamizh Chelvam Raja Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20250717173539.2523396-3-tamizh.raja@oss.qualcomm.com Signed-off-by: Jeff Johnson --- diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 535c9849b98c1..a2a493928d082 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;