From 45eb0c0f4ea933749995a017b84ffd39cac28b05 Mon Sep 17 00:00:00 2001 From: Krupali Dhanvijay Date: Mon, 14 Nov 2022 18:32:32 +0530 Subject: [PATCH] qcacld-3.0: Clean up code for sme apis Clean up code for sme_get_roam_rssi_diff() and sme_get_is_ese_feature_enabled() apis and replace it with ucfg api. Change-Id: I226efbcf8ecd44b08684a3e17e2db987c169946d CRs-Fixed: 3335898 --- .../dispatcher/inc/wlan_cm_roam_ucfg_api.h | 33 +++++++++++++++++++ .../dispatcher/src/wlan_cm_roam_ucfg_api.c | 26 +++++++++++++++ core/hdd/src/wlan_hdd_ioctl.c | 12 +++---- core/sme/inc/csr_internal.h | 1 - core/sme/inc/sme_api.h | 12 ------- core/sme/src/common/sme_api.c | 32 ------------------ core/sme/src/csr/csr_api_roam.c | 11 ------- 7 files changed, 65 insertions(+), 62 deletions(-) diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h index 1ef47b228d..08307191f1 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h @@ -493,4 +493,37 @@ ucfg_cm_get_empty_scan_refresh_period(struct wlan_objmgr_psoc *psoc, uint16_t ucfg_cm_get_neighbor_scan_min_chan_time(struct wlan_objmgr_psoc *psoc, uint8_t session_id); + +/** + * ucfg_cm_get_roam_rssi_diff() - Get Roam rssi diff + * @psoc: pointer to psoc object + * @vdev_id: vdev identifier + * @rssi_diff: Buffer to fill the roam RSSI diff. + * Valid only if the return status is success. + * + * Return: QDF_STATUS + */ +QDF_STATUS +ucfg_cm_get_roam_rssi_diff(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, + uint8_t *rssi_diff); + +#ifdef FEATURE_WLAN_ESE +/** + * ucfg_cm_get_is_ese_feature_enabled() - Get ESE feature enabled or not + * This is a synchronous call + * @psoc: pointer to psoc object + * + * Return true (1) - if the ESE feature is enabled + * false (0) - if feature is disabled (compile or runtime) + */ +bool +ucfg_cm_get_is_ese_feature_enabled(struct wlan_objmgr_psoc *psoc); +#else +static inline bool +ucfg_cm_get_is_ese_feature_enabled(struct wlan_objmgr_psoc *psoc) +{ + return false; +} +#endif + #endif /* _WLAN_CM_ROAM_UCFG_API_H_ */ diff --git a/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_ucfg_api.c b/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_ucfg_api.c index c63904625b..261eacf704 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_ucfg_api.c +++ b/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_ucfg_api.c @@ -583,3 +583,29 @@ ucfg_cm_get_neighbor_scan_min_chan_time(struct wlan_objmgr_psoc *psoc, return temp.uint_value; } + +QDF_STATUS +ucfg_cm_get_roam_rssi_diff(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id, + uint8_t *rssi_diff) +{ + struct cm_roam_values_copy temp; + + wlan_cm_roam_cfg_get_value(psoc, vdev_id, + ROAM_RSSI_DIFF, &temp); + *rssi_diff = temp.uint_value; + + return QDF_STATUS_SUCCESS; +} + +#ifdef FEATURE_WLAN_ESE +bool ucfg_cm_get_is_ese_feature_enabled(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return false; + + return mlme_obj->cfg.lfr.ese_enabled; +} +#endif diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index c4188487f2..906c711065 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -3183,8 +3183,8 @@ static int drv_cmd_get_roam_delta(struct hdd_adapter *adapter, uint8_t len; QDF_STATUS status; - status = sme_get_roam_rssi_diff(hdd_ctx->mac_handle, adapter->vdev_id, - &rssi_diff); + status = ucfg_cm_get_roam_rssi_diff(hdd_ctx->psoc, adapter->vdev_id, + &rssi_diff); if (QDF_IS_STATUS_ERROR(status)) return qdf_status_to_os_return(status); @@ -3455,7 +3455,7 @@ static int drv_cmd_get_ccx_mode(struct hdd_adapter *adapter, { int ret = 0; mac_handle_t mac_handle = hdd_ctx->mac_handle; - bool ese_mode = sme_get_is_ese_feature_enabled(mac_handle); + bool ese_mode = ucfg_cm_get_is_ese_feature_enabled(hdd_ctx->psoc); char extra[32]; uint8_t len = 0; struct pmkid_mode_bits pmkid_modes; @@ -3504,7 +3504,7 @@ static int drv_cmd_get_okc_mode(struct hdd_adapter *adapter, * then this operation is not permitted (return FAILURE) */ if (pmkid_modes.fw_okc && - sme_get_is_ese_feature_enabled(mac_handle) && + ucfg_cm_get_is_ese_feature_enabled(hdd_ctx->psoc) && sme_get_is_ft_feature_enabled(mac_handle)) { hdd_warn("PMKID/ESE/11R are supported simultaneously hence this operation is not permitted!"); ret = -EPERM; @@ -4361,7 +4361,7 @@ static int drv_cmd_set_okc_mode(struct hdd_adapter *adapter, * then this operation is not permitted (return FAILURE) */ mac_handle = hdd_ctx->mac_handle; - if (sme_get_is_ese_feature_enabled(mac_handle) && + if (ucfg_cm_get_is_ese_feature_enabled(hdd_ctx->psoc) && pmkid_modes.fw_okc && sme_get_is_ft_feature_enabled(mac_handle)) { hdd_warn("PMKID/ESE/11R are supported simultaneously hence this operation is not permitted!"); @@ -4922,7 +4922,7 @@ static int drv_cmd_set_ccx_mode(struct hdd_adapter *adapter, * Check if the features OKC/ESE/11R are supported simultaneously, * then this operation is not permitted (return FAILURE) */ - if (sme_get_is_ese_feature_enabled(mac_handle) && + if (ucfg_cm_get_is_ese_feature_enabled(hdd_ctx->psoc) && pmkid_modes.fw_okc && sme_get_is_ft_feature_enabled(mac_handle)) { hdd_warn("OKC/ESE/11R are supported simultaneously hence this operation is not permitted!"); diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 6bf2a26577..5dd4729dc4 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -499,7 +499,6 @@ bool csr_roam_is11r_assoc(struct mac_context *mac, uint8_t sessionId); #ifdef FEATURE_WLAN_ESE /* Returns whether the current association is a ESE assoc or not */ bool csr_roam_is_ese_assoc(struct mac_context *mac, uint32_t sessionId); -bool csr_roam_is_ese_ini_feature_enabled(struct mac_context *mac); QDF_STATUS csr_get_tsm_stats(struct mac_context *mac, tCsrTsmStatsCallback callback, struct qdf_mac_addr bssId, diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 33af2e8919..84942a1173 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1151,17 +1151,6 @@ QDF_STATUS sme_set_roam_bmiss_first_bcnt(mac_handle_t mac_handle, QDF_STATUS sme_set_roam_bmiss_final_bcnt(mac_handle_t mac_handle, uint8_t sessionId, const uint8_t nRoamBmissFinalBcnt); -/** - * sme_get_roam_rssi_diff() - get Roam rssi diff - * @mac_handle: The handle returned by mac_open - * @vdev_id: vdev identifier - * @rssi_diff: Buffer to fill the roam RSSI diff. - * Valid only if the return status is success. - * - * Return: QDF_STATUS - */ -QDF_STATUS sme_get_roam_rssi_diff(mac_handle_t mac_handle, uint8_t vdev_id, - uint8_t *rssi_diff); QDF_STATUS sme_change_roam_scan_channel_list(mac_handle_t mac_handle, uint8_t sessionId, uint32_t *channel_freq_list, @@ -1189,7 +1178,6 @@ QDF_STATUS sme_get_roam_scan_channel_list(mac_handle_t mac_handle, uint8_t *pNumChannels, uint8_t sessionId); -bool sme_get_is_ese_feature_enabled(mac_handle_t mac_handle); bool sme_get_wes_mode(mac_handle_t mac_handle); bool sme_get_is_lfr_feature_enabled(mac_handle_t mac_handle); bool sme_get_is_ft_feature_enabled(mac_handle_t mac_handle); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index ad57c7e4ea..17707e783f 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -6942,19 +6942,6 @@ uint16_t sme_get_neighbor_scan_period(mac_handle_t mac_handle, return temp.uint_value; } -QDF_STATUS sme_get_roam_rssi_diff(mac_handle_t mac_handle, uint8_t vdev_id, - uint8_t *rssi_diff) -{ - struct mac_context *mac = MAC_CONTEXT(mac_handle); - struct cm_roam_values_copy temp; - - wlan_cm_roam_cfg_get_value(mac->psoc, vdev_id, - ROAM_RSSI_DIFF, &temp); - *rssi_diff = temp.uint_value; - - return QDF_STATUS_SUCCESS; -} - static bool sme_validate_freq_list(mac_handle_t mac_handle, uint32_t *freq_list, uint8_t num_channels) @@ -7121,25 +7108,6 @@ QDF_STATUS sme_get_roam_scan_channel_list(mac_handle_t mac_handle, return status; } -/* - * sme_get_is_ese_feature_enabled() - get ESE feature enabled or not - * This is a synchronous call - * - * mac_handle - The handle returned by mac_open. - * Return true (1) - if the ESE feature is enabled - * false (0) - if feature is disabled (compile or runtime) - */ -bool sme_get_is_ese_feature_enabled(mac_handle_t mac_handle) -{ -#ifdef FEATURE_WLAN_ESE - struct mac_context *mac = MAC_CONTEXT(mac_handle); - - return csr_roam_is_ese_ini_feature_enabled(mac); -#else - return false; -#endif -} - /* * sme_get_wes_mode() - get WES Mode * This is a synchronous call diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 7ca52d009d..bf83531b17 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1521,17 +1521,6 @@ bool csr_roam_is_ese_assoc(struct mac_context *mac_ctx, uint32_t session_id) } -/** - * csr_roam_is_ese_ini_feature_enabled() - is ese feature enabled - * @mac_ctx: Global MAC context - * - * Return: true if ese feature is enabled; false otherwise - */ -bool csr_roam_is_ese_ini_feature_enabled(struct mac_context *mac) -{ - return mac->mlme_cfg->lfr.ese_enabled; -} - /** * csr_tsm_stats_rsp_processor() - tsm stats response processor * @mac: Global MAC context