Browse Source

qcacld-3.0: Clean up code for sme apis

Clean up code for sme_get_empty_scan_refresh_period_global() and
sme_get_neighbor_scan_refresh_period() apis
and replace it with ucfg api.

Change-Id: Iaa511024467f45dc408da3db202b25f9b5276453
CRs-Fixed: 3335898
Krupali Dhanvijay 2 years ago
parent
commit
3ecc75ecc3

+ 25 - 0
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_ */

+ 31 - 0
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;
+}

+ 3 - 3
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",

+ 2 - 2
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));

+ 0 - 9
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);

+ 0 - 22
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