Jelajahi Sumber

qcacld-3.0: Add enum for max test commands

Add enum for max test command and replace the check for
WFDS_GET_STATS cmd with WFDS_CMD_MAX.
Also, put end of struct at the end of the structure in
struct wfds_ut_cmd_req_msg_v01_ei.

Change-Id: Icc1075fb10d92fba17ffbd71a97904c6c8d866d0
CRs-Fixed: 3591854
Ananya Gupta 1 tahun lalu
induk
melakukan
3b7bf0f80f

+ 2 - 1
core/hdd/src/wlan_hdd_sysfs_direct_link_ut_cmd.c

@@ -60,7 +60,8 @@ static ssize_t __hdd_sysfs_direct_link_ut_cmd_store(struct net_device *net_dev,
 		return -EINVAL;
 	if (kstrtou32(token, 0, (uint32_t *)&cmd_info.cmd))
 		return -EINVAL;
-	if (cmd_info.cmd > WFDS_GET_STATS)
+
+	if (cmd_info.cmd >= WFDS_CMD_MAX)
 		return -EINVAL;
 
 	if (cmd_info.cmd == WFDS_STOP_TRAFFIC || cmd_info.cmd == WFDS_GET_STATS)

+ 2 - 0
os_if/qmi/inc/os_if_qmi.h

@@ -46,6 +46,7 @@
  * @WFDS_START_WHC: Start WHC traffic
  * @WFDS_START_TSF: Start TSF handshake
  * @WFDS_CMD_MISC: Miscellaneous test
+ * @WFDS_CMD_MAX: Max test commands
  */
 enum os_if_qmi_wfds_ut_cmd_type {
 	WFDS_STOP_TRAFFIC,
@@ -54,6 +55,7 @@ enum os_if_qmi_wfds_ut_cmd_type {
 	WFDS_START_WHC,
 	WFDS_START_TSF,
 	WFDS_CMD_MISC,
+	WFDS_CMD_MAX,
 };
 
 /**

+ 5 - 5
os_if/qmi/src/os_if_qmi_wifi_driver_service_v01.c

@@ -569,11 +569,6 @@ struct qmi_elem_info wfds_ut_cmd_req_msg_v01_ei[] = {
 					   wfds_ut_cmd_req_msg_v01,
 					   dest_mac),
 	},
-	{
-		.data_type      = QMI_EOTI,
-		.array_type       = NO_ARRAY,
-		.tlv_type       = QMI_COMMON_TLV_TYPE,
-	},
 	{
 		.data_type      = QMI_UNSIGNED_1_BYTE,
 		.elem_len       = 1,
@@ -624,4 +619,9 @@ struct qmi_elem_info wfds_ut_cmd_req_msg_v01_ei[] = {
 					   wfds_ut_cmd_req_msg_v01,
 					   misc),
 	},
+	{
+		.data_type      = QMI_EOTI,
+		.array_type       = NO_ARRAY,
+		.tlv_type       = QMI_COMMON_TLV_TYPE,
+	},
 };