Browse Source

qcacld-3.0: Change return type to QDF_STATUS

Change return type of following APIs from int to QDF_STATUS.
wmi_unified_register_event()
wmi_unified_register_event_handler()
wmi_unified_register_raw_event_handler()
wmi_unified_unregister_event()
wmi_unified_unregister_event_handler()

Change-Id: I534b499edbcfec6eddea0e9ed48f9eb1a2e872c8
CRs-Fixed: 2791275
Gururaj Pandurangi 4 years ago
parent
commit
02b2ffc7d1

+ 7 - 7
components/target_if/cp_stats/src/target_if_mc_cp_stats.c

@@ -269,7 +269,7 @@ target_if_twt_session_params_unregister_evt_hdlr(struct wlan_objmgr_psoc *psoc)
 static QDF_STATUS
 target_if_twt_session_params_register_evt_hdlr(struct wlan_objmgr_psoc *psoc)
 {
-	int ret_val;
+	QDF_STATUS ret_val;
 	struct wmi_unified *wmi_handle;
 
 	if (!psoc) {
@@ -289,10 +289,10 @@ target_if_twt_session_params_register_evt_hdlr(struct wlan_objmgr_psoc *psoc)
 			target_if_twt_session_params_event_handler,
 			WMI_RX_WORK_CTX);
 
-	if (ret_val)
+	if (QDF_IS_STATUS_ERROR(ret_val))
 		target_if_err("Failed to register twt session stats event cb");
 
-	return qdf_status_from_os_return(ret_val);
+	return ret_val;
 }
 #else
 static QDF_STATUS
@@ -1076,7 +1076,7 @@ static void target_if_cp_stats_inc_wake_lock_stats(uint32_t reason,
 static QDF_STATUS
 target_if_cp_stats_register_event_handler(struct wlan_objmgr_psoc *psoc)
 {
-	int ret_val;
+	QDF_STATUS ret_val;
 	struct wmi_unified *wmi_handle;
 
 	if (!psoc) {
@@ -1095,17 +1095,17 @@ target_if_cp_stats_register_event_handler(struct wlan_objmgr_psoc *psoc)
 			wmi_update_stats_event_id,
 			target_if_mc_cp_stats_stats_event_handler,
 			WMI_RX_WORK_CTX);
-	if (ret_val)
+	if (QDF_IS_STATUS_ERROR(ret_val))
 		cp_stats_err("Failed to register stats event cb");
 
 	ret_val = wmi_unified_register_event_handler(wmi_handle,
 			    wmi_peer_stats_info_event_id,
 			    target_if_mc_cp_stats_peer_stats_info_event_handler,
 			    WMI_RX_WORK_CTX);
-	if (ret_val)
+	if (QDF_IS_STATUS_ERROR(ret_val))
 		cp_stats_err("Failed to register peer stats info event cb");
 
-	return qdf_status_from_os_return(ret_val);
+	return ret_val;
 }
 
 static QDF_STATUS

+ 1 - 1
components/target_if/disa/src/target_if_disa.c

@@ -78,7 +78,7 @@ target_if_disa_register_ev_handlers(struct wlan_objmgr_psoc *psoc)
 	status = wmi_unified_register_event(wmi_handle,
 				wmi_vdev_encrypt_decrypt_data_rsp_event_id,
 				target_if_encrypt_decrypt_event_handler);
-	if (status) {
+	if (QDF_IS_STATUS_ERROR(status)) {
 		target_if_err("Failed to register Scan match event cb");
 		return QDF_STATUS_E_FAILURE;
 	}

+ 5 - 5
components/target_if/ftm_time_sync/src/target_if_ftm_time_sync.c

@@ -168,7 +168,7 @@ target_if_ftm_time_sync_master_slave_offset(struct wlan_objmgr_psoc *psoc)
 			wmi_wlan_time_sync_q_master_slave_offset_eventid,
 			target_if_time_sync_master_slave_offset_event_handler,
 			WMI_RX_SERIALIZER_CTX);
-	if (status) {
+	if (QDF_IS_STATUS_ERROR(status)) {
 		target_if_err("Ftm time_sync offset event register failed");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -180,7 +180,7 @@ QDF_STATUS
 target_if_ftm_time_sync_unregister_ev_handlers(struct wlan_objmgr_psoc *psoc)
 {
 	wmi_unified_t wmi_handle;
-	int ret, status = 0;
+	QDF_STATUS ret, status = QDF_STATUS_SUCCESS;
 
 	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
 	if (!wmi_handle) {
@@ -191,7 +191,7 @@ target_if_ftm_time_sync_unregister_ev_handlers(struct wlan_objmgr_psoc *psoc)
 	ret = wmi_unified_unregister_event(
 				wmi_handle,
 				wmi_wlan_time_sync_ftm_start_stop_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("failed to unregister time sync start/stop evt");
 		status = ret;
 	}
@@ -199,12 +199,12 @@ target_if_ftm_time_sync_unregister_ev_handlers(struct wlan_objmgr_psoc *psoc)
 	ret = wmi_unified_unregister_event(
 			wmi_handle,
 			wmi_wlan_time_sync_q_master_slave_offset_eventid);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("failed to unregister time sync offset evt");
 		status = ret;
 	}
 
-	if (status)
+	if (QDF_IS_STATUS_ERROR(status))
 		return QDF_STATUS_E_FAILURE;
 	else
 		return QDF_STATUS_SUCCESS;

+ 4 - 4
components/target_if/fw_offload/src/target_if_fwol.c

@@ -154,12 +154,12 @@ static void
 target_if_fwol_register_elna_event_handler(struct wlan_objmgr_psoc *psoc,
 					   void *arg)
 {
-	int rc;
+	QDF_STATUS rc;
 
 	rc = wmi_unified_register_event(get_wmi_unified_hdl_from_psoc(psoc),
 					wmi_get_elna_bypass_event_id,
 					target_if_fwol_get_elna_bypass_resp);
-	if (rc)
+	if (QDF_IS_STATUS_ERROR(rc))
 		target_if_debug("Failed to register get eLNA bypass event cb");
 }
 
@@ -167,12 +167,12 @@ static void
 target_if_fwol_unregister_elna_event_handler(struct wlan_objmgr_psoc *psoc,
 					     void *arg)
 {
-	int rc;
+	QDF_STATUS rc;
 
 	rc = wmi_unified_unregister_event_handler(
 					    get_wmi_unified_hdl_from_psoc(psoc),
 					    wmi_get_elna_bypass_event_id);
-	if (rc)
+	if (QDF_IS_STATUS_ERROR(rc))
 		target_if_debug("Failed to unregister get eLNA bypass event cb");
 }
 

+ 3 - 3
components/target_if/interop_issues_ap/src/target_if_interop_issues_ap.c

@@ -84,7 +84,7 @@ QDF_STATUS
 target_if_interop_issues_ap_register_event_handler(
 						struct wlan_objmgr_psoc *psoc)
 {
-	int ret_val;
+	QDF_STATUS ret_val;
 	struct wmi_unified *wmi_handle;
 
 	if (!psoc) {
@@ -102,10 +102,10 @@ target_if_interop_issues_ap_register_event_handler(
 				wmi_pdev_interop_issues_ap_event_id,
 				target_if_interop_issues_ap_event_handler,
 				WMI_RX_WORK_CTX);
-	if (ret_val)
+	if (QDF_IS_STATUS_ERROR(ret_val))
 		target_if_err("Failed to register event cb");
 
-	return qdf_status_from_os_return(ret_val);
+	return ret_val;
 }
 
 /**

+ 22 - 22
components/target_if/nan/src/target_if_nan.c

@@ -966,7 +966,7 @@ int target_if_nan_rsp_handler(ol_scn_t scn, uint8_t *data, uint32_t len)
 
 QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 {
-	int ret;
+	QDF_STATUS ret;
 	wmi_unified_t handle = get_wmi_unified_hdl_from_psoc(psoc);
 
 	if (!handle) {
@@ -978,7 +978,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 	ret = wmi_unified_register_event_handler(handle, wmi_nan_event_id,
 						 target_if_nan_rsp_handler,
 						 WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -987,7 +987,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 		wmi_ndp_initiator_rsp_event_id,
 		target_if_ndp_initiator_rsp_handler,
 		WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -995,7 +995,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 	ret = wmi_unified_register_event_handler(handle, wmi_nan_dmesg_event_id,
 						 target_if_nan_dmesg_handler,
 						 WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		target_if_nan_deregister_events(psoc);
 		return QDF_STATUS_E_FAILURE;
@@ -1005,7 +1005,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 		wmi_ndp_indication_event_id,
 		target_if_ndp_ind_handler,
 		WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		target_if_nan_deregister_events(psoc);
 		return QDF_STATUS_E_FAILURE;
@@ -1015,7 +1015,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 		wmi_ndp_confirm_event_id,
 		target_if_ndp_confirm_handler,
 		WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		target_if_nan_deregister_events(psoc);
 		return QDF_STATUS_E_FAILURE;
@@ -1025,7 +1025,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 		wmi_ndp_responder_rsp_event_id,
 		target_if_ndp_responder_rsp_handler,
 		WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		target_if_nan_deregister_events(psoc);
 		return QDF_STATUS_E_FAILURE;
@@ -1035,7 +1035,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 		wmi_ndp_end_indication_event_id,
 		target_if_ndp_end_ind_handler,
 		WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		target_if_nan_deregister_events(psoc);
 		return QDF_STATUS_E_FAILURE;
@@ -1045,7 +1045,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 		wmi_ndp_end_rsp_event_id,
 		target_if_ndp_end_rsp_handler,
 		WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		target_if_nan_deregister_events(psoc);
 		return QDF_STATUS_E_FAILURE;
@@ -1055,7 +1055,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 		wmi_ndl_schedule_update_event_id,
 		target_if_ndp_sch_update_handler,
 		WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		target_if_nan_deregister_events(psoc);
 		return QDF_STATUS_E_FAILURE;
@@ -1064,7 +1064,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 	ret = wmi_unified_register_event_handler(handle, wmi_ndp_event_id,
 					       target_if_ndp_host_event_handler,
 					       WMI_RX_UMAC_CTX);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event registration failed, ret: %d", ret);
 		target_if_nan_deregister_events(psoc);
 		return QDF_STATUS_E_FAILURE;
@@ -1075,7 +1075,7 @@ QDF_STATUS target_if_nan_register_events(struct wlan_objmgr_psoc *psoc)
 
 QDF_STATUS target_if_nan_deregister_events(struct wlan_objmgr_psoc *psoc)
 {
-	int ret, status = 0;
+	QDF_STATUS ret, status = QDF_STATUS_SUCCESS;
 	wmi_unified_t handle = get_wmi_unified_hdl_from_psoc(psoc);
 
 	if (!handle) {
@@ -1084,67 +1084,67 @@ QDF_STATUS target_if_nan_deregister_events(struct wlan_objmgr_psoc *psoc)
 	}
 	ret = wmi_unified_unregister_event_handler(handle,
 				wmi_ndl_schedule_update_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event deregistration failed, ret: %d", ret);
 		status = ret;
 	}
 
 	ret = wmi_unified_unregister_event_handler(handle,
 				wmi_ndp_end_rsp_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event deregistration failed, ret: %d", ret);
 		status = ret;
 	}
 
 	ret = wmi_unified_unregister_event_handler(handle,
 				wmi_ndp_end_indication_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event deregistration failed, ret: %d", ret);
 		status = ret;
 	}
 
 	ret = wmi_unified_unregister_event_handler(handle,
 				wmi_ndp_responder_rsp_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event deregistration failed, ret: %d", ret);
 		status = ret;
 	}
 
 	ret = wmi_unified_unregister_event_handler(handle,
 				wmi_ndp_confirm_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event deregistration failed, ret: %d", ret);
 		status = ret;
 	}
 
 	ret = wmi_unified_unregister_event_handler(handle,
 				wmi_ndp_indication_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event deregistration failed, ret: %d", ret);
 		status = ret;
 	}
 
 	ret = wmi_unified_unregister_event_handler(handle,
 						   wmi_nan_dmesg_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event deregistration failed, ret: %d", ret);
 		status = ret;
 	}
 
 	ret = wmi_unified_unregister_event_handler(handle,
 				wmi_ndp_initiator_rsp_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event deregistration failed, ret: %d", ret);
 		status = ret;
 	}
 
 	ret = wmi_unified_unregister_event_handler(handle, wmi_ndp_event_id);
-	if (ret) {
+	if (QDF_IS_STATUS_ERROR(ret)) {
 		target_if_err("wmi event deregistration failed, ret: %d", ret);
 		status = ret;
 	}
 
-	if (status)
+	if (QDF_IS_STATUS_ERROR(status))
 		return QDF_STATUS_E_FAILURE;
 	else
 		return QDF_STATUS_SUCCESS;

+ 17 - 12
components/target_if/ocb/src/target_if_ocb.c

@@ -574,13 +574,13 @@ exit:
 QDF_STATUS target_if_ocb_register_event_handler(struct wlan_objmgr_psoc *psoc,
 						void *arg)
 {
-	int rc;
+	QDF_STATUS rc;
 
 	/* Initialize the members in WMA used by wma_ocb */
 	rc = wmi_unified_register_event(get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_ocb_set_config_resp_event_id,
 			target_if_ocb_set_config_resp);
-	if (rc) {
+	if (QDF_IS_STATUS_ERROR(rc)) {
 		target_if_err("Failed to register OCB config resp event cb");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -589,7 +589,7 @@ QDF_STATUS target_if_ocb_register_event_handler(struct wlan_objmgr_psoc *psoc,
 			get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_ocb_get_tsf_timer_resp_event_id,
 			target_if_ocb_get_tsf_timer_resp);
-	if (rc) {
+	if (QDF_IS_STATUS_ERROR(rc)) {
 		target_if_err("Failed to register OCB TSF resp event cb");
 		goto unreg_set_config;
 	}
@@ -598,7 +598,7 @@ QDF_STATUS target_if_ocb_register_event_handler(struct wlan_objmgr_psoc *psoc,
 			get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_dcc_get_stats_resp_event_id,
 			target_if_dcc_get_stats_resp);
-	if (rc) {
+	if (QDF_IS_STATUS_ERROR(rc)) {
 		target_if_err("Failed to register DCC get stats resp event cb");
 		goto unreg_tsf_timer;
 	}
@@ -607,7 +607,7 @@ QDF_STATUS target_if_ocb_register_event_handler(struct wlan_objmgr_psoc *psoc,
 			get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_dcc_update_ndl_resp_event_id,
 			target_if_dcc_update_ndl_resp);
-	if (rc) {
+	if (QDF_IS_STATUS_ERROR(rc)) {
 		target_if_err("Failed to register NDL update event cb");
 		goto unreg_get_stats;
 	}
@@ -615,7 +615,7 @@ QDF_STATUS target_if_ocb_register_event_handler(struct wlan_objmgr_psoc *psoc,
 	rc = wmi_unified_register_event(get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_dcc_stats_event_id,
 			target_if_dcc_stats_resp);
-	if (rc) {
+	if (QDF_IS_STATUS_ERROR(rc)) {
 		target_if_err("Failed to register DCC stats event cb");
 		goto unreg_ndl;
 	}
@@ -645,35 +645,40 @@ QDF_STATUS
 target_if_ocb_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
 				       void *arg)
 {
-	int rc;
+	QDF_STATUS rc;
 
 	rc = wmi_unified_unregister_event_handler(
 			get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_dcc_stats_event_id);
-	if (rc)
+
+	if (QDF_IS_STATUS_ERROR(rc))
 		target_if_err("Failed to unregister DCC stats event cb");
 
 	rc = wmi_unified_unregister_event_handler(
 			get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_dcc_update_ndl_resp_event_id);
-	if (rc)
+
+	if (QDF_IS_STATUS_ERROR(rc))
 		target_if_err("Failed to unregister NDL update event cb");
 
 	rc = wmi_unified_unregister_event_handler(
 			get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_dcc_get_stats_resp_event_id);
-	if (rc)
+
+	if (QDF_IS_STATUS_ERROR(rc))
 		target_if_err("Failed to unregister DCC get stats resp cb");
 
 	rc = wmi_unified_unregister_event_handler(
 			get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_ocb_get_tsf_timer_resp_event_id);
-	if (rc)
+
+	if (QDF_IS_STATUS_ERROR(rc))
 		target_if_err("Failed to unregister OCB TSF resp event cb");
 
 	rc = wmi_unified_unregister_event(get_wmi_unified_hdl_from_psoc(psoc),
 			wmi_ocb_set_config_resp_event_id);
-	if (rc)
+
+	if (QDF_IS_STATUS_ERROR(rc))
 		target_if_err("Failed to unregister OCB config resp event cb");
 
 	return QDF_STATUS_SUCCESS;

+ 15 - 6
components/target_if/p2p/src/target_if_p2p.c

@@ -111,7 +111,7 @@ static int target_p2p_lo_event_handler(ol_scn_t scn, uint8_t *data,
 QDF_STATUS target_if_p2p_register_lo_event_handler(
 	struct wlan_objmgr_psoc *psoc, void *arg)
 {
-	int status;
+	QDF_STATUS status;
 	wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
 
 	target_if_debug("psoc:%pK, arg:%pK", psoc, arg);
@@ -127,13 +127,16 @@ QDF_STATUS target_if_p2p_register_lo_event_handler(
 
 	target_if_debug("wmi register lo event handle, status:%d", status);
 
-	return status == 0 ? QDF_STATUS_SUCCESS : QDF_STATUS_E_FAILURE;
+	if (QDF_IS_STATUS_ERROR(status))
+		return QDF_STATUS_E_FAILURE;
+	else
+		return QDF_STATUS_SUCCESS;
 }
 
 QDF_STATUS target_if_p2p_unregister_lo_event_handler(
 	struct wlan_objmgr_psoc *psoc, void *arg)
 {
-	int status;
+	QDF_STATUS status;
 	wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
 
 	target_if_debug("psoc:%pK, arg:%pK", psoc, arg);
@@ -148,7 +151,10 @@ QDF_STATUS target_if_p2p_unregister_lo_event_handler(
 
 	target_if_debug("wmi unregister lo event handle, status:%d", status);
 
-	return status == 0 ? QDF_STATUS_SUCCESS : QDF_STATUS_E_FAILURE;
+	if (QDF_IS_STATUS_ERROR(status))
+		return QDF_STATUS_E_FAILURE;
+	else
+		return QDF_STATUS_SUCCESS;
 }
 
 QDF_STATUS target_if_p2p_lo_start(struct wlan_objmgr_psoc *psoc,
@@ -282,7 +288,7 @@ QDF_STATUS target_if_p2p_register_noa_event_handler(
 QDF_STATUS target_if_p2p_unregister_noa_event_handler(
 	struct wlan_objmgr_psoc *psoc, void *arg)
 {
-	int status;
+	QDF_STATUS status;
 	wmi_unified_t wmi_handle = lmac_get_wmi_unified_hdl(psoc);
 
 	target_if_debug("psoc:%pK, arg:%pK", psoc, arg);
@@ -298,7 +304,10 @@ QDF_STATUS target_if_p2p_unregister_noa_event_handler(
 	target_if_debug("wmi unregister noa event handle, status:%d",
 		status);
 
-	return status == 0 ? QDF_STATUS_SUCCESS : QDF_STATUS_E_FAILURE;
+	if (QDF_IS_STATUS_ERROR(status))
+		return QDF_STATUS_E_FAILURE;
+	else
+		return QDF_STATUS_SUCCESS;
 }
 
 QDF_STATUS target_if_p2p_set_ps(struct wlan_objmgr_psoc *psoc,

+ 2 - 2
components/target_if/pkt_capture/src/target_if_pkt_capture.c

@@ -178,14 +178,14 @@ target_if_register_mgmt_data_offload_event(struct wlan_objmgr_psoc *psoc)
 	if (ucfg_pkt_capture_get_mode(psoc) &&
 	    wmi_service_enabled(wmi_handle,
 				wmi_service_packet_capture_support)) {
-		uint8_t status;
+		QDF_STATUS status;
 
 		status = wmi_unified_register_event_handler(
 				wmi_handle,
 				wmi_mgmt_offload_data_event_id,
 				target_if_mgmt_offload_data_event_handler,
 				WMI_RX_WORK_CTX);
-		if (status) {
+		if (QDF_IS_STATUS_ERROR(status)) {
 			pkt_capture_err("Failed to register MGMT offload handler");
 			return QDF_STATUS_E_FAILURE;
 		}

+ 35 - 36
core/wma/src/wma_main.c

@@ -3980,7 +3980,6 @@ QDF_STATUS wma_start(void)
 {
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
 	tp_wma_handle wma_handle;
-	int status;
 	struct wmi_unified *wmi_handle;
 	struct mac_context *mac = NULL;
 
@@ -4007,44 +4006,44 @@ QDF_STATUS wma_start(void)
 		goto end;
 	}
 
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 						    wmi_roam_event_id,
 						    wma_roam_event_callback,
 						    WMA_RX_SERIALIZER_CTX);
-	if (0 != status) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register Roam callback");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 						    wmi_wow_wakeup_host_event_id,
 						    wma_wow_wakeup_host_event,
 						    WMA_RX_TASKLET_CTX);
-	if (status) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register wow wakeup host event handler");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
 	if (wma_d0_wow_is_supported()) {
-		status = wmi_unified_register_event_handler(
+		qdf_status = wmi_unified_register_event_handler(
 				wmi_handle,
 				wmi_d0_wow_disable_ack_event_id,
 				wma_d0_wow_disable_ack_event,
 				WMA_RX_TASKLET_CTX);
-		if (status) {
+		if (QDF_IS_STATUS_ERROR(qdf_status)) {
 			wma_err("Failed to register d0wow disable ack event handler");
 			qdf_status = QDF_STATUS_E_FAILURE;
 			goto end;
 		}
 	}
 
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 				wmi_pdev_resume_event_id,
 				wma_pdev_resume_event_handler,
 				WMA_RX_TASKLET_CTX);
-	if (status) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register PDEV resume event handler");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
@@ -4052,18 +4051,18 @@ QDF_STATUS wma_start(void)
 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \
 	defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT)
 	wma_debug("MCC TX Pause Event Handler register");
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 					wmi_tx_pause_event_id,
 					wma_mcc_vdev_tx_pause_evt_handler,
 					WMA_RX_TASKLET_CTX);
 #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
 
 	wma_debug("Registering SAR2 response handler");
-	status = wmi_unified_register_event_handler(wma_handle->wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wma_handle->wmi_handle,
 						wmi_wlan_sar2_result_event_id,
 						wma_sar_rsp_evt_handler,
 						WMA_RX_SERIALIZER_CTX);
-	if (status) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register sar response event cb");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
@@ -4071,28 +4070,28 @@ QDF_STATUS wma_start(void)
 
 #ifdef FEATURE_WLAN_AUTO_SHUTDOWN
 	wma_debug("Registering auto shutdown handler");
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 						wmi_host_auto_shutdown_event_id,
 						wma_auto_shutdown_event_handler,
 						WMA_RX_SERIALIZER_CTX);
-	if (status) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register WMI Auto shutdown event handler");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 #endif /* FEATURE_WLAN_AUTO_SHUTDOWN */
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 						wmi_thermal_mgmt_event_id,
 						wma_thermal_mgmt_evt_handler,
 						WMA_RX_SERIALIZER_CTX);
-	if (status) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register thermal mitigation event cb");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
-	status = wma_ocb_register_callbacks(wma_handle);
-	if (!QDF_IS_STATUS_SUCCESS(status)) {
+	qdf_status = wma_ocb_register_callbacks(wma_handle);
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register OCB callbacks");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
@@ -4110,7 +4109,7 @@ QDF_STATUS wma_start(void)
 #endif /* QCA_WIFI_FTM */
 
 	qdf_status = wma_tx_attach(wma_handle);
-	if (qdf_status != QDF_STATUS_SUCCESS) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register tx management");
 		goto end;
 	}
@@ -4136,84 +4135,84 @@ QDF_STATUS wma_start(void)
 			QDF_TIMER_TYPE_SW,
 			wma_log_completion_timeout,
 			wma_handle);
-	if (qdf_status != QDF_STATUS_SUCCESS) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to initialize log completion timeout");
 		goto end;
 	}
 
-	status = wma_fips_register_event_handlers(wma_handle);
-	if (!QDF_IS_STATUS_SUCCESS(status)) {
+	qdf_status = wma_fips_register_event_handlers(wma_handle);
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register FIPS event handler");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
-	status = wma_sar_register_event_handlers(wma_handle);
-	if (!QDF_IS_STATUS_SUCCESS(status)) {
+	qdf_status = wma_sar_register_event_handlers(wma_handle);
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register SAR event handlers");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
 	/* Initialize the get temperature event handler */
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 					wmi_pdev_temperature_event_id,
 					wma_pdev_temperature_evt_handler,
 					WMA_RX_SERIALIZER_CTX);
-	if (status != QDF_STATUS_SUCCESS) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register get_temperature event cb");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 						wmi_vdev_tsf_report_event_id,
 						wma_vdev_tsf_handler,
 						WMA_RX_SERIALIZER_CTX);
-	if (0 != status) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register tsf callback");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
 	/* Initialize the wma_pdev_set_hw_mode_resp_evt_handler event handler */
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 			wmi_pdev_set_hw_mode_rsp_event_id,
 			wma_pdev_set_hw_mode_resp_evt_handler,
 			WMA_RX_SERIALIZER_CTX);
-	if (status != QDF_STATUS_SUCCESS) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register set hw mode resp event cb");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
 	/* Initialize the WMI_SOC_HW_MODE_TRANSITION_EVENTID event handler */
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 			wmi_pdev_hw_mode_transition_event_id,
 			wma_pdev_hw_mode_transition_evt_handler,
 			WMA_RX_SERIALIZER_CTX);
-	if (status != QDF_STATUS_SUCCESS) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register hw mode transition event cb");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
 	/* Initialize the set dual mac configuration event handler */
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 			wmi_pdev_set_mac_config_resp_event_id,
 			wma_pdev_set_dual_mode_config_resp_evt_handler,
 			WMA_RX_SERIALIZER_CTX);
-	if (status != QDF_STATUS_SUCCESS) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register hw mode transition event cb");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;
 	}
 
-	status = wmi_unified_register_event_handler(wmi_handle,
+	qdf_status = wmi_unified_register_event_handler(wmi_handle,
 			wmi_coex_bt_activity_event_id,
 			wma_wlan_bt_activity_evt_handler,
 			WMA_RX_SERIALIZER_CTX);
-	if (!QDF_IS_STATUS_SUCCESS(status)) {
+	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		wma_err("Failed to register coex bt activity event handler");
 		qdf_status = QDF_STATUS_E_FAILURE;
 		goto end;