Преглед изворни кода

qcacmn: Perform cleanup of send_init_cmd

Currently, WMI is exposing two command ops
(send_init_cmd and init_send_cmd) for init
command purpose which is leading to data/code
redundeancy. Perform clenaup for send_init_cmd.

Change-Id: I8f31ab45392cf2afb3cc34c633ba83ea42a3a835
CRs-Fixed: 2138507
Mukul Sharma пре 7 година
родитељ
комит
dc5672f760
5 измењених фајлова са 17 додато и 196 уклоњено
  1. 0 9
      wmi/inc/wmi_unified_api.h
  2. 7 1
      wmi/inc/wmi_unified_param.h
  3. 0 10
      wmi/inc/wmi_unified_priv.h
  4. 0 45
      wmi/src/wmi_unified_api.c
  5. 10 131
      wmi/src/wmi_unified_tlv.c

+ 0 - 9
wmi/inc/wmi_unified_api.h

@@ -841,15 +841,6 @@ QDF_STATUS wmi_unified_dcc_update_ndl(void *wmi_hdl,
 QDF_STATUS wmi_unified_save_fw_version_cmd(void *wmi_hdl,
 		void *evt_buf);
 
-#ifdef CONFIG_MCL
-QDF_STATUS wmi_unified_send_init_cmd(void *wmi_hdl,
-		wmi_resource_config *res_cfg,
-		uint8_t num_mem_chunks, struct wmi_host_mem_chunk *mem_chunk,
-		bool action);
-#endif
-
-QDF_STATUS wmi_unified_send_saved_init_cmd(void *wmi_hdl);
-
 QDF_STATUS wmi_unified_set_base_macaddr_indicate_cmd(void *wmi_hdl,
 					 uint8_t *custom_addr);
 

+ 7 - 1
wmi/inc/wmi_unified_param.h

@@ -5901,6 +5901,8 @@ struct wmi_host_fw_abi_ver {
  * @rx_batchmode: RX batch mode
  * @tt_support: Thermal throttling support
  * @atf_config: ATF config
+ * @mgmt_comp_evt_bundle_support: bundle support required for mgmt complete evt
+ * @tx_msdu_new_partition_id_support: new partiition id support for tx msdu
  * @iphdr_pad_config: ipheader pad config
  * @qwrap_config: Qwrap configuration
  * @alloc_frag_desc_for_data_pkt: Frag desc for data
@@ -5922,6 +5924,7 @@ struct wmi_host_fw_abi_ver {
  * @bpf_instruction_size:
  * @max_bssid_rx_filters:
  * @use_pdev_id:
+ * @max_num_dbs_scan_duty_cycle: max dbs can duty cycle value
  */
 typedef struct {
 	uint32_t num_vdevs;
@@ -5963,7 +5966,9 @@ typedef struct {
 	uint32_t VO_Minfree;
 	uint32_t rx_batchmode;
 	uint32_t tt_support;
-	uint32_t atf_config;
+	uint32_t atf_config:1,
+		 mgmt_comp_evt_bundle_support:1,
+		 tx_msdu_new_partition_id_support:1;
 	uint32_t iphdr_pad_config;
 	uint32_t
 		qwrap_config:16,
@@ -5987,6 +5992,7 @@ typedef struct {
 	uint32_t bpf_instruction_size;
 	uint32_t max_bssid_rx_filters;
 	uint32_t use_pdev_id;
+	uint32_t max_num_dbs_scan_duty_cycle;
 } target_resource_config;
 
 /**

+ 0 - 10
wmi/inc/wmi_unified_priv.h

@@ -680,19 +680,10 @@ QDF_STATUS (*send_process_fw_mem_dump_cmd)(wmi_unified_t wmi_handle,
 QDF_STATUS (*send_process_set_ie_info_cmd)(wmi_unified_t wmi_handle,
 				   struct vdev_ie_info_param *ie_info);
 
-#ifdef CONFIG_MCL
-QDF_STATUS (*send_init_cmd)(wmi_unified_t wmi_handle,
-		wmi_resource_config *res_cfg,
-		uint8_t num_mem_chunks, struct wmi_host_mem_chunk *mem_chunk,
-		bool action);
-#endif
-
 QDF_STATUS (*save_fw_version_cmd)(wmi_unified_t wmi_handle, void *evt_buf);
 
 QDF_STATUS (*check_and_update_fw_version_cmd)(wmi_unified_t wmi_hdl, void *ev);
 
-QDF_STATUS (*send_saved_init_cmd)(wmi_unified_t wmi_handle);
-
 QDF_STATUS (*send_set_base_macaddr_indicate_cmd)(wmi_unified_t wmi_handle,
 					 uint8_t *custom_addr);
 
@@ -1444,7 +1435,6 @@ struct wmi_unified {
 	int wmi_stop_in_progress;
 	struct wmi_host_abi_version fw_abi_version;
 	struct wmi_host_abi_version final_abi_vers;
-	struct wmi_cmd_init saved_wmi_init_cmd;
 	uint32_t num_of_diag_events_logs;
 	uint32_t *events_logs_list;
 #ifdef WLAN_OPEN_SOURCE

+ 0 - 45
wmi/src/wmi_unified_api.c

@@ -2755,51 +2755,6 @@ QDF_STATUS wmi_unified_process_set_ie_info_cmd(void *wmi_hdl,
 
 	return QDF_STATUS_E_FAILURE;
 }
-#ifdef CONFIG_MCL
-/**
- * wmi_unified_send_init_cmd() - wmi init command
- * @wmi_handle:      pointer to wmi handle
- * @res_cfg:         resource config
- * @num_mem_chunks:  no of mem chunck
- * @mem_chunk:       pointer to mem chunck structure
- *
- * This function sends IE information to firmware
- *
- * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
- *
- */
-QDF_STATUS wmi_unified_send_init_cmd(void *wmi_hdl,
-		wmi_resource_config *res_cfg,
-		uint8_t num_mem_chunks, struct wmi_host_mem_chunk *mem_chunk,
-		bool action)
-{
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
-	if (wmi_handle->ops->send_init_cmd)
-		return wmi_handle->ops->send_init_cmd(wmi_handle,
-			    res_cfg, num_mem_chunks, mem_chunk, action);
-
-	return QDF_STATUS_E_FAILURE;
-}
-#endif
-/**
- * wmi_unified_send_saved_init_cmd() - wmi init command
- * @wmi_handle:      pointer to wmi handle
- *
- * This function sends IE information to firmware
- *
- * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
- *
- */
-QDF_STATUS wmi_unified_send_saved_init_cmd(void *wmi_hdl)
-{
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
-	if (wmi_handle->ops->send_saved_init_cmd)
-		return wmi_handle->ops->send_saved_init_cmd(wmi_handle);
-
-	return QDF_STATUS_E_FAILURE;
-}
 
 /**
  * wmi_unified_save_fw_version_cmd() - save fw version

+ 10 - 131
wmi/src/wmi_unified_tlv.c

@@ -12459,9 +12459,17 @@ void wmi_copy_resource_config(wmi_resource_config *resource_cfg,
 	resource_cfg->bpf_instruction_size = tgt_res_cfg->bpf_instruction_size;
 	resource_cfg->max_bssid_rx_filters = tgt_res_cfg->max_bssid_rx_filters;
 	resource_cfg->use_pdev_id = tgt_res_cfg->use_pdev_id;
+	resource_cfg->max_num_dbs_scan_duty_cycle =
+		tgt_res_cfg->max_num_dbs_scan_duty_cycle;
 
-	WMI_RSRC_CFG_FLAG_ATF_CONFIG_ENABLE_SET(resource_cfg->flag1,
-						tgt_res_cfg->atf_config);
+	if (tgt_res_cfg->atf_config)
+		WMI_RSRC_CFG_FLAG_ATF_CONFIG_ENABLE_SET(resource_cfg->flag1, 1);
+	if (tgt_res_cfg->mgmt_comp_evt_bundle_support)
+		WMI_RSRC_CFG_FLAG_MGMT_COMP_EVT_BUNDLE_SUPPORT_SET(
+			resource_cfg->flag1, 1);
+	if (tgt_res_cfg->tx_msdu_new_partition_id_support)
+		WMI_RSRC_CFG_FLAG_TX_MSDU_ID_NEW_PARTITION_SUPPORT_SET(
+			resource_cfg->flag1, 1);
 }
 
 /* copy_hw_mode_id_in_init_cmd() - Helper routine to copy hw_mode in init cmd
@@ -12560,131 +12568,6 @@ static inline void copy_fw_abi_version_tlv(wmi_unified_t wmi_handle,
 			sizeof(wmi_abi_version));
 }
 
-#ifdef CONFIG_MCL
-/**
- * send_init_cmd_tlv() - wmi init command
- * @wmi_handle:      pointer to wmi handle
- * @res_cfg:         resource config
- * @num_mem_chunks:  no of mem chunck
- * @mem_chunk:       pointer to mem chunck structure
- *
- * This function sends IE information to firmware
- *
- * Return: QDF_STATUS_SUCCESS for success otherwise failure
- *
- */
-static QDF_STATUS send_init_cmd_tlv(wmi_unified_t wmi_handle,
-		wmi_resource_config *tgt_res_cfg,
-		uint8_t num_mem_chunks, struct wmi_host_mem_chunk *mem_chunks,
-		bool action)
-{
-	wmi_buf_t buf;
-	wmi_init_cmd_fixed_param *cmd;
-	uint8_t *buf_ptr;
-	wmi_resource_config *resource_cfg;
-	wlan_host_memory_chunk *host_mem_chunks;
-	uint32_t mem_chunk_len = 0;
-	uint16_t idx;
-	int len;
-	int ret;
-
-	len = sizeof(*cmd) + sizeof(wmi_resource_config) + WMI_TLV_HDR_SIZE;
-	mem_chunk_len = (sizeof(wlan_host_memory_chunk) * MAX_MEM_CHUNKS);
-	buf = wmi_buf_alloc(wmi_handle, len + mem_chunk_len);
-	if (!buf) {
-		WMI_LOGD("%s: wmi_buf_alloc failed\n", __func__);
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	buf_ptr = (uint8_t *) wmi_buf_data(buf);
-	cmd = (wmi_init_cmd_fixed_param *) buf_ptr;
-	resource_cfg = (wmi_resource_config *) (buf_ptr + sizeof(*cmd));
-
-	host_mem_chunks = (wlan_host_memory_chunk *)
-		(buf_ptr + sizeof(*cmd) + sizeof(wmi_resource_config)
-		 + WMI_TLV_HDR_SIZE);
-
-	WMITLV_SET_HDR(&cmd->tlv_header,
-			WMITLV_TAG_STRUC_wmi_init_cmd_fixed_param,
-			WMITLV_GET_STRUCT_TLVLEN(wmi_init_cmd_fixed_param));
-
-	qdf_mem_copy(resource_cfg, tgt_res_cfg, sizeof(wmi_resource_config));
-	WMITLV_SET_HDR(&resource_cfg->tlv_header,
-			WMITLV_TAG_STRUC_wmi_resource_config,
-			WMITLV_GET_STRUCT_TLVLEN(wmi_resource_config));
-
-	for (idx = 0; idx < num_mem_chunks; ++idx) {
-		WMITLV_SET_HDR(&(host_mem_chunks[idx].tlv_header),
-				WMITLV_TAG_STRUC_wlan_host_memory_chunk,
-				WMITLV_GET_STRUCT_TLVLEN
-				(wlan_host_memory_chunk));
-		host_mem_chunks[idx].ptr = mem_chunks[idx].paddr;
-		host_mem_chunks[idx].size = mem_chunks[idx].len;
-		host_mem_chunks[idx].req_id = mem_chunks[idx].req_id;
-		WMI_LOGD("chunk %d len %d requested ,ptr  0x%x ",
-				idx, host_mem_chunks[idx].size,
-				host_mem_chunks[idx].ptr);
-	}
-	cmd->num_host_mem_chunks = num_mem_chunks;
-	len += (num_mem_chunks * sizeof(wlan_host_memory_chunk));
-	WMITLV_SET_HDR((buf_ptr + sizeof(*cmd) + sizeof(wmi_resource_config)),
-			WMITLV_TAG_ARRAY_STRUC,
-			(sizeof(wlan_host_memory_chunk) *
-			 num_mem_chunks));
-
-	/* Fill fw_abi_vers */
-	copy_fw_abi_version_tlv(wmi_handle, cmd);
-
-	if (action) {
-		ret = wmi_unified_cmd_send(wmi_handle, buf, len,
-				 WMI_INIT_CMDID);
-		if (ret) {
-			WMI_LOGE(FL("Failed to send set WMI INIT command ret = %d"), ret);
-			wmi_buf_free(buf);
-			return QDF_STATUS_E_FAILURE;
-		}
-	} else {
-		wmi_handle->saved_wmi_init_cmd.buf = buf;
-		wmi_handle->saved_wmi_init_cmd.buf_len = len;
-	}
-
-	return QDF_STATUS_SUCCESS;
-
-}
-#endif
-/**
- * send_saved_init_cmd_tlv() - wmi init command
- * @wmi_handle:      pointer to wmi handle
- *
- * This function sends IE information to firmware
- *
- * Return: QDF_STATUS_SUCCESS for success otherwise failure
- *
- */
-static QDF_STATUS send_saved_init_cmd_tlv(wmi_unified_t wmi_handle)
-{
-	int status;
-
-	if (!wmi_handle->saved_wmi_init_cmd.buf ||
-			!wmi_handle->saved_wmi_init_cmd.buf_len) {
-		WMI_LOGP("Service ready ext event w/o WMI_SERVICE_EXT_MSG!");
-		return QDF_STATUS_E_FAILURE;
-	}
-	status = wmi_unified_cmd_send(wmi_handle,
-				wmi_handle->saved_wmi_init_cmd.buf,
-				wmi_handle->saved_wmi_init_cmd.buf_len,
-				WMI_INIT_CMDID);
-	if (status) {
-		WMI_LOGE(FL("Failed to send set WMI INIT command ret = %d"), status);
-		wmi_buf_free(wmi_handle->saved_wmi_init_cmd.buf);
-		return QDF_STATUS_E_FAILURE;
-	}
-	wmi_handle->saved_wmi_init_cmd.buf = NULL;
-	wmi_handle->saved_wmi_init_cmd.buf_len = 0;
-
-	return QDF_STATUS_SUCCESS;
-}
-
 static QDF_STATUS save_fw_version_cmd_tlv(wmi_unified_t wmi_handle, void *evt_buf)
 {
 	WMI_SERVICE_READY_EVENTID_param_tlvs *param_buf;
@@ -19809,13 +19692,9 @@ struct wmi_ops tlv_ops =  {
 	.send_update_tdls_peer_state_cmd = send_update_tdls_peer_state_cmd_tlv,
 	.send_process_fw_mem_dump_cmd = send_process_fw_mem_dump_cmd_tlv,
 	.send_process_set_ie_info_cmd = send_process_set_ie_info_cmd_tlv,
-#ifdef CONFIG_MCL
-	.send_init_cmd = send_init_cmd_tlv,
-#endif
 	.save_fw_version_cmd = save_fw_version_cmd_tlv,
 	.check_and_update_fw_version =
 		 check_and_update_fw_version_cmd_tlv,
-	.send_saved_init_cmd = send_saved_init_cmd_tlv,
 	.send_set_base_macaddr_indicate_cmd =
 		 send_set_base_macaddr_indicate_cmd_tlv,
 	.send_log_supported_evt_cmd = send_log_supported_evt_cmd_tlv,