]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: ath12k: Clean up the WMI Unit Test command interface
authorJeff Johnson <jeff.johnson@oss.qualcomm.com>
Tue, 10 Mar 2026 15:16:12 +0000 (08:16 -0700)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 16 Mar 2026 15:34:23 +0000 (08:34 -0700)
commite570593b568f74b8d8367d094400d71bc398118f
tree87db5258acaff5110076b794b1663af8a9480949
parent27401c9b143278eb9fa7d46f97ab063d65e5afd5
wifi: ath12k: Clean up the WMI Unit Test command interface

Currently, ath12k_wmi_send_unit_test_cmd() provides the interface to
send a Unit Test command to firmware.  The payload for the command is
passed in two separate parameters, struct wmi_unit_test_cmd ut_cmd and
u32 *test_args.  This interface is strange in that it passes the
ut_cmd structure by value instead of by reference. But even worse,
this presents an interface that is not endian clean since the ut_cmd
structure is defined in little endian format while the test_args array
is defined to be in cpu endian format. Furthermore, the implementation
of this function passes the test_args directly to the firmware, without
performing cpu_to_le32() conversion, and hence this functionality will
not work correctly on big endian platforms.

In order to fix these issues, introduce a new wmi_unit_test_arg
structure which defines all of the parameters needed by the Unit Test
command in a single structure using cpu endian. Update
ath12k_wmi_send_unit_test_cmd() to take a pointer to this structure
and perform all cpu_to_le32() conversions needed while forming the
firmware command. Update the only existing Unit Test function,
ath12k_wmi_simulate_radar(), to properly fill and pass this new
structure to ath12k_wmi_send_unit_test_cmd().

Compile tested only.

Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260310-ath12k-unit-test-cleanup-v1-1-03e3df56f903@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/wmi.c
drivers/net/wireless/ath/ath12k/wmi.h