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 575773fa56..2cfe8ded9a 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 @@ -605,4 +605,29 @@ ucfg_cm_get_roam_opportunistic_scan_threshold_diff( struct wlan_objmgr_psoc *psoc, int8_t *val); +/** + * ucfg_cm_get_neighbor_scan_refresh_period() - Get neighbor scan results + * refresh period. + * This is a synchronous call + * @psoc: pointer to psoc object + * @value: value for scan results refresh period + * + * Return: QDF_STATUS + */ +QDF_STATUS +ucfg_cm_get_neighbor_scan_refresh_period(struct wlan_objmgr_psoc *psoc, + uint16_t *value); + +/** + * ucfg_cm_get_empty_scan_refresh_period_global() - Get global scan + * refresh period + * @psoc: pointer to psoc object + * @roam_scan_period_global: value for empty scan refresh period + * + * Return: QDF_STATUS + */ +QDF_STATUS +ucfg_cm_get_empty_scan_refresh_period_global(struct wlan_objmgr_psoc *psoc, + uint16_t *roam_scan_period_global); + #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 17052d3201..19614cfb16 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 @@ -695,3 +695,34 @@ ucfg_cm_get_roam_opportunistic_scan_threshold_diff( return QDF_STATUS_SUCCESS; } + +QDF_STATUS +ucfg_cm_get_neighbor_scan_refresh_period(struct wlan_objmgr_psoc *psoc, + uint16_t *value) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return QDF_STATUS_E_INVAL; + + *value = mlme_obj->cfg.lfr.neighbor_scan_results_refresh_period; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_cm_get_empty_scan_refresh_period_global(struct wlan_objmgr_psoc *psoc, + uint16_t *roam_scan_period_global) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return QDF_STATUS_E_INVAL; + + *roam_scan_period_global = + mlme_obj->cfg.lfr.empty_scan_refresh_period; + + return QDF_STATUS_SUCCESS; +} diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 68822fe17c..f3b35c20a9 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -5560,7 +5560,7 @@ hdd_send_roam_scan_period_to_sme(struct hdd_context *hdd_ctx, bool check_and_update) { QDF_STATUS status; - uint16_t roam_scan_period_current, roam_scan_period_global; + uint16_t roam_scan_period_current, roam_scan_period_global = 0; if (!ucfg_mlme_validate_scan_period(hdd_ctx->psoc, roam_scan_period * 1000)) @@ -5575,8 +5575,8 @@ hdd_send_roam_scan_period_to_sme(struct hdd_context *hdd_ctx, if (QDF_IS_STATUS_ERROR(status)) return status; - roam_scan_period_global = - sme_get_empty_scan_refresh_period_global(hdd_ctx->mac_handle); + ucfg_cm_get_empty_scan_refresh_period_global(hdd_ctx->psoc, + &roam_scan_period_global); if (check_and_update && roam_scan_period_current != roam_scan_period_global) { hdd_debug("roam scan period is already updated, value: %u", diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 7de47d5483..6b699b6e0f 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -2972,11 +2972,11 @@ static int drv_cmd_get_roam_scan_refresh_period(struct hdd_adapter *adapter, struct hdd_priv_data *priv_data) { int ret = 0; - uint16_t value = - sme_get_neighbor_scan_refresh_period(hdd_ctx->mac_handle); + uint16_t value = 0; char extra[32]; uint8_t len; + ucfg_cm_get_neighbor_scan_refresh_period(hdd_ctx->psoc, &value); len = scnprintf(extra, sizeof(extra), "%s %d", "GETROAMSCANREFRESHPERIOD", (value / 1000)); diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index aebeec958c..661ef25d74 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1050,15 +1050,6 @@ sme_set_neighbor_lookup_rssi_threshold(mac_handle_t mac_handle, QDF_STATUS sme_set_neighbor_scan_refresh_period(mac_handle_t mac_handle, uint8_t sessionId, uint16_t neighborScanResultsRefreshPeriod); -uint16_t sme_get_neighbor_scan_refresh_period(mac_handle_t mac_handle); - -/** - * sme_get_empty_scan_refresh_period_global() - get global scan refresh period - * @mac_handle: The handle returned by mac_open - * - * Return: Empty scan refresh period configured through ini - */ -uint16_t sme_get_empty_scan_refresh_period_global(mac_handle_t mac_handle); QDF_STATUS sme_update_empty_scan_refresh_period(mac_handle_t mac_handle, uint8_t sessionId, uint16_t empty_scan_refresh_period); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 0cbfaf6e09..af2adc75f5 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -6601,28 +6601,6 @@ QDF_STATUS sme_set_neighbor_scan_refresh_period(mac_handle_t mac_handle, &src_config); } -/* - * sme_get_neighbor_scan_refresh_period() - get neighbor scan results - * refresh period - * This is a synchronous call - * - * \param mac_handle - The handle returned by mac_open. - * \return uint16_t - Neighbor scan results refresh period value - */ -uint16_t sme_get_neighbor_scan_refresh_period(mac_handle_t mac_handle) -{ - struct mac_context *mac = MAC_CONTEXT(mac_handle); - - return mac->mlme_cfg->lfr.neighbor_scan_results_refresh_period; -} - -uint16_t sme_get_empty_scan_refresh_period_global(mac_handle_t mac_handle) -{ - struct mac_context *mac = MAC_CONTEXT(mac_handle); - - return mac->mlme_cfg->lfr.empty_scan_refresh_period; -} - /* * sme_update_empty_scan_refresh_period * Update empty_scan_refresh_period