xref: /linux/drivers/net/wireless/ath/ath11k/testmode_i.h (revision 6e7fd890f1d6ac83805409e9c346240de2705584)
1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2 /*
3  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
5  */
6 
7 /* "API" level of the ath11k testmode interface. Bump it after every
8  * incompatible interface change.
9  */
10 #define ATH11K_TESTMODE_VERSION_MAJOR 1
11 
12 /* Bump this after every _compatible_ interface change, for example
13  * addition of a new command or an attribute.
14  */
15 #define ATH11K_TESTMODE_VERSION_MINOR 1
16 
17 #define ATH11K_TM_DATA_MAX_LEN		5000
18 #define ATH11K_FTM_EVENT_MAX_BUF_LENGTH 2048
19 
20 enum ath11k_tm_attr {
21 	__ATH11K_TM_ATTR_INVALID		= 0,
22 	ATH11K_TM_ATTR_CMD			= 1,
23 	ATH11K_TM_ATTR_DATA			= 2,
24 	ATH11K_TM_ATTR_WMI_CMDID		= 3,
25 	ATH11K_TM_ATTR_VERSION_MAJOR		= 4,
26 	ATH11K_TM_ATTR_VERSION_MINOR		= 5,
27 	ATH11K_TM_ATTR_WMI_OP_VERSION		= 6,
28 
29 	/* keep last */
30 	__ATH11K_TM_ATTR_AFTER_LAST,
31 	ATH11K_TM_ATTR_MAX		= __ATH11K_TM_ATTR_AFTER_LAST - 1,
32 };
33 
34 /* All ath11k testmode interface commands specified in
35  * ATH11K_TM_ATTR_CMD
36  */
37 enum ath11k_tm_cmd {
38 	/* Returns the supported ath11k testmode interface version in
39 	 * ATH11K_TM_ATTR_VERSION. Always guaranteed to work. User space
40 	 * uses this to verify it's using the correct version of the
41 	 * testmode interface
42 	 */
43 	ATH11K_TM_CMD_GET_VERSION = 0,
44 
45 	/* The command used to transmit a WMI command to the firmware and
46 	 * the event to receive WMI events from the firmware. Without
47 	 * struct wmi_cmd_hdr header, only the WMI payload. Command id is
48 	 * provided with ATH11K_TM_ATTR_WMI_CMDID and payload in
49 	 * ATH11K_TM_ATTR_DATA.
50 	 */
51 	ATH11K_TM_CMD_WMI = 1,
52 
53 	/* Boots the UTF firmware, the netdev interface must be down at the
54 	 * time.
55 	 */
56 	ATH11K_TM_CMD_TESTMODE_START = 2,
57 
58 	/* The command used to transmit a FTM WMI command to the firmware
59 	 * and the event to receive WMI events from the firmware. The data
60 	 * received only contain the payload, need to add the tlv header
61 	 * and send the cmd to firmware with command id WMI_PDEV_UTF_CMDID.
62 	 * The data payload size could be large and the driver needs to
63 	 * send segmented data to firmware.
64 	 */
65 	ATH11K_TM_CMD_WMI_FTM = 3,
66 };
67