diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index e2e20b339c27..d46e83f6edf6 100644 --- a/core/mac/inc/sir_api.h +++ b/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. diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 6e554143539c..6e7e04e07a5d 100644 --- a/core/sme/src/common/sme_api.c +++ b/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 diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index 5e330b942a6a..473b68ec2803 100644 --- a/core/wma/inc/wma_internal.h +++ b/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 diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index e35b98c76aed..be70e83e7154 100644 --- a/core/wma/src/wma_features.c +++ b/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 */ diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 8f074b72c646..77003f0c7bfb 100644 --- a/core/wma/src/wma_main.c +++ b/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 */