Browse Source

qcacld-3.0: Add support for unit test command in FTM mode

FTM mode does not create vdev. So in order to add support for the
unit test command in FTM mode, set vdev of the adapter to 0 and create
a new funciton that handles the command called in FTM mode and does
not check for a valid vdev.

Change-Id: I5b71765dc4c6eb8025aa60726e4105f8ff30f634
CRs-Fixed: 2805415
Alan Chen 4 years ago
parent
commit
4d9374f10e
2 changed files with 11 additions and 3 deletions
  1. 7 1
      core/hdd/src/wlan_hdd_wext.c
  2. 4 2
      core/wma/src/wma_main.c

+ 7 - 1
core/hdd/src/wlan_hdd_wext.c

@@ -7121,6 +7121,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 	case WE_UNIT_TEST_CMD:
 	{
 		QDF_STATUS status;
+		uint8_t vdev_id = 0;
 
 		if ((apps_args[0] < WLAN_MODULE_ID_MIN) ||
 		    (apps_args[0] >= WLAN_MODULE_ID_MAX)) {
@@ -7133,12 +7134,17 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 			return -EINVAL;
 		}
 
+		if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam())
+			vdev_id = 0;
+		else
+			vdev_id = adapter->vdev_id;
+
 		if (adapter->vdev_id >= WLAN_MAX_VDEVS) {
 			hdd_err_rl("Invalid vdev id");
 			return -EINVAL;
 		}
 
-		status = sme_send_unit_test_cmd(adapter->vdev_id,
+		status = sme_send_unit_test_cmd(vdev_id,
 						apps_args[0],
 						apps_args[1],
 						&apps_args[2]);

+ 4 - 2
core/wma/src/wma_main.c

@@ -676,8 +676,10 @@ QDF_STATUS wma_form_unit_test_cmd_and_send(uint32_t vdev_id,
 
 	wma_debug("enter");
 
-	if (!wma_is_vdev_valid(vdev_id))
-		return QDF_STATUS_E_FAILURE;
+	if (QDF_GLOBAL_FTM_MODE != cds_get_conparam()) {
+		if (!wma_is_vdev_valid(vdev_id))
+			return QDF_STATUS_E_FAILURE;
+	}
 
 	if (arg_count > WMA_MAX_NUM_ARGS) {
 		wma_err("arg_count is crossed the boundary");