Skip to content

Commit 21e3174

Browse files
Tamizh Chelvam Rajagregkh
authored andcommitted
wifi: ath12k: fix endianness handling while accessing wmi service bit
[ Upstream commit 8f1a078 ] 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: 342527f ("wifi: ath12k: Add support to parse new WMI event for 6 GHz regulatory") Signed-off-by: Tamizh Chelvam Raja <tamizh.raja@oss.qualcomm.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Link: https://patch.msgid.link/20250717173539.2523396-2-tamizh.raja@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent dde1520 commit 21e3174

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

  • drivers/net/wireless/ath/ath12k

drivers/net/wireless/ath/ath12k/wmi.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6303,7 +6303,7 @@ static int ath12k_wmi_tlv_services_parser(struct ath12k_base *ab,
63036303
void *data)
63046304
{
63056305
const struct wmi_service_available_event *ev;
6306-
u32 *wmi_ext2_service_bitmap;
6306+
__le32 *wmi_ext2_service_bitmap;
63076307
int i, j;
63086308
u16 expected_len;
63096309

@@ -6335,21 +6335,23 @@ static int ath12k_wmi_tlv_services_parser(struct ath12k_base *ab,
63356335
ev->wmi_service_segment_bitmap[3]);
63366336
break;
63376337
case WMI_TAG_ARRAY_UINT32:
6338-
wmi_ext2_service_bitmap = (u32 *)ptr;
6338+
wmi_ext2_service_bitmap = (__le32 *)ptr;
63396339
for (i = 0, j = WMI_MAX_EXT_SERVICE;
63406340
i < WMI_SERVICE_SEGMENT_BM_SIZE32 && j < WMI_MAX_EXT2_SERVICE;
63416341
i++) {
63426342
do {
6343-
if (wmi_ext2_service_bitmap[i] &
6343+
if (__le32_to_cpu(wmi_ext2_service_bitmap[i]) &
63446344
BIT(j % WMI_AVAIL_SERVICE_BITS_IN_SIZE32))
63456345
set_bit(j, ab->wmi_ab.svc_map);
63466346
} while (++j % WMI_AVAIL_SERVICE_BITS_IN_SIZE32);
63476347
}
63486348

63496349
ath12k_dbg(ab, ATH12K_DBG_WMI,
63506350
"wmi_ext2_service_bitmap 0x%04x 0x%04x 0x%04x 0x%04x",
6351-
wmi_ext2_service_bitmap[0], wmi_ext2_service_bitmap[1],
6352-
wmi_ext2_service_bitmap[2], wmi_ext2_service_bitmap[3]);
6351+
__le32_to_cpu(wmi_ext2_service_bitmap[0]),
6352+
__le32_to_cpu(wmi_ext2_service_bitmap[1]),
6353+
__le32_to_cpu(wmi_ext2_service_bitmap[2]),
6354+
__le32_to_cpu(wmi_ext2_service_bitmap[3]));
63536355
break;
63546356
}
63556357
return 0;

0 commit comments

Comments
 (0)