Kaynağa Gözat

qcacld-3.0: Replace typedef tSirLedFlashingReq

The current driver strategy is to converge on unified APIs, and the
unified WMI struct flashing_req_params conveys the same information as
typedef tSirLedFlashingReq, therefore replace tSirLedFlashingReq with
struct flashing_req_params.

Change-Id: I4ef75ee3bff7c83dbf8197bba0802569282a414f
CRs-Fixed: 2121335
Jeff Johnson 7 yıl önce
ebeveyn
işleme
5a6b660768

+ 0 - 9
core/mac/inc/sir_api.h

@@ -5861,15 +5861,6 @@ typedef struct {
 	uint32_t dhcpSrvIP;
 } tSirDhcpSrvOffloadInfo, *tpSirDhcpSrvOffloadInfo;
 #endif /* DHCP_SERVER_OFFLOAD */
-#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
-typedef struct {
-	uint32_t reqId;
-	/* pattern identifier. 0: disconnected 1: connected */
-	uint32_t pattern_id;
-	uint32_t led_x0;        /* led flashing parameter0 */
-	uint32_t led_x1;        /* led flashing parameter1 */
-} tSirLedFlashingReq, *tpSirLedFlashingReq;
-#endif
 
 /**
  * struct sir_lost_link_info - lost link information structure.

+ 7 - 7
core/sme/src/common/sme_api.c

@@ -12936,11 +12936,10 @@ QDF_STATUS sme_send_unit_test_cmd(uint32_t vdev_id, uint32_t module_id,
 QDF_STATUS sme_set_led_flashing(tHalHandle hHal, uint8_t type,
 				uint32_t x0, uint32_t x1)
 {
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
+	QDF_STATUS status;
 	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
 	struct scheduler_msg message = {0};
-	tSirLedFlashingReq *ledflashing;
+	struct flashing_req_params *ledflashing;
 
 	ledflashing = qdf_mem_malloc(sizeof(*ledflashing));
 	if (!ledflashing) {
@@ -12949,6 +12948,7 @@ QDF_STATUS sme_set_led_flashing(tHalHandle hHal, uint8_t type,
 		return QDF_STATUS_E_NOMEM;
 	}
 
+	ledflashing->req_id = 0;
 	ledflashing->pattern_id = type;
 	ledflashing->led_x0 = x0;
 	ledflashing->led_x1 = x1;
@@ -12958,12 +12958,12 @@ QDF_STATUS sme_set_led_flashing(tHalHandle hHal, uint8_t type,
 		/* Serialize the req through MC thread */
 		message.bodyptr = ledflashing;
 		message.type = WMA_LED_FLASHING_REQ;
-		qdf_status = scheduler_post_msg(QDF_MODULE_ID_WMA,
-						 &message);
-		if (!QDF_IS_STATUS_SUCCESS(qdf_status))
-			status = QDF_STATUS_E_FAILURE;
+		status = scheduler_post_msg(QDF_MODULE_ID_WMA, &message);
 		sme_release_global_lock(&pMac->sme);
 	}
+	if (!QDF_IS_STATUS_SUCCESS(status))
+		qdf_mem_free(ledflashing);
+
 	return status;
 }
 #endif

+ 1 - 1
core/wma/inc/wma_internal.h

@@ -1128,7 +1128,7 @@ int wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
 
 #ifdef WLAN_FEATURE_GPIO_LED_FLASHING
 QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
-				tSirLedFlashingReq *flashing);
+				struct flashing_req_params *flashing);
 #endif
 
 

+ 4 - 10
core/wma/src/wma_features.c

@@ -3811,9 +3811,9 @@ QDF_STATUS wma_process_dhcpserver_offload(tp_wma_handle wma_handle,
  * Return: QDF status
  */
 QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
-				tSirLedFlashingReq *flashing)
+				struct flashing_req_params *flashing)
 {
-	struct flashing_req_params cmd = {0};
+	QDF_STATUS status;
 
 	if (!wma_handle || !wma_handle->wmi_handle) {
 		WMA_LOGE(FL("WMA is closed, can not issue cmd"));
@@ -3823,15 +3823,9 @@ QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle,
 		WMA_LOGE(FL("invalid parameter: flashing"));
 		return QDF_STATUS_E_INVAL;
 	}
-	cmd.req_id = flashing->reqId;
-	cmd.pattern_id = flashing->pattern_id;
-	cmd.led_x0 = flashing->led_x0;
-	cmd.led_x1 = flashing->led_x1;
 	status = wmi_unified_set_led_flashing_cmd(wma_handle->wmi_handle,
-				      &cmd);
-	if (status != EOK)
-		return QDF_STATUS_E_FAILURE;
-	return QDF_STATUS_SUCCESS;
+						  flashing);
+	return status;
 }
 #endif /* WLAN_FEATURE_GPIO_LED_FLASHING */
 

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

@@ -7568,8 +7568,7 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
 #endif /* DHCP_SERVER_OFFLOAD */
 #ifdef WLAN_FEATURE_GPIO_LED_FLASHING
 	case WMA_LED_FLASHING_REQ:
-		wma_set_led_flashing(wma_handle,
-				     (tSirLedFlashingReq *) msg->bodyptr);
+		wma_set_led_flashing(wma_handle, msg->bodyptr);
 		qdf_mem_free(msg->bodyptr);
 		break;
 #endif /* WLAN_FEATURE_GPIO_LED_FLASHING */