Kaynağa Gözat

qcacld-3.0: Remove EOK from WMA

There are several instances of incorrectly using EOK with QDF_STATUS.
Address all infractions in WMA.

Change-Id: I1bc97c2ed8d4d9600dcbc07f57fccfe42d75d27e
CRs-Fixed: 2403943
Dustin Brown 6 yıl önce
ebeveyn
işleme
fd578601c0

+ 18 - 44
core/wma/src/wma_features.c

@@ -431,10 +431,9 @@ int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len)
  */
 QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id)
 {
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	QDF_STATUS status;
 	wmi_buf_t buf;
 	wmi_vdev_tsf_tstamp_action_cmd_fixed_param *cmd;
-	int ret;
 	int len = sizeof(*cmd);
 
 	buf = wmi_buf_alloc(wma_handle->wmi_handle, len);
@@ -452,18 +451,11 @@ QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id)
 	WMITLV_GET_STRUCT_TLVLEN(
 	wmi_vdev_tsf_tstamp_action_cmd_fixed_param));
 
-	ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
-				   WMI_VDEV_TSF_TSTAMP_ACTION_CMDID);
-	if (ret != EOK) {
-		status = QDF_STATUS_E_FAILURE;
-		goto error;
-	}
-
-	return QDF_STATUS_SUCCESS;
-
-error:
-	if (buf)
+	status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
+				      WMI_VDEV_TSF_TSTAMP_ACTION_CMDID);
+	if (QDF_IS_STATUS_ERROR(status))
 		wmi_buf_free(buf);
+
 	return status;
 }
 
@@ -476,10 +468,9 @@ error:
  */
 QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id)
 {
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	QDF_STATUS status;
 	wmi_buf_t buf;
 	wmi_vdev_tsf_tstamp_action_cmd_fixed_param *cmd;
-	int ret;
 	int len = sizeof(*cmd);
 	uint8_t *buf_ptr;
 
@@ -500,18 +491,11 @@ QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id)
 		WMITLV_GET_STRUCT_TLVLEN(
 				wmi_vdev_tsf_tstamp_action_cmd_fixed_param));
 
-	ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
-				   WMI_VDEV_TSF_TSTAMP_ACTION_CMDID);
-
-	if (ret != EOK) {
-		status = QDF_STATUS_E_FAILURE;
-		goto error;
-	}
-	return QDF_STATUS_SUCCESS;
-
-error:
-	if (buf)
+	status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
+				      WMI_VDEV_TSF_TSTAMP_ACTION_CMDID);
+	if (QDF_IS_STATUS_ERROR(status))
 		wmi_buf_free(buf);
+
 	return status;
 }
 
@@ -558,10 +542,10 @@ QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
 QDF_STATUS wma_set_wisa_params(tp_wma_handle wma_handle,
 				struct sir_wisa_params *wisa)
 {
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	QDF_STATUS status;
 	wmi_buf_t buf;
 	wmi_vdev_wisa_cmd_fixed_param *cmd;
-	int ret, len = sizeof(*cmd);
+	int len = sizeof(*cmd);
 
 	buf = wmi_buf_alloc(wma_handle->wmi_handle, len);
 	if (!buf)
@@ -576,16 +560,11 @@ QDF_STATUS wma_set_wisa_params(tp_wma_handle wma_handle,
 		WMITLV_GET_STRUCT_TLVLEN(
 				wmi_vdev_wisa_cmd_fixed_param));
 
-	ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
-				   WMI_VDEV_WISA_CMDID);
-	if (ret != EOK) {
-		status = QDF_STATUS_E_FAILURE;
-		goto error;
-	}
-	return QDF_STATUS_SUCCESS;
+	status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
+				      WMI_VDEV_WISA_CMDID);
+	if (QDF_IS_STATUS_ERROR(status))
+		wmi_buf_free(buf);
 
-error:
-	wmi_buf_free(buf);
 	return status;
 }
 
@@ -601,7 +580,6 @@ QDF_STATUS wma_process_dhcp_ind(WMA_HANDLE handle,
 {
 	tp_wma_handle wma_handle = (tp_wma_handle) handle;
 	uint8_t vdev_id;
-	int status = 0;
 	wmi_peer_set_param_cmd_fixed_param peer_set_param_fp = {0};
 
 	if (!wma_handle) {
@@ -638,12 +616,8 @@ QDF_STATUS wma_process_dhcp_ind(WMA_HANDLE handle,
 	WMI_CHAR_ARRAY_TO_MAC_ADDR(ta_dhcp_ind->peerMacAddr.bytes,
 				   &peer_set_param_fp.peer_macaddr);
 
-	status = wmi_unified_process_dhcp_ind(wma_handle->wmi_handle,
-						&peer_set_param_fp);
-	if (status != EOK)
-		return QDF_STATUS_E_FAILURE;
-
-	return QDF_STATUS_SUCCESS;
+	return wmi_unified_process_dhcp_ind(wma_handle->wmi_handle,
+					    &peer_set_param_fp);
 }
 
 /**

+ 12 - 15
core/wma/src/wma_main.c

@@ -7172,15 +7172,14 @@ static void wma_set_wifi_start_packet_stats(void *wma_handle,
 void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle)
 {
 	QDF_STATUS status;
-	int ret;
 
-	ret = wmi_unified_flush_logs_to_fw_cmd(wma_handle->wmi_handle);
-	if (ret != EOK)
+	status = wmi_unified_flush_logs_to_fw_cmd(wma_handle->wmi_handle);
+	if (QDF_IS_STATUS_ERROR(status))
 		return;
 
 	status = qdf_mc_timer_start(&wma_handle->log_completion_timer,
-			WMA_LOG_COMPLETION_TIMER);
-	if (status != QDF_STATUS_SUCCESS)
+				    WMA_LOG_COMPLETION_TIMER);
+	if (QDF_IS_STATUS_ERROR(status))
 		WMA_LOGE("Failed to start the log completion timer");
 }
 
@@ -7546,7 +7545,7 @@ static QDF_STATUS wma_process_beacon_debug_stats_req(tp_wma_handle wma_handle,
 static void wma_set_arp_req_stats(WMA_HANDLE handle,
 				  struct set_arp_stats_params *req_buf)
 {
-	int status;
+	QDF_STATUS status;
 	struct set_arp_stats *arp_stats;
 	tp_wma_handle wma_handle = (tp_wma_handle) handle;
 
@@ -7563,9 +7562,8 @@ static void wma_set_arp_req_stats(WMA_HANDLE handle,
 	arp_stats = (struct set_arp_stats *)req_buf;
 	status = wmi_unified_set_arp_stats_req(wma_handle->wmi_handle,
 					       arp_stats);
-	if (status != EOK)
-		WMA_LOGE("%s: failed to set arp stats to FW",
-			 __func__);
+	if (QDF_IS_STATUS_ERROR(status))
+		wma_err("failed to set arp stats to FW");
 }
 
 /**
@@ -7578,7 +7576,7 @@ static void wma_set_arp_req_stats(WMA_HANDLE handle,
 static void wma_get_arp_req_stats(WMA_HANDLE handle,
 				  struct get_arp_stats_params *req_buf)
 {
-	int status;
+	QDF_STATUS status;
 	struct get_arp_stats *arp_stats;
 	tp_wma_handle wma_handle = (tp_wma_handle) handle;
 
@@ -7595,9 +7593,8 @@ static void wma_get_arp_req_stats(WMA_HANDLE handle,
 	arp_stats = (struct get_arp_stats *)req_buf;
 	status = wmi_unified_get_arp_stats_req(wma_handle->wmi_handle,
 					       arp_stats);
-	if (status != EOK)
-		WMA_LOGE("%s: failed to send get arp stats to FW",
-			 __func__);
+	if (QDF_IS_STATUS_ERROR(status))
+		wma_err("failed to send get arp stats to FW");
 }
 
 /**
@@ -7610,7 +7607,7 @@ static void wma_get_arp_req_stats(WMA_HANDLE handle,
 static void wma_set_del_pmkid_cache(WMA_HANDLE handle,
 				    struct wmi_unified_pmk_cache *pmk_cache)
 {
-	int status;
+	QDF_STATUS status;
 	tp_wma_handle wma_handle = (tp_wma_handle) handle;
 
 	if (!wma_handle || !wma_handle->wmi_handle) {
@@ -7620,7 +7617,7 @@ static void wma_set_del_pmkid_cache(WMA_HANDLE handle,
 
 	status = wmi_unified_set_del_pmkid_cache(wma_handle->wmi_handle,
 						 pmk_cache);
-	if (status != EOK)
+	if (QDF_IS_STATUS_ERROR(status))
 		WMA_LOGE("failed to send set/del pmkid cmd to fw");
 }
 

+ 13 - 13
core/wma/src/wma_power.c

@@ -58,12 +58,12 @@
  * @wmi_handle: wmi handle
  * @param_value: parameter value
  *
- * Return: 0 for success or error code
+ * Return: QDF_STATUS
  */
-static int
+static QDF_STATUS
 wma_unified_modem_power_state(wmi_unified_t wmi_handle, uint32_t param_value)
 {
-	int ret;
+	QDF_STATUS status;
 	wmi_modem_power_state_cmd_param *cmd;
 	wmi_buf_t buf;
 	uint16_t len = sizeof(*cmd);
@@ -80,12 +80,12 @@ wma_unified_modem_power_state(wmi_unified_t wmi_handle, uint32_t param_value)
 	cmd->modem_power_state = param_value;
 	WMA_LOGD("%s: Setting cmd->modem_power_state = %u", __func__,
 		 param_value);
-	ret = wmi_unified_cmd_send(wmi_handle, buf, len,
-				     WMI_MODEM_POWER_STATE_CMDID);
-	if (ret != EOK)
+	status = wmi_unified_cmd_send(wmi_handle, buf, len,
+				      WMI_MODEM_POWER_STATE_CMDID);
+	if (QDF_IS_STATUS_ERROR(status))
 		wmi_buf_free(buf);
 
-	return ret;
+	return status;
 }
 
 /**
@@ -1544,19 +1544,19 @@ QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value)
 QDF_STATUS wma_notify_modem_power_state(void *wma_ptr,
 					tSirModemPowerStateInd *pReq)
 {
-	int32_t ret;
+	QDF_STATUS status;
 	tp_wma_handle wma = (tp_wma_handle) wma_ptr;
 
 	WMA_LOGD("%s: WMA notify Modem Power State %d", __func__, pReq->param);
 
-	ret = wma_unified_modem_power_state(wma->wmi_handle, pReq->param);
-	if (ret) {
-		WMA_LOGE("%s: Fail to notify Modem Power State %d",
-			 __func__, pReq->param);
-		return QDF_STATUS_E_FAILURE;
+	status = wma_unified_modem_power_state(wma->wmi_handle, pReq->param);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("Failed to notify Modem Power State %d", pReq->param);
+		return status;
 	}
 
 	WMA_LOGD("Successfully notify Modem Power State %d", pReq->param);
+
 	return QDF_STATUS_SUCCESS;
 }
 

+ 28 - 38
core/wma/src/wma_scan_roam.c

@@ -645,22 +645,15 @@ QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
 					     uint32_t bcn_rssi_weight,
 					     uint32_t hirssi_delay_btw_scans)
 {
-	int status;
-
 	if (!wma_is_vdev_valid(vdev_id)) {
-		WMA_LOGE("%s: Invalid vdev id:%d", __func__, vdev_id);
+		wma_err("Invalid vdev id:%d", vdev_id);
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	status = wmi_unified_roam_scan_offload_rssi_change_cmd(
+	return wmi_unified_roam_scan_offload_rssi_change_cmd(
 				wma_handle->wmi_handle,
 				vdev_id, rssi_change_thresh,
 				bcn_rssi_weight, hirssi_delay_btw_scans);
-	if (status != EOK)
-		return QDF_STATUS_E_FAILURE;
-
-
-	return QDF_STATUS_SUCCESS;
 }
 
 /**
@@ -944,7 +937,7 @@ void wma_process_set_pdev_ie_req(tp_wma_handle wma,
 void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
 		struct set_ie_param *ie_params)
 {
-	int ret;
+	QDF_STATUS status;
 	wmi_pdev_set_ht_ie_cmd_fixed_param *cmd;
 	wmi_buf_t buf;
 	uint16_t len;
@@ -977,9 +970,10 @@ void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
 			     (uint8_t *)ie_params->ie_ptr,
 			     ie_params->ie_len);
 	}
-	ret = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
-					WMI_PDEV_SET_HT_CAP_IE_CMDID);
-	if (ret != EOK)
+
+	status = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
+				      WMI_PDEV_SET_HT_CAP_IE_CMDID);
+	if (QDF_IS_STATUS_ERROR(status))
 		wmi_buf_free(buf);
 }
 
@@ -996,7 +990,7 @@ void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
 void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
 		struct set_ie_param *ie_params)
 {
-	int ret;
+	QDF_STATUS status;
 	wmi_pdev_set_vht_ie_cmd_fixed_param *cmd;
 	wmi_buf_t buf;
 	uint16_t len;
@@ -1029,9 +1023,10 @@ void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
 				(uint8_t *)ie_params->ie_ptr,
 				ie_params->ie_len);
 	}
-	ret = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
-			WMI_PDEV_SET_VHT_CAP_IE_CMDID);
-	if (ret != EOK)
+
+	status = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
+				      WMI_PDEV_SET_VHT_CAP_IE_CMDID);
+	if (QDF_IS_STATUS_ERROR(status))
 		wmi_buf_free(buf);
 }
 
@@ -1953,9 +1948,9 @@ QDF_STATUS wma_process_roaming_config(tp_wma_handle wma_handle,
 }
 
 void wma_update_per_roam_config(WMA_HANDLE handle,
-				 struct wmi_per_roam_config_req *req_buf)
+				struct wmi_per_roam_config_req *req_buf)
 {
-	int status;
+	QDF_STATUS status;
 	tp_wma_handle wma_handle = (tp_wma_handle) handle;
 
 	if (!wma_handle || !wma_handle->wmi_handle) {
@@ -1965,10 +1960,9 @@ void wma_update_per_roam_config(WMA_HANDLE handle,
 	}
 
 	status = wmi_unified_set_per_roam_config(wma_handle->wmi_handle,
-						req_buf);
-	if (status != EOK)
-		WMA_LOGE("%s: failed to set per roam config to FW",
-			__func__);
+						 req_buf);
+	if (QDF_IS_STATUS_ERROR(status))
+		wma_err("failed to set per roam config to FW");
 }
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
@@ -5094,10 +5088,9 @@ QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
  */
 QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma, int32_t vdev_id)
 {
-
+	QDF_STATUS status;
 	wmi_buf_t buf;
 	wmi_obss_scan_disable_cmd_fixed_param *cmd;
-	int ret;
 	int len = sizeof(*cmd);
 
 	buf = wmi_buf_alloc(wma->wmi_handle, len);
@@ -5113,14 +5106,12 @@ QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma, int32_t vdev_id)
 			wmi_obss_scan_disable_cmd_fixed_param));
 
 	cmd->vdev_id = vdev_id;
-	ret = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
-				WMI_OBSS_SCAN_DISABLE_CMDID);
-	if (ret != EOK) {
+	status = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
+				      WMI_OBSS_SCAN_DISABLE_CMDID);
+	if (QDF_IS_STATUS_ERROR(status))
 		wmi_buf_free(buf);
-		return QDF_STATUS_E_FAILURE;
-	}
 
-	return QDF_STATUS_SUCCESS;
+	return status;
 }
 
 /**
@@ -5133,9 +5124,9 @@ QDF_STATUS wma_ht40_stop_obss_scan(tp_wma_handle wma, int32_t vdev_id)
 QDF_STATUS wma_send_ht40_obss_scanind(tp_wma_handle wma,
 				struct obss_ht40_scanind *req)
 {
+	QDF_STATUS status;
 	wmi_buf_t buf;
 	wmi_obss_scan_enable_cmd_fixed_param *cmd;
-	int ret;
 	int len = 0;
 	uint8_t *buf_ptr, i;
 	uint8_t *channel_list;
@@ -5208,13 +5199,12 @@ QDF_STATUS wma_send_ht40_obss_scanind(tp_wma_handle wma,
 			qdf_roundup(1, sizeof(uint32_t)));
 	buf_ptr += WMI_TLV_HDR_SIZE;
 
-	ret = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
-				WMI_OBSS_SCAN_ENABLE_CMDID);
-	if (ret != EOK) {
+	status = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
+				      WMI_OBSS_SCAN_ENABLE_CMDID);
+	if (QDF_IS_STATUS_ERROR(status))
 		wmi_buf_free(buf);
-		return QDF_STATUS_E_FAILURE;
-	}
-	return QDF_STATUS_SUCCESS;
+
+	return status;
 }
 
 int wma_handle_btm_blacklist_event(void *handle, uint8_t *cmd_param_info,

+ 4 - 3
core/wma/src/wma_utils.c

@@ -2289,6 +2289,7 @@ int wma_unified_link_iface_stats_event_handler(void *handle,
 void wma_config_stats_ext_threshold(tp_wma_handle wma,
 				    struct sir_ll_ext_stats_threshold *thresh)
 {
+	QDF_STATUS status;
 	uint32_t len, tag, hdr_len;
 	uint8_t *buf_ptr;
 	wmi_buf_t buf;
@@ -2422,9 +2423,9 @@ void wma_config_stats_ext_threshold(tp_wma_handle wma,
 
 	WMA_LOGA("WMA --> WMI_PDEV_SET_STATS_THRESHOLD_CMDID(0x%x), length=%d",
 		 WMI_PDEV_SET_STATS_THRESHOLD_CMDID, len);
-	if (EOK != wmi_unified_cmd_send(wma->wmi_handle,
-					buf, len,
-					WMI_PDEV_SET_STATS_THRESHOLD_CMDID))
+	status = wmi_unified_cmd_send(wma->wmi_handle, buf, len,
+				      WMI_PDEV_SET_STATS_THRESHOLD_CMDID);
+	if (QDF_IS_STATUS_ERROR(status))
 		wmi_buf_free(buf);
 }