From 456aa70f29f7d1253b36644a15f86200c85c567c Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Tue, 17 Sep 2019 14:19:50 +0530 Subject: [PATCH] qcacld-3.0: Update empty scan refresh period to neighbor info only Currently, roam empty scan refresh period is updated to global mac ctx when it's updated through DRIVER command. But the update should happen only to the neighbor roam info of the corresponding vdev. Retrieval also should happen based on vdev. Change-Id: Ic0496c326bca459c6ef6da1d84f1fd4645373cb9 CRs-Fixed: 2530335 --- core/hdd/src/wlan_hdd_ioctl.c | 13 +++++++++++-- core/sme/inc/sme_api.h | 14 +++++++++++++- core/sme/src/common/sme_api.c | 33 ++++++++++++++++++++------------- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index dde16c4b55a9..b10cfb24467a 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -3610,10 +3610,19 @@ static int drv_cmd_get_roam_scan_period(struct hdd_adapter *adapter, struct hdd_priv_data *priv_data) { int ret = 0; - uint16_t empty_scan_refresh_period = - sme_get_empty_scan_refresh_period(hdd_ctx->mac_handle); + uint16_t empty_scan_refresh_period; char extra[32]; uint8_t len; + QDF_STATUS status; + + status = sme_get_empty_scan_refresh_period(hdd_ctx->mac_handle, + adapter->vdev_id, + &empty_scan_refresh_period); + if (QDF_IS_STATUS_ERROR(status)) + return qdf_status_to_os_return(status); + + hdd_debug("vdev_id: %u, empty_scan_refresh_period: %u", + adapter->vdev_id, empty_scan_refresh_period); qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD, TRACE_CODE_HDD_GETROAMSCANPERIOD_IOCTL, diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index a743dcaec2d5..4bee18a78293 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -847,7 +847,19 @@ QDF_STATUS sme_get_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); -uint16_t sme_get_empty_scan_refresh_period(mac_handle_t mac_handle); + +/** + * sme_get_empty_scan_refresh_period() - get empty scan refresh period + * @mac_handle: The handle returned by mac_open. + * @vdev_id: vdev identifier + * @refresh_threshold: Buffer to fill the empty scan refresh period. + * Valid only if the return status is success. + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_get_empty_scan_refresh_period(mac_handle_t mac_handle, + uint8_t vdev_id, + uint16_t *refresh_threshold); 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 6cec80d5d2b4..1955a3946697 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -6739,19 +6739,28 @@ uint16_t sme_get_neighbor_scan_refresh_period(mac_handle_t mac_handle) return mac->mlme_cfg->lfr.neighbor_scan_results_refresh_period; } -/* - * sme_get_empty_scan_refresh_period() - get empty scan refresh period - * This is a synchronuous call - * - * mac_handle - The handle returned by mac_open. - * Return QDF_STATUS_SUCCESS - SME update config successful. - * Other status means SME is failed to update - */ -uint16_t sme_get_empty_scan_refresh_period(mac_handle_t mac_handle) +QDF_STATUS sme_get_empty_scan_refresh_period(mac_handle_t mac_handle, + uint8_t vdev_id, + uint16_t *refresh_threshold) { struct mac_context *mac = MAC_CONTEXT(mac_handle); + tCsrNeighborRoamControlInfo *neighbor_roam_info; + QDF_STATUS status; - return mac->mlme_cfg->lfr.empty_scan_refresh_period; + if (vdev_id >= WLAN_MAX_VDEVS) { + sme_err("Invalid vdev_id: %d", vdev_id); + return QDF_STATUS_E_INVAL; + } + status = sme_acquire_global_lock(&mac->sme); + if (QDF_IS_STATUS_ERROR(status)) + return status; + neighbor_roam_info = &mac->roam.neighborRoamInfo[vdev_id]; + + *refresh_threshold = + neighbor_roam_info->cfgParams.emptyScanRefreshPeriod; + sme_release_global_lock(&mac->sme); + + return QDF_STATUS_SUCCESS; } /* @@ -6788,13 +6797,11 @@ QDF_STATUS sme_update_empty_scan_refresh_period(mac_handle_t mac_handle, QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG, "LFR runtime successfully set roam scan period to %d -old value is %d - roam state is %s", empty_scan_refresh_period, - mac->mlme_cfg->lfr.empty_scan_refresh_period, + pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod, mac_trace_get_neighbour_roam_state(mac->roam. neighborRoamInfo [sessionId]. neighborRoamState)); - mac->mlme_cfg->lfr.empty_scan_refresh_period = - empty_scan_refresh_period; pNeighborRoamInfo->cfgParams.emptyScanRefreshPeriod = empty_scan_refresh_period;