Parcourir la source

qcacld-3.0: In PMO, replace cfg_get_int with component cfg API's

Legacy WNI CFG items are refactored into new CFG implementation.
PMO uses a wma callback which uses cfg_get API to get listen
interval. Listen interval is now part of the MLME component's
private object. Define API's to get this value and use it instead
of the callbacks.

Remove WMA callback implementation and use new API that gets
listen interval from MLME component.

Change-Id: I797001ea14cc654f9daee3ce297e1ad0c0a08f2a
CRs-Fixed: 2386725
Nachiket Kukade il y a 6 ans
Parent
commit
6159553884

+ 10 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -483,6 +483,16 @@ QDF_STATUS wlan_mlme_get_bt_chain_separation_flag(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
 					  uint8_t session_id);
 
+/**
+ * wlan_mlme_get_listen_interval() - Get listen interval
+ * @psoc: pointer to psoc object
+ * @value: Pointer to value that needs to be filled by MLME
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS wlan_mlme_get_listen_interval(struct wlan_objmgr_psoc *psoc,
+					     int *value);
+
 /**
  * wlan_mlme_set_sap_listen_interval() - Set the sap listen interval
  * @psoc: pointer to psoc object

+ 17 - 0
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -1349,6 +1349,23 @@ QDF_STATUS ucfg_mlme_set_rmc_action_period_freq(struct wlan_objmgr_psoc *psoc,
 	return wlan_mlme_set_rmc_action_period_freq(psoc, value);
 }
 
+/**
+ * ucfg_mlme_get_listen_interval() - Get listen interval
+ * @psoc: pointer to psoc object
+ * @value: Pointer to variable that needs to be filled by MLME
+ *
+ * Inline UCFG API to be used by HDD/OSIF callers
+ *
+ * Return: QDF Status
+ */
+static inline
+QDF_STATUS ucfg_mlme_get_listen_interval(struct wlan_objmgr_psoc *psoc,
+					     int *value)
+{
+	return wlan_mlme_get_listen_interval(psoc, value);
+}
+
+
 /**
  * ucfg_mlme_get_sap_get_peer_info() - get the sap get peer info
  * @psoc: pointer to psoc object

+ 14 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -1511,6 +1511,20 @@ wlan_mlme_get_ts_acm_value_for_ac(struct wlan_objmgr_psoc *psoc, bool *value)
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS wlan_mlme_get_listen_interval(struct wlan_objmgr_psoc *psoc,
+					     int *value)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_FAILURE;
+
+	*value = mlme_obj->cfg.sap_cfg.listen_interval;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS wlan_mlme_set_sap_listen_interval(struct wlan_objmgr_psoc *psoc,
 					     int value)
 {

+ 0 - 12
components/pmo/core/inc/wlan_pmo_priv.h

@@ -46,7 +46,6 @@
  * @txrx_hdl: txrx pdev handle
  * @pause_bitmap_notifier: registered callback to update pause bitmap value
  * @pmo_get_pause_bitmap: registered callback to get pause bitmap value
- * @get_cfg_int: register callback to get integer from cfg
  * @get_dtim_period: register callback to get dtim period from mlme
  * @get_beacon_interval: register callback to get beacon interval from mlme
  * @lock: spin lock for pmo psoc
@@ -64,7 +63,6 @@ struct pmo_psoc_priv_obj {
 	pmo_get_pause_bitmap get_pause_bitmap;
 	pmo_get_vdev_dp_handle get_vdev_dp_handle;
 	pmo_is_device_in_low_pwr_mode is_device_in_low_pwr_mode;
-	pmo_get_cfg_int get_cfg_int;
 	pmo_get_dtim_period get_dtim_period;
 	pmo_get_beacon_interval get_beacon_interval;
 	qdf_spinlock_t lock;
@@ -136,15 +134,5 @@ struct pmo_vdev_priv_obj {
 	qdf_spinlock_t pmo_vdev_lock;
 };
 
-/**
- * enum pmo_cfg_int_type: Mapping for Mac config param ID's
- * @PMO_CFG_DTIM_PERIOD: CFG ID for Dtim Period value
- * @PMO_CFG_LISTEN_INTERVAL: CFG ID for Listen Interval value
- */
-enum pmo_cfg_int_type {
-	PMO_CFG_DTIM_PERIOD = 0x5,
-	PMO_CFG_LISTEN_INTERVAL = 0x26,
-};
 #endif /* WLAN_POWER_MANAGEMENT_OFFLOAD */
-
 #endif /* end  of _WLAN_PMO_PRIV_STRUCT_H_ */

+ 0 - 2
components/pmo/core/inc/wlan_pmo_wow.h

@@ -109,8 +109,6 @@
 
 #define PMO_WOW_FILTERS_ARP_NS		2
 #define PMO_WOW_FILTERS_PKT_OR_APF	5
-/* Default Listen Interval */
-#define PMO_DEFAULT_LISTEN_INTERVAL 1
 
 /**
  * pmo_get_and_increment_wow_default_ptrn() -Get and increment wow default ptrn

+ 20 - 20
components/pmo/core/src/wlan_pmo_suspend_resume.c

@@ -35,6 +35,9 @@
 #include <wlan_scan_ucfg_api.h>
 #include "cds_api.h"
 #include "wlan_pmo_static_config.h"
+#include "wlan_mlme_ucfg_api.h"
+#include "cfg_mlme_sap.h"
+#include "cfg_ucfg_api.h"
 
 /**
  * pmo_core_get_vdev_dtim_period() - Get vdev dtim period
@@ -109,7 +112,7 @@ static QDF_STATUS pmo_core_calculate_listen_interval(
 	uint32_t max_mod_dtim;
 	uint32_t beacon_interval_mod;
 	struct pmo_psoc_cfg *psoc_cfg = &vdev_ctx->pmo_psoc_ctx->psoc_cfg;
-	struct pmo_psoc_priv_obj *psoc_priv = pmo_vdev_get_psoc_priv(vdev);
+	struct wlan_objmgr_psoc *psoc = wlan_vdev_get_psoc(vdev);
 
 	if (psoc_cfg->sta_dynamic_dtim) {
 		*listen_interval = psoc_cfg->sta_dynamic_dtim;
@@ -148,15 +151,12 @@ static QDF_STATUS pmo_core_calculate_listen_interval(
 				pmo_core_get_vdev_dtim_period(vdev));
 		}
 	} else {
-		int cfg_value = 0;
 		/* Get Listen Interval */
-		if ((psoc_priv->get_cfg_int) &&
-			(psoc_priv->get_cfg_int(PMO_CFG_LISTEN_INTERVAL,
-				&cfg_value) != QDF_STATUS_SUCCESS)) {
+		if (QDF_IS_STATUS_ERROR(ucfg_mlme_get_listen_interval(psoc,
+							    listen_interval))) {
 			pmo_err("Failed to get value for listen interval");
-			cfg_value = PMO_DEFAULT_LISTEN_INTERVAL;
+			*listen_interval = cfg_default(CFG_LISTEN_INTERVAL);
 		}
-		*listen_interval = cfg_value;
 	}
 	return QDF_STATUS_SUCCESS;
 }
@@ -173,10 +173,10 @@ static void pmo_core_set_vdev_suspend_dtim(struct wlan_objmgr_psoc *psoc,
 		struct wlan_objmgr_vdev *vdev,
 		struct pmo_vdev_priv_obj *vdev_ctx)
 {
-	uint32_t listen_interval = PMO_DEFAULT_LISTEN_INTERVAL;
 	QDF_STATUS ret;
 	uint8_t vdev_id;
 	enum QDF_OPMODE opmode = pmo_core_get_vdev_op_mode(vdev);
+	uint32_t listen_interval = cfg_default(CFG_LISTEN_INTERVAL);
 
 	vdev_id = pmo_vdev_get_id(vdev);
 	if (PMO_VDEV_IN_STA_MODE(opmode) &&
@@ -435,17 +435,15 @@ static void pmo_core_set_vdev_resume_dtim(struct wlan_objmgr_psoc *psoc,
 	uint8_t vdev_id;
 	enum QDF_OPMODE opmode = pmo_core_get_vdev_op_mode(vdev);
 	int32_t cfg_data_val = 0;
-	struct pmo_psoc_priv_obj *psoc_priv = pmo_vdev_get_psoc_priv(vdev);
 
 	vdev_id = pmo_vdev_get_id(vdev);
 	if ((PMO_VDEV_IN_STA_MODE(opmode)) &&
 	    (pmo_core_vdev_get_restore_dtim(vdev))) {
 		/* Get Listen Interval */
-		if ((psoc_priv->get_cfg_int) &&
-			(psoc_priv->get_cfg_int(PMO_CFG_LISTEN_INTERVAL,
-				&cfg_data_val) != QDF_STATUS_SUCCESS)) {
+		if (QDF_IS_STATUS_ERROR(ucfg_mlme_get_listen_interval(psoc,
+							      &cfg_data_val))) {
 			pmo_err("Failed to get value for listen interval");
-			cfg_data_val = PMO_DEFAULT_LISTEN_INTERVAL;
+			cfg_data_val = cfg_default(CFG_LISTEN_INTERVAL);
 		}
 
 		ret = pmo_tgt_vdev_update_param_req(vdev,
@@ -1285,11 +1283,12 @@ out:
 QDF_STATUS pmo_core_config_listen_interval(struct wlan_objmgr_vdev *vdev,
 					   uint32_t new_li)
 {
-	uint32_t listen_interval;
 	QDF_STATUS status;
+	uint8_t vdev_id;
+	uint32_t listen_interval;
 	struct pmo_vdev_priv_obj *vdev_ctx;
 	struct pmo_psoc_priv_obj *psoc_ctx;
-	uint8_t vdev_id;
+	struct wlan_objmgr_psoc *psoc = wlan_vdev_get_psoc(vdev);
 
 	pmo_enter();
 
@@ -1312,16 +1311,17 @@ QDF_STATUS pmo_core_config_listen_interval(struct wlan_objmgr_vdev *vdev,
 	vdev_ctx->dyn_listen_interval = new_li;
 	qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock);
 
-	listen_interval = new_li ? new_li : PMO_DEFAULT_LISTEN_INTERVAL;
+	listen_interval = new_li ? new_li : cfg_default(CFG_LISTEN_INTERVAL);
 
 	if (!new_li) {
 		/* Configure default LI as we do on resume */
 		pmo_psoc_with_ctx(pmo_vdev_get_psoc(vdev), psoc_ctx) {
-			if (psoc_ctx->get_cfg_int &&
-			   (QDF_STATUS_SUCCESS != psoc_ctx->get_cfg_int(
-							PMO_CFG_LISTEN_INTERVAL,
-							&listen_interval))) {
+			if (QDF_IS_STATUS_ERROR(
+				ucfg_mlme_get_listen_interval(psoc,
+							   &listen_interval))) {
 				pmo_err("Failed to get listen interval");
+				listen_interval =
+					       cfg_default(CFG_LISTEN_INTERVAL);
 			}
 		}
 	}

+ 1 - 34
components/pmo/dispatcher/inc/wlan_pmo_obj_mgmt_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -289,26 +289,6 @@ QDF_STATUS pmo_register_is_device_in_low_pwr_mode(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS
 pmo_unregister_is_device_in_low_pwr_mode(struct wlan_objmgr_psoc *psoc);
 
-/**
- * pmo_register_get_cfg_int_callback(): API to register callback for getting
- * cfg integer from mlme
- * @psoc: objmgr psoc handle
- * @handler: get cfg integer callback notifier
- *
- * Return QDF_STATUS status - in case of success else return error
- */
-QDF_STATUS pmo_register_get_cfg_int_callback(struct wlan_objmgr_psoc *psoc,
-					     pmo_get_cfg_int handler);
-
-/**
- * pmo_unregister_get_cfg_int_callback(): API to unregister callback that gets
- * cfg integer from mlme
- * @psoc: objmgr psoc handle
- *
- * Return QDF_STATUS status - in case of success else return error
- */
-QDF_STATUS pmo_unregister_get_cfg_int_callback(struct wlan_objmgr_psoc *psoc);
-
 #else /* WLAN_POWER_MANAGEMENT_OFFLOAD */
 
 static inline QDF_STATUS pmo_init(void)
@@ -447,19 +427,6 @@ pmo_unregister_is_device_in_low_pwr_mode(struct wlan_objmgr_psoc *psoc)
 	return QDF_STATUS_SUCCESS;
 }
 
-static inline QDF_STATUS
-pmo_register_get_cfg_int_callback(struct wlan_objmgr_psoc *psoc,
-				  pmo_get_cfg_int handler)
-{
-	return QDF_STATUS_SUCCESS;
-}
-
-static inline QDF_STATUS
-pmo_unregister_get_cfg_int_callback(struct wlan_objmgr_psoc *psoc)
-{
-	return QDF_STATUS_SUCCESS;
-}
-
 static inline QDF_STATUS
 pmo_register_get_dtim_period_callback(struct wlan_objmgr_psoc *psoc,
 				      pmo_get_dtim_period handler)

+ 1 - 55
components/pmo/dispatcher/src/wlan_pmo_obj_mgmt_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -782,60 +782,6 @@ QDF_STATUS pmo_unregister_get_vdev_dp_handle(struct wlan_objmgr_psoc *psoc)
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS pmo_register_get_cfg_int_callback(struct wlan_objmgr_psoc *psoc,
-					     pmo_get_cfg_int handler)
-{
-	struct pmo_psoc_priv_obj *psoc_ctx;
-	QDF_STATUS status;
-
-	if (!psoc) {
-		pmo_err("psoc is null");
-		return QDF_STATUS_E_NULL_VALUE;
-	}
-
-	if (!handler) {
-		pmo_err("pmo_get_cfg_int is null");
-		return QDF_STATUS_E_NULL_VALUE;
-	}
-
-	status = pmo_psoc_get_ref(psoc);
-	if (status != QDF_STATUS_SUCCESS) {
-		pmo_err("pmo cannot get the reference out of psoc");
-		return status;
-	}
-
-	pmo_psoc_with_ctx(psoc, psoc_ctx) {
-		psoc_ctx->get_cfg_int = handler;
-	}
-	pmo_psoc_put_ref(psoc);
-
-	return QDF_STATUS_SUCCESS;
-}
-
-QDF_STATUS pmo_unregister_get_cfg_int_callback(struct wlan_objmgr_psoc *psoc)
-{
-	struct pmo_psoc_priv_obj *psoc_ctx;
-	QDF_STATUS status;
-
-	if (!psoc) {
-		pmo_err("psoc is null");
-		return QDF_STATUS_E_NULL_VALUE;
-	}
-
-	status = pmo_psoc_get_ref(psoc);
-	if (status != QDF_STATUS_SUCCESS) {
-		pmo_err("pmo cannot get the reference out of psoc");
-		return status;
-	}
-
-	pmo_psoc_with_ctx(psoc, psoc_ctx) {
-		psoc_ctx->get_cfg_int = NULL;
-	}
-	pmo_psoc_put_ref(psoc);
-
-	return QDF_STATUS_SUCCESS;
-}
-
 QDF_STATUS pmo_register_get_dtim_period_callback(struct wlan_objmgr_psoc *psoc,
 						 pmo_get_dtim_period handler)
 {