diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index fe555c78c435..c9ef52da6ce2 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1493,14 +1493,12 @@ QDF_STATUS wmi_unified_process_ll_stats_get_cmd(wmi_unified_t wmi_handle, * get station request * @wmi_handle: wmi handle * @get_req: unified ll stats and get station request command params - * @is_always_over_qmi: flag to send stats request always over qmi * * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ QDF_STATUS wmi_process_unified_ll_stats_get_sta_cmd( wmi_unified_t wmi_handle, - const struct ll_stats_get_params *get_req, - bool is_always_over_qmi); + const struct ll_stats_get_params *get_req); #endif /* FEATURE_CLUB_LL_STATS_AND_GET_STATION */ #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index d43ea235789f..fc80fdc11867 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -842,8 +842,7 @@ QDF_STATUS (*send_process_ll_stats_get_cmd)(wmi_unified_t wmi_handle, const struct ll_stats_get_params *get_req); #ifdef FEATURE_CLUB_LL_STATS_AND_GET_STATION QDF_STATUS (*send_unified_ll_stats_get_sta_cmd)(wmi_unified_t wmi_handle, - const struct ll_stats_get_params *get_req, - bool is_always_over_qmi); + const struct ll_stats_get_params *get_req); #endif #endif diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 072c713f2b6c..f3318cfd3dbf 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -773,13 +773,11 @@ QDF_STATUS wmi_unified_process_ll_stats_get_cmd(wmi_unified_t wmi_handle, #ifdef FEATURE_CLUB_LL_STATS_AND_GET_STATION QDF_STATUS wmi_process_unified_ll_stats_get_sta_cmd( wmi_unified_t wmi_handle, - const struct ll_stats_get_params *get_req, - bool is_always_over_qmi) + const struct ll_stats_get_params *get_req) { if (wmi_handle->ops->send_unified_ll_stats_get_sta_cmd) return wmi_handle->ops->send_unified_ll_stats_get_sta_cmd( - wmi_handle, get_req, - is_always_over_qmi); + wmi_handle, get_req); return QDF_STATUS_E_FAILURE; } diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index d9b54dd6e1d0..412e71b92458 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -5081,6 +5081,60 @@ static QDF_STATUS send_pno_start_cmd_tlv(wmi_unified_t wmi_handle, return QDF_STATUS_SUCCESS; } +/** + * is_service_enabled_tlv() - Check if service enabled + * @param wmi_handle: wmi handle + * @param service_id: service identifier + * + * Return: 1 enabled, 0 disabled + */ +static bool is_service_enabled_tlv(wmi_unified_t wmi_handle, + uint32_t service_id) +{ + struct wmi_soc *soc = wmi_handle->soc; + + if (!soc->wmi_service_bitmap) { + wmi_err("WMI service bit map is not saved yet"); + return false; + } + + /* if wmi_service_enabled was received with extended2 bitmap, + * use WMI_SERVICE_EXT2_IS_ENABLED to check the services. + */ + if (soc->wmi_ext2_service_bitmap) { + if (!soc->wmi_ext_service_bitmap) { + wmi_err("WMI service ext bit map is not saved yet"); + return false; + } + return WMI_SERVICE_EXT2_IS_ENABLED(soc->wmi_service_bitmap, + soc->wmi_ext_service_bitmap, + soc->wmi_ext2_service_bitmap, + service_id); + } + + if (service_id >= WMI_MAX_EXT_SERVICE) { + wmi_err("Service id %d but WMI ext2 service bitmap is NULL", + service_id); + return false; + } + /* if wmi_service_enabled was received with extended bitmap, + * use WMI_SERVICE_EXT_IS_ENABLED to check the services. + */ + if (soc->wmi_ext_service_bitmap) + return WMI_SERVICE_EXT_IS_ENABLED(soc->wmi_service_bitmap, + soc->wmi_ext_service_bitmap, + service_id); + + if (service_id >= WMI_MAX_SERVICE) { + wmi_err("Service id %d but WMI ext service bitmap is NULL", + service_id); + return false; + } + + return WMI_SERVICE_IS_ENABLED(soc->wmi_service_bitmap, + service_id); +} + #ifdef WLAN_FEATURE_LINK_LAYER_STATS /** * send_process_ll_stats_clear_cmd_tlv() - clear link layer stats @@ -5250,20 +5304,19 @@ static QDF_STATUS send_process_ll_stats_get_cmd_tlv(wmi_unified_t wmi_handle, * station request * @wmi_handle: wmi handle * @get_req: ll stats get request command params - * @is_always_over_qmi: flag to send stats request always over qmi * * Return: QDF_STATUS_SUCCESS for success or error code */ static QDF_STATUS send_unified_ll_stats_get_sta_cmd_tlv( wmi_unified_t wmi_handle, - const struct ll_stats_get_params *get_req, - bool is_always_over_qmi) + const struct ll_stats_get_params *get_req) { wmi_request_unified_ll_get_sta_cmd_fixed_param *unified_cmd; int32_t len; wmi_buf_t buf; void *buf_ptr; QDF_STATUS ret; + bool is_ll_get_sta_stats_over_qmi; len = sizeof(*unified_cmd); buf = wmi_buf_alloc(wmi_handle, len); @@ -5303,7 +5356,16 @@ static QDF_STATUS send_unified_ll_stats_get_sta_cmd_tlv( wmi_mtrace(WMI_REQUEST_UNIFIED_LL_GET_STA_CMDID, get_req->vdev_id, 0); - if (is_always_over_qmi && wmi_is_qmi_stats_enabled(wmi_handle)) { + /** + * FW support for LL_get_sta command. True represents the unified + * ll_get_sta command should be sent over QMI always irrespective of + * WOW state. + */ + is_ll_get_sta_stats_over_qmi = is_service_enabled_tlv( + wmi_handle, + WMI_SERVICE_UNIFIED_LL_GET_STA_OVER_QMI_SUPPORT); + + if (is_ll_get_sta_stats_over_qmi) { ret = wmi_unified_cmd_send_over_qmi( wmi_handle, buf, len, WMI_REQUEST_UNIFIED_LL_GET_STA_CMDID); @@ -8691,60 +8753,6 @@ QDF_STATUS send_adfs_ocac_abort_cmd_tlv(wmi_unified_t wmi_handle, } #endif -/** - * is_service_enabled_tlv() - Check if service enabled - * @param wmi_handle: wmi handle - * @param service_id: service identifier - * - * Return: 1 enabled, 0 disabled - */ -static bool is_service_enabled_tlv(wmi_unified_t wmi_handle, - uint32_t service_id) -{ - struct wmi_soc *soc = wmi_handle->soc; - - if (!soc->wmi_service_bitmap) { - wmi_err("WMI service bit map is not saved yet"); - return false; - } - - /* if wmi_service_enabled was received with extended2 bitmap, - * use WMI_SERVICE_EXT2_IS_ENABLED to check the services. - */ - if (soc->wmi_ext2_service_bitmap) { - if (!soc->wmi_ext_service_bitmap) { - wmi_err("WMI service ext bit map is not saved yet"); - return false; - } - return WMI_SERVICE_EXT2_IS_ENABLED(soc->wmi_service_bitmap, - soc->wmi_ext_service_bitmap, - soc->wmi_ext2_service_bitmap, - service_id); - } - - if (service_id >= WMI_MAX_EXT_SERVICE) { - wmi_err("Service id %d but WMI ext2 service bitmap is NULL", - service_id); - return false; - } - /* if wmi_service_enabled was received with extended bitmap, - * use WMI_SERVICE_EXT_IS_ENABLED to check the services. - */ - if (soc->wmi_ext_service_bitmap) - return WMI_SERVICE_EXT_IS_ENABLED(soc->wmi_service_bitmap, - soc->wmi_ext_service_bitmap, - service_id); - - if (service_id >= WMI_MAX_SERVICE) { - wmi_err("Service id %d but WMI ext service bitmap is NULL", - service_id); - return false; - } - - return WMI_SERVICE_IS_ENABLED(soc->wmi_service_bitmap, - service_id); -} - /** * init_cmd_send_tlv() - send initialization cmd to fw * @wmi_handle: wmi handle @@ -15254,7 +15262,6 @@ static void wmi_populate_service_get_sta_in_ll_stats_req(uint32_t *wmi_service) wmi_service[wmi_service_get_station_in_ll_stats_req] = WMI_SERVICE_UNIFIED_LL_GET_STA_CMD_SUPPORT; } - #else static void wmi_populate_service_get_sta_in_ll_stats_req(uint32_t *wmi_service) {