Bladeren bron

qcacld-3.0: Fix compilation error and disable unit test framework

for policy manager component, unit test framework has been created.
this unit test framework can be enabled or disabled through Kbuild
flag. As policy manager is matured, unit test framework needs to
be disabled.

While disabling unit test framework, couple of compilation errors have
been observed. Fix those compilation errors.

Change-Id: I2a3ee57cc082e5ebc598f0aea2d05f31fb878732
CRs-Fixed: 1110876
Krunal Soni 8 jaren geleden
bovenliggende
commit
a6e505bc7b
4 gewijzigde bestanden met toevoegingen van 176 en 147 verwijderingen
  1. 1 5
      core/cds/inc/cds_concurrency.h
  2. 9 8
      core/cds/src/cds_concurrency.c
  3. 4 4
      core/hdd/inc/wlan_hdd_conc_ut.h
  4. 162 130
      core/hdd/src/wlan_hdd_wext.c

+ 1 - 5
core/cds/inc/cds_concurrency.h

@@ -847,6 +847,7 @@ QDF_STATUS cds_current_connections_update(uint32_t session_id,
 				uint8_t channel,
 				enum sir_conn_update_reason);
 bool cds_is_ibss_conn_exist(uint8_t *ibss_channel);
+struct cds_conc_connection_info *cds_get_conn_info(uint32_t *len);
 #ifdef MPC_UT_FRAMEWORK
 QDF_STATUS cds_incr_connection_count_utfw(
 		uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams,
@@ -858,7 +859,6 @@ QDF_STATUS cds_update_connection_info_utfw(
 		uint32_t channelid, uint32_t mac_id);
 QDF_STATUS cds_decr_connection_count_utfw(
 		uint32_t del_all, uint32_t vdev_id);
-struct cds_conc_connection_info *cds_get_conn_info(uint32_t *len);
 enum cds_pcl_type get_pcl_from_first_conn_table(enum cds_con_mode type,
 		enum cds_conc_priority_mode sys_pref);
 enum cds_pcl_type get_pcl_from_second_conn_table(
@@ -887,10 +887,6 @@ static inline QDF_STATUS cds_decr_connection_count_utfw(uint32_t del_all,
 {
 	return QDF_STATUS_SUCCESS;
 }
-static inline struct cds_conc_connection_info *cds_get_conn_info(uint32_t *len)
-{
-	return NULL;
-}
 #endif
 
 enum cds_con_mode cds_convert_device_mode_to_qdf_type(

+ 9 - 8
core/cds/src/cds_concurrency.c

@@ -6632,6 +6632,15 @@ void cds_check_and_restart_sap_with_non_dfs_acs(void)
 	}
 }
 #endif
+
+struct cds_conc_connection_info *cds_get_conn_info(uint32_t *len)
+{
+	struct cds_conc_connection_info *conn_ptr = &conc_connection_list[0];
+	*len = MAX_NUMBER_OF_CONC_CONNECTIONS;
+
+	return conn_ptr;
+}
+
 #ifdef MPC_UT_FRAMEWORK
 QDF_STATUS cds_update_connection_info_utfw(
 		uint32_t vdev_id, uint32_t tx_streams, uint32_t rx_streams,
@@ -6741,14 +6750,6 @@ QDF_STATUS cds_decr_connection_count_utfw(uint32_t del_all,
 	return QDF_STATUS_SUCCESS;
 }
 
-struct cds_conc_connection_info *cds_get_conn_info(uint32_t *len)
-{
-	struct cds_conc_connection_info *conn_ptr = &conc_connection_list[0];
-	*len = MAX_NUMBER_OF_CONC_CONNECTIONS;
-
-	return conn_ptr;
-}
-
 enum cds_pcl_type get_pcl_from_first_conn_table(enum cds_con_mode type,
 		enum cds_conc_priority_mode sys_pref)
 {

+ 4 - 4
core/hdd/inc/wlan_hdd_conc_ut.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -53,7 +53,7 @@ static inline void clean_report(hdd_context_t *hdd_ctx)
 static inline void fill_report(hdd_context_t *hdd_ctx, char *title,
 	uint32_t first_persona, uint32_t second_persona, uint32_t third_persona,
 	uint32_t chnl_1st_conn, uint32_t chnl_2nd_conn, uint32_t chnl_3rd_conn,
-	bool status, enum hdd_pcl_type pcl_type, char *reason, uint8_t *pcl)
+	bool status, enum cds_pcl_type pcl_type, char *reason, uint8_t *pcl)
 {
 }
 
@@ -66,13 +66,13 @@ static inline void wlan_hdd_one_connection_scenario(hdd_context_t *hdd_ctx)
 }
 
 static inline void wlan_hdd_two_connections_scenario(hdd_context_t *hdd_ctx,
-		uint8_t first_chnl, enum hdd_chain_mode first_chain_mask)
+		uint8_t first_chnl, enum cds_chain_mode first_chain_mask)
 {
 }
 
 static inline void wlan_hdd_three_connections_scenario(hdd_context_t *hdd_ctx,
 		uint8_t first_chnl, uint8_t second_chnl,
-		enum hdd_chain_mode chain_mask, uint8_t use_same_mac)
+		enum cds_chain_mode chain_mask, uint8_t use_same_mac)
 {
 }
 #endif

+ 162 - 130
core/hdd/src/wlan_hdd_wext.c

@@ -8342,106 +8342,11 @@ static int iw_setnone_getnone(struct net_device *dev,
 	return ret;
 }
 
-/**
- * __iw_set_var_ints_getnone - Generic "set many" private ioctl handler
- * @dev: device upon which the ioctl was received
- * @info: ioctl request information
- * @wrqu: ioctl request data
- * @extra: ioctl extra data
- *
- * This is an SSR-protected generic handler for private ioctls which
- * take multiple arguments.  Note that this implementation is also
- * somewhat unique in that it is shared by both STA-mode and SAP-mode
- * interfaces.
- *
- * Return: 0 on success, non-zero on error
- */
-static int __iw_set_var_ints_getnone(struct net_device *dev,
-				     struct iw_request_info *info,
-				     union iwreq_data *wrqu, char *extra)
+#ifdef MPC_UT_FRAMEWORK
+static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx,
+			hdd_adapter_t *adapter, int sub_cmd, int *apps_args)
 {
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
-	int sub_cmd;
-	int *apps_args = (int *) extra;
-	hdd_context_t *hdd_ctx;
-	int ret, num_args;
-
-	ENTER_DEV(dev);
-
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
-	ret = wlan_hdd_validate_context(hdd_ctx);
-	if (0 != ret)
-		return ret;
-
-	if (extra == NULL) {
-		hdd_err("NULL extra buffer pointer");
-		return -EINVAL;
-	}
-
-	sub_cmd = wrqu->data.flags;
-	num_args = wrqu->data.length;
-
-	hdd_notice("Received length %d", wrqu->data.length);
-
-	switch (sub_cmd) {
-	case WE_IBSS_GET_PEER_INFO:
-	{
-		pr_info("Station ID = %d\n", apps_args[0]);
-		hdd_wlan_get_ibss_peer_info(pAdapter, apps_args[0]);
-	}
-	break;
-
-	case WE_P2P_NOA_CMD:
-	{
-		p2p_app_setP2pPs_t p2pNoA;
-
-		if (pAdapter->device_mode != QDF_P2P_GO_MODE) {
-			hdd_err("Setting NoA is not allowed in Device mode %s(%d)",
-				hdd_device_mode_to_string(
-					pAdapter->device_mode),
-				pAdapter->device_mode);
-			return -EINVAL;
-		}
-
-		p2pNoA.opp_ps = apps_args[0];
-		p2pNoA.ctWindow = apps_args[1];
-		p2pNoA.duration = apps_args[2];
-		p2pNoA.interval = apps_args[3];
-		p2pNoA.count = apps_args[4];
-		p2pNoA.single_noa_duration = apps_args[5];
-		p2pNoA.psSelection = apps_args[6];
-
-		hdd_notice("P2P_NOA_ATTR:oppPS %d ctWindow %d duration %d interval %d count %d single noa duration %d PsSelection %x",
-			   apps_args[0], apps_args[1], apps_args[2],
-			   apps_args[3], apps_args[4],
-			   apps_args[5], apps_args[6]);
-
-		hdd_set_p2p_ps(dev, &p2pNoA);
-
-	}
-	break;
-
-	case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD:
-	{
-		hdd_notice("SELECTIVE_MODULE_LOG %d arg1 %d arg2",
-			   apps_args[0], apps_args[1]);
-		qdf_trace_enable(apps_args[0], apps_args[1]);
-	}
-	break;
-
-	case WE_MTRACE_DUMP_CMD:
-	{
-		hdd_notice("MTRACE_DUMP code %d session %d count %d bitmask_of_module %d ",
-			   apps_args[0], apps_args[1],
-			   apps_args[2], apps_args[3]);
-		qdf_trace_dump_all((void *)hHal, apps_args[0],
-				   apps_args[1], apps_args[2],
-				   apps_args[3]);
-
-	}
-	break;
-
+	switch(sub_cmd) {
 	case WE_POLICY_MANAGER_CLIST_CMD:
 	{
 		hdd_err("<iwpriv wlan0 pm_clist> is called");
@@ -8504,34 +8409,12 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 	}
 	break;
 
-	case WE_POLICY_MANAGER_CINFO_CMD:
-	{
-		struct cds_conc_connection_info *conn_info;
-		uint32_t i = 0, len = 0;
-
-		hdd_err("<iwpriv wlan0 pm_cinfo> is called");
-		conn_info = cds_get_conn_info(&len);
-		pr_info("+-----------------------------+\n");
-		for (i = 0; i < len; i++) {
-			pr_info("|table_index[%d]\t\t|\n", i);
-			pr_info("|\t|vdev_id - %d\t\t|\n", conn_info->vdev_id);
-			pr_info("|\t|chan - %d\t\t|\n", conn_info->chan);
-			pr_info("|\t|bw - %d\t\t|\n", conn_info->bw);
-			pr_info("|\t|mode - %d\t\t|\n", conn_info->mode);
-			pr_info("|\t|mac - %d\t\t|\n", conn_info->mac);
-			pr_info("|\t|in_use - %d\t\t|\n", conn_info->in_use);
-			pr_info("+-----------------------------+\n");
-			conn_info++;
-		}
-	}
-	break;
-
 	case WE_POLICY_SET_HW_MODE_CMD:
 	{
 		if (apps_args[0] == 0) {
 			hdd_err("set hw mode for single mac");
 			cds_pdev_set_hw_mode(
-					pAdapter->sessionId,
+					adapter->sessionId,
 					HW_MODE_SS_2x2,
 					HW_MODE_80_MHZ,
 					HW_MODE_SS_0x0, HW_MODE_BW_NONE,
@@ -8542,7 +8425,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 		} else if (apps_args[0] == 1) {
 			hdd_err("set hw mode for dual mac");
 			cds_pdev_set_hw_mode(
-					pAdapter->sessionId,
+					adapter->sessionId,
 					HW_MODE_SS_1x1,
 					HW_MODE_80_MHZ,
 					HW_MODE_SS_1x1, HW_MODE_40_MHZ,
@@ -8557,13 +8440,14 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 	case WE_POLICY_MANAGER_QUERY_ACTION_CMD:
 	{
 		enum cds_conc_next_action action;
-		hdd_err("<iwpriv wlan0 pm_query_action> is called");
-		action = cds_current_connections_update(pAdapter->sessionId,
+		hdd_notice("<iwpriv wlan0 pm_query_action> is called");
+		action = cds_current_connections_update(adapter->sessionId,
 						apps_args[0],
 						SIR_UPDATE_REASON_UT);
 		pr_info("next action is %d {HDD_NOP = 0, HDD_DBS, HDD_DBS_DOWNGRADE, HDD_MCC, HDD_MCC_UPGRADE}", action);
 	}
 	break;
+
 	case WE_POLICY_MANAGER_QUERY_ALLOW_CMD:
 	{
 		bool allow;
@@ -8617,6 +8501,139 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 		print_report(hdd_ctx);
 	}
 	break;
+	}
+	return 0;
+}
+#else
+static int iw_get_policy_manager_ut_ops(hdd_context_t *hdd_ctx,
+			hdd_adapter_t *adapter, int sub_cmd, int *apps_args)
+{
+	return 0;
+}
+#endif
+
+/**
+ * __iw_set_var_ints_getnone - Generic "set many" private ioctl handler
+ * @dev: device upon which the ioctl was received
+ * @info: ioctl request information
+ * @wrqu: ioctl request data
+ * @extra: ioctl extra data
+ *
+ * This is an SSR-protected generic handler for private ioctls which
+ * take multiple arguments.  Note that this implementation is also
+ * somewhat unique in that it is shared by both STA-mode and SAP-mode
+ * interfaces.
+ *
+ * Return: 0 on success, non-zero on error
+ */
+static int __iw_set_var_ints_getnone(struct net_device *dev,
+				     struct iw_request_info *info,
+				     union iwreq_data *wrqu, char *extra)
+{
+	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
+	tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
+	int sub_cmd;
+	int *apps_args = (int *) extra;
+	hdd_context_t *hdd_ctx;
+	int ret, num_args;
+
+	ENTER_DEV(dev);
+
+	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
+	ret = wlan_hdd_validate_context(hdd_ctx);
+	if (0 != ret)
+		return ret;
+
+	if (extra == NULL) {
+		hdd_err("NULL extra buffer pointer");
+		return -EINVAL;
+	}
+
+	sub_cmd = wrqu->data.flags;
+	num_args = wrqu->data.length;
+
+	hdd_notice("Received length %d", wrqu->data.length);
+
+	switch (sub_cmd) {
+	case WE_IBSS_GET_PEER_INFO:
+	{
+		pr_info("Station ID = %d\n", apps_args[0]);
+		hdd_wlan_get_ibss_peer_info(pAdapter, apps_args[0]);
+	}
+	break;
+
+	case WE_P2P_NOA_CMD:
+	{
+		p2p_app_setP2pPs_t p2pNoA;
+
+		if (pAdapter->device_mode != QDF_P2P_GO_MODE) {
+			hdd_err("Setting NoA is not allowed in Device mode %s(%d)",
+				hdd_device_mode_to_string(
+					pAdapter->device_mode),
+				pAdapter->device_mode);
+			return -EINVAL;
+		}
+
+		p2pNoA.opp_ps = apps_args[0];
+		p2pNoA.ctWindow = apps_args[1];
+		p2pNoA.duration = apps_args[2];
+		p2pNoA.interval = apps_args[3];
+		p2pNoA.count = apps_args[4];
+		p2pNoA.single_noa_duration = apps_args[5];
+		p2pNoA.psSelection = apps_args[6];
+
+		hdd_notice("P2P_NOA_ATTR:oppPS %d ctWindow %d duration %d interval %d count %d single noa duration %d PsSelection %x",
+			   apps_args[0], apps_args[1], apps_args[2],
+			   apps_args[3], apps_args[4],
+			   apps_args[5], apps_args[6]);
+
+		hdd_set_p2p_ps(dev, &p2pNoA);
+
+	}
+	break;
+
+	case WE_MTRACE_SELECTIVE_MODULE_LOG_ENABLE_CMD:
+	{
+		hdd_notice("SELECTIVE_MODULE_LOG %d arg1 %d arg2",
+			   apps_args[0], apps_args[1]);
+		qdf_trace_enable(apps_args[0], apps_args[1]);
+	}
+	break;
+
+	case WE_MTRACE_DUMP_CMD:
+	{
+		hdd_notice("MTRACE_DUMP code %d session %d count %d bitmask_of_module %d ",
+			   apps_args[0], apps_args[1],
+			   apps_args[2], apps_args[3]);
+		qdf_trace_dump_all((void *)hHal, apps_args[0],
+				   apps_args[1], apps_args[2],
+				   apps_args[3]);
+
+	}
+	break;
+
+	case WE_POLICY_MANAGER_CINFO_CMD:
+	{
+		struct cds_conc_connection_info *conn_info;
+		uint32_t i = 0, len = 0;
+
+		hdd_info("<iwpriv wlan0 pm_cinfo> is called");
+		conn_info = cds_get_conn_info(&len);
+		pr_info("+--------------------------+\n");
+		for (i = 0; i < len; i++) {
+		     pr_info("|table_index[%d]\t\t\n", i);
+		     pr_info("|\t|vdev_id - %-10d|\n", conn_info->vdev_id);
+		     pr_info("|\t|chan    - %-10d|\n", conn_info->chan);
+		     pr_info("|\t|bw      - %-10d|\n", conn_info->bw);
+		     pr_info("|\t|mode    - %-10d|\n", conn_info->mode);
+		     pr_info("|\t|mac     - %-10d|\n", conn_info->mac);
+		     pr_info("|\t|in_use  - %-10d|\n", conn_info->in_use);
+		     pr_info("+--------------------------+\n");
+		     conn_info++;
+		}
+	}
+	break;
+
 
 #ifdef FEATURE_WLAN_TDLS
 	case WE_TDLS_CONFIG_PARAMS:
@@ -8754,6 +8771,20 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
 		}
 	}
 	break;
+	case WE_POLICY_MANAGER_CLIST_CMD:
+	case WE_POLICY_MANAGER_DLIST_CMD:
+	case WE_POLICY_MANAGER_ULIST_CMD:
+	case WE_POLICY_MANAGER_DBS_CMD:
+	case WE_POLICY_MANAGER_PCL_CMD:
+	case WE_POLICY_SET_HW_MODE_CMD:
+	case WE_POLICY_MANAGER_QUERY_ACTION_CMD:
+	case WE_POLICY_MANAGER_QUERY_ALLOW_CMD:
+	case WE_POLICY_MANAGER_SCENARIO_CMD:
+	{
+		iw_get_policy_manager_ut_ops(hdd_ctx, pAdapter,
+					     sub_cmd, apps_args);
+	}
+	break;
 	default:
 	{
 		hdd_err("Invalid IOCTL command %d", sub_cmd);
@@ -11392,6 +11423,12 @@ static const struct iw_priv_args we_private_args[] = {
 	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
 	 0,
 	 "dumplog"},
+
+	{WE_POLICY_MANAGER_CINFO_CMD,
+	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
+	 0,
+	 "pm_cinfo"},
+
 #ifdef MPC_UT_FRAMEWORK
 	{WE_POLICY_MANAGER_CLIST_CMD,
 	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
@@ -11413,11 +11450,6 @@ static const struct iw_priv_args we_private_args[] = {
 	 0,
 	 "pm_pcl"},
 
-	{WE_POLICY_MANAGER_CINFO_CMD,
-	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
-	 0,
-	 "pm_cinfo"},
-
 	{WE_POLICY_MANAGER_ULIST_CMD,
 	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
 	 0,