Jelajahi Sumber

qcacld-3.0: Remove wma target_if F/W event handler from wma

target_if F/W event handler is moved from wma to cmn part per
MCL/WIN converge requirement.

Change-Id: I583059190827c9aed8d8089412a4cfac92ddf4c9
CRs-Fixed: 2554859
Jianmin Zhu 5 tahun lalu
induk
melakukan
dc76e63f0f

+ 0 - 1
core/mac/src/include/sir_params.h

@@ -505,7 +505,6 @@ struct sir_cfg_action_frm_tb_ppdu {
 #define SIR_HAL_SET_DHCP_SERVER_OFFLOAD      (SIR_HAL_ITC_MSG_TYPES_BEGIN + 222)
 #define SIR_HAL_SET_DHCP_SERVER_OFFLOAD      (SIR_HAL_ITC_MSG_TYPES_BEGIN + 222)
 #endif /* DHCP_SERVER_OFFLOAD */
 #endif /* DHCP_SERVER_OFFLOAD */
 #define SIR_HAL_LED_FLASHING_REQ             (SIR_HAL_ITC_MSG_TYPES_BEGIN + 223)
 #define SIR_HAL_LED_FLASHING_REQ             (SIR_HAL_ITC_MSG_TYPES_BEGIN + 223)
-#define SIR_HAL_PROCESS_FW_EVENT             (SIR_HAL_ITC_MSG_TYPES_BEGIN + 224)
 
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 #define SIR_HAL_ROAM_OFFLOAD_SYNCH_IND       (SIR_HAL_ITC_MSG_TYPES_BEGIN + 225)
 #define SIR_HAL_ROAM_OFFLOAD_SYNCH_IND       (SIR_HAL_ITC_MSG_TYPES_BEGIN + 225)

+ 0 - 1
core/mac/src/sys/legacy/src/utils/src/mac_trace.c

@@ -613,7 +613,6 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
 #ifdef WLAN_FEATURE_GPIO_LED_FLASHING
 #ifdef WLAN_FEATURE_GPIO_LED_FLASHING
 		CASE_RETURN_STRING(WMA_LED_FLASHING_REQ);
 		CASE_RETURN_STRING(WMA_LED_FLASHING_REQ);
 #endif
 #endif
-		CASE_RETURN_STRING(WMA_PROCESS_FW_EVENT);
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
 		CASE_RETURN_STRING(WMA_UPDATE_Q2Q_IE_IND);
 		CASE_RETURN_STRING(WMA_UPDATE_Q2Q_IE_IND);
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */

+ 0 - 25
core/wma/inc/wma.h

@@ -990,8 +990,6 @@ struct wma_wlm_stats_data {
  * @dynamic_nss_chains_update: per vdev nss, chains update
  * @dynamic_nss_chains_update: per vdev nss, chains update
  * @ito_repeat_count: Indicates ito repeated count
  * @ito_repeat_count: Indicates ito repeated count
  * @wma_fw_time_sync_timer: timer used for firmware time sync
  * @wma_fw_time_sync_timer: timer used for firmware time sync
- * @critical_events_in_flight: number of suspend-preventing events
- *   in flight
  * * @fw_therm_throt_support: FW Supports thermal throttling?
  * * @fw_therm_throt_support: FW Supports thermal throttling?
  *
  *
  * This structure is the global wma context.  It contains global wma
  * This structure is the global wma context.  It contains global wma
@@ -1126,7 +1124,6 @@ typedef struct {
 	bool dynamic_nss_chains_support;
 	bool dynamic_nss_chains_support;
 	uint8_t  ito_repeat_count;
 	uint8_t  ito_repeat_count;
 	qdf_mc_timer_t wma_fw_time_sync_timer;
 	qdf_mc_timer_t wma_fw_time_sync_timer;
-	qdf_atomic_t critical_events_in_flight;
 	bool fw_therm_throt_support;
 	bool fw_therm_throt_support;
 	bool enable_tx_compl_tsf64;
 	bool enable_tx_compl_tsf64;
 } t_wma_handle, *tp_wma_handle;
 } t_wma_handle, *tp_wma_handle;
@@ -1524,28 +1521,6 @@ struct wma_roam_invoke_cmd {
 	bool forced_roaming;
 	bool forced_roaming;
 };
 };
 
 
-/**
- * struct wma_process_fw_event_params - fw event parameters
- * @wmi_handle: wmi handle
- * @evt_buf: event buffer
- */
-typedef struct {
-	void *wmi_handle;
-	void *evt_buf;
-} wma_process_fw_event_params;
-
-/**
- * wma_process_fw_event_handler() - common event handler to serialize
- *                                  event processing through mc_thread
- * @scn_handle: scn handle
- * @ev: event buffer
- * @rx_ctx: rx execution context
- *
- * Return: 0 on success, errno on failure
- */
-int wma_process_fw_event_handler(ol_scn_t scn_handle, void *ev,
-				 uint8_t rx_ctx);
-
 A_UINT32 e_csr_auth_type_to_rsn_authmode(enum csr_akm_type authtype,
 A_UINT32 e_csr_auth_type_to_rsn_authmode(enum csr_akm_type authtype,
 					 eCsrEncryptionType encr);
 					 eCsrEncryptionType encr);
 A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
 A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);

+ 0 - 3
core/wma/inc/wma_types.h

@@ -379,9 +379,6 @@
 #define WMA_LED_FLASHING_REQ   SIR_HAL_LED_FLASHING_REQ
 #define WMA_LED_FLASHING_REQ   SIR_HAL_LED_FLASHING_REQ
 #endif
 #endif
 
 
-/* Message posted by wmi when wmi event is received from FW */
-#define WMA_PROCESS_FW_EVENT		     SIR_HAL_PROCESS_FW_EVENT
-
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
 #define WMA_UPDATE_Q2Q_IE_IND                 SIR_HAL_UPDATE_Q2Q_IE_IND
 #define WMA_UPDATE_Q2Q_IE_IND                 SIR_HAL_UPDATE_Q2Q_IE_IND
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */

+ 1 - 168
core/wma/src/wma_main.c

@@ -1570,57 +1570,6 @@ uint32_t wma_critical_events_in_flight(void)
 	return wmi_critical_events_in_flight(wma->wmi_handle);
 	return wmi_critical_events_in_flight(wma->wmi_handle);
 }
 }
 
 
-static bool wma_event_is_critical(uint32_t event_id)
-{
-	switch (event_id) {
-	case WMI_ROAM_SYNCH_EVENTID:
-		return true;
-	default:
-		return false;
-	}
-}
-
-/**
- * wma_process_fw_event() - process any fw event
- * @wma: wma handle
- * @buf: fw event buffer
- *
- * This function process any fw event to serialize it through mc thread.
- *
- * Return: none
- */
-static int wma_process_fw_event(tp_wma_handle wma,
-				wma_process_fw_event_params *buf)
-{
-	struct wmi_unified *wmi_handle = (struct wmi_unified *)buf->wmi_handle;
-	uint32_t event_id = WMI_GET_FIELD(qdf_nbuf_data(buf->evt_buf),
-					  WMI_CMD_HDR, COMMANDID);
-
-	wmi_process_fw_event(wmi_handle, buf->evt_buf);
-
-	if (wma_event_is_critical(event_id))
-		qdf_atomic_dec(&wma->critical_events_in_flight);
-
-	return 0;
-}
-
-/**
- * wmi_process_fw_event_tasklet_ctx() - process in tasklet context
- * @ctx: handle to wmi
- * @ev: wmi event buffer
- *
- * Event process by below function will be in tasket context,
- * need to use this method only for time sensitive functions.
- *
- * Return: none
- */
-static int wma_process_fw_event_tasklet_ctx(void *ctx, void *ev)
-{
-	wmi_process_fw_event(ctx, ev);
-
-	return 0;
-}
-
 /**
 /**
  * wma_process_hal_pwr_dbg_cmd() - send hal pwr dbg cmd to fw.
  * wma_process_hal_pwr_dbg_cmd() - send hal pwr dbg cmd to fw.
  * @handle: wma handle
  * @handle: wma handle
@@ -1661,13 +1610,6 @@ static void wma_discard_fw_event(struct scheduler_msg *msg)
 	if (!msg->bodyptr)
 	if (!msg->bodyptr)
 		return;
 		return;
 
 
-	switch (msg->type) {
-	case WMA_PROCESS_FW_EVENT:
-		qdf_nbuf_free(((wma_process_fw_event_params *)msg->bodyptr)
-				->evt_buf);
-		break;
-	}
-
 	qdf_mem_free(msg->bodyptr);
 	qdf_mem_free(msg->bodyptr);
 	msg->bodyptr = NULL;
 	msg->bodyptr = NULL;
 	msg->bodyval = 0;
 	msg->bodyval = 0;
@@ -1721,101 +1663,6 @@ wma_vdev_nss_chain_params_send(uint8_t vdev_id,
 						      &vdev_user_cfg);
 						      &vdev_user_cfg);
 }
 }
 
 
-/**
- * wma_process_fw_event_handler() - common event handler to serialize
- *                                  event processing through mc_thread
- * @ctx: wmi context
- * @ev: event buffer
- * @rx_ctx: rx execution context
- *
- * Return: 0 on success, errno on failure
- */
-static int wma_process_fw_event_mc_thread_ctx(void *ctx, void *ev)
-{
-	wma_process_fw_event_params *params_buf;
-	struct scheduler_msg cds_msg = { 0 };
-	tp_wma_handle wma;
-	uint32_t event_id;
-
-	params_buf = qdf_mem_malloc(sizeof(wma_process_fw_event_params));
-	if (!params_buf) {
-		qdf_nbuf_free(ev);
-		return -ENOMEM;
-	}
-
-	params_buf->wmi_handle = (struct wmi_unified *)ctx;
-	params_buf->evt_buf = ev;
-
-	wma = cds_get_context(QDF_MODULE_ID_WMA);
-	event_id = WMI_GET_FIELD(qdf_nbuf_data(params_buf->evt_buf),
-				 WMI_CMD_HDR, COMMANDID);
-	if (wma && wma_event_is_critical(event_id))
-		qdf_atomic_inc(&wma->critical_events_in_flight);
-
-	cds_msg.type = WMA_PROCESS_FW_EVENT;
-	cds_msg.bodyptr = params_buf;
-	cds_msg.bodyval = 0;
-	cds_msg.flush_callback = wma_discard_fw_event;
-
-	if (QDF_STATUS_SUCCESS !=
-		scheduler_post_message(QDF_MODULE_ID_WMA,
-				       QDF_MODULE_ID_WMA,
-				       QDF_MODULE_ID_WMA, &cds_msg)) {
-		qdf_nbuf_free(ev);
-		qdf_mem_free(params_buf);
-		return -EFAULT;
-	}
-	return 0;
-
-}
-
-int wma_process_fw_event_handler(ol_scn_t scn_handle, void *evt_buf,
-				 uint8_t rx_ctx)
-{
-	int err = 0;
-	struct wmi_unified *wmi_handle;
-	struct wlan_objmgr_psoc *psoc;
-	struct target_psoc_info *tgt_hdl;
-	bool is_wmi_ready = false;
-
-	psoc = target_if_get_psoc_from_scn_hdl(scn_handle);
-	if (!psoc) {
-		WMA_LOGE("psoc is null");
-		return err;
-	}
-
-	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
-	if (!wmi_handle) {
-		WMA_LOGE("wmi_handle is null");
-		return err;
-	}
-
-	tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
-	if (!tgt_hdl) {
-		WMA_LOGE("target_psoc_info is null");
-		return err;
-	}
-
-	is_wmi_ready = target_psoc_get_wmi_ready(tgt_hdl);
-	if (!is_wmi_ready) {
-		WMA_LOGD("fw event recvd before ready event processed");
-		WMA_LOGD("therefore use worker thread");
-		wmi_process_fw_event_worker_thread_ctx(wmi_handle, evt_buf);
-		return err;
-	}
-
-	if (rx_ctx == WMA_RX_SERIALIZER_CTX) {
-		err = wma_process_fw_event_mc_thread_ctx(wmi_handle, evt_buf);
-	} else if (rx_ctx == WMA_RX_TASKLET_CTX) {
-		wma_process_fw_event_tasklet_ctx(wmi_handle, evt_buf);
-	} else {
-		WMA_LOGE("%s: invalid wmi event execution context", __func__);
-		qdf_nbuf_free(evt_buf);
-	}
-
-	return err;
-}
-
 /**
 /**
  * wma_antenna_isolation_event_handler() - antenna isolation event handler
  * wma_antenna_isolation_event_handler() - antenna isolation event handler
  * @handle: wma handle
  * @handle: wma handle
@@ -3188,21 +3035,17 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
 	 * Allocate locally used params with its rx_ops member,
 	 * Allocate locally used params with its rx_ops member,
 	 * and free it immediately after used.
 	 * and free it immediately after used.
 	 */
 	 */
-	params = qdf_mem_malloc(sizeof(*params) + sizeof(struct wmi_rx_ops));
+	params = qdf_mem_malloc(sizeof(*params));
 	if (!params) {
 	if (!params) {
 		qdf_status = QDF_STATUS_E_NOMEM;
 		qdf_status = QDF_STATUS_E_NOMEM;
 		goto err_wma_handle;
 		goto err_wma_handle;
 	}
 	}
 
 
-	params->rx_ops = (struct wmi_rx_ops *)(params + 1);
 	params->osdev = NULL;
 	params->osdev = NULL;
 	params->target_type = WMI_TLV_TARGET;
 	params->target_type = WMI_TLV_TARGET;
 	params->use_cookie = false;
 	params->use_cookie = false;
 	params->psoc = psoc;
 	params->psoc = psoc;
 	params->max_commands = WMI_MAX_CMDS;
 	params->max_commands = WMI_MAX_CMDS;
-	/* Attach mc_thread context processing function */
-	params->rx_ops->wma_process_fw_event_handler_cbk =
-						wma_process_fw_event_handler;
 
 
 	/* initialize tlv attach */
 	/* initialize tlv attach */
 	wmi_tlv_init();
 	wmi_tlv_init();
@@ -8433,16 +8276,6 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
 	}
 	}
 
 
 	switch (msg->type) {
 	switch (msg->type) {
-
-	/* Message posted by wmi for all control path related
-	 * FW events to serialize through mc_thread.
-	 */
-	case WMA_PROCESS_FW_EVENT:
-		wma_process_fw_event(wma_handle,
-				(wma_process_fw_event_params *) msg->bodyptr);
-		qdf_mem_free(msg->bodyptr);
-		break;
-
 #ifdef FEATURE_WLAN_ESE
 #ifdef FEATURE_WLAN_ESE
 	case WMA_TSM_STATS_REQ:
 	case WMA_TSM_STATS_REQ:
 		WMA_LOGD("McThread: WMA_TSM_STATS_REQ");
 		WMA_LOGD("McThread: WMA_TSM_STATS_REQ");