Эх сурвалжийг харах

qcacld-3.0: Refactor three INI in PMO

Based on cfg framework, refactor below INI:
 - CFG_RA_RATE_LIMIT_INTERVAL_NAME
 - CFG_ACTIVE_UC_APF_MODE_NAME
 - CFG_ACTIVE_MC_BC_APF_MODE_NAME

Change-Id: I3b1ee6254de158ad6408dc8c61e83be571e180af
CRs-Fixed: 2379743
Wu Gao 6 жил өмнө
parent
commit
f79cd5f0c1

+ 19 - 0
pmo/core/src/wlan_pmo_main.c

@@ -148,6 +148,20 @@ static void wlan_pmo_runtime_pm_init_cfg(struct wlan_objmgr_psoc *psoc,
 }
 #endif
 
+#if FEATURE_WLAN_RA_FILTERING
+static void wlan_pmo_ra_filtering_init_cfg(struct wlan_objmgr_psoc *psoc,
+					   struct pmo_psoc_cfg *psoc_cfg)
+{
+	psoc_cfg->ra_ratelimit_interval =
+			cfg_get(psoc, CFG_RA_RATE_LIMIT_INTERVAL);
+}
+#else
+static void wlan_pmo_ra_filtering_init_cfg(struct wlan_objmgr_psoc *psoc,
+					   struct pmo_psoc_cfg *psoc_cfg)
+{
+}
+#endif
+
 static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc,
 			      struct pmo_psoc_cfg *psoc_cfg)
 {
@@ -182,6 +196,11 @@ static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc,
 	psoc_cfg->enable_sap_suspend = cfg_get(psoc, CFG_ENABLE_SAP_SUSPEND);
 	psoc_cfg->wow_data_inactivity_timeout =
 			cfg_get(psoc, CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT);
+	psoc_cfg->active_uc_apf_mode =
+			cfg_get(psoc, CFG_ACTIVE_UC_APF_MODE);
+	psoc_cfg->active_mc_bc_apf_mode =
+			cfg_get(psoc, CFG_ACTIVE_MC_BC_APF_MODE);
+	wlan_pmo_ra_filtering_init_cfg(psoc, psoc_cfg);
 }
 
 QDF_STATUS pmo_psoc_open(struct wlan_objmgr_psoc *psoc)

+ 58 - 2
pmo/dispatcher/inc/wlan_pmo_apf_cfg.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-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
@@ -38,7 +38,63 @@
 					1, \
 					"Enable APF Support")
 
+/*
+ * <ini>
+ * gActiveUcBpfMode - Control UC active APF mode
+ * @Min: 0 (disabled)
+ * @Max: 2 (adaptive)
+ * @Default: 0 (disabled)
+ *
+ * This config item controls UC APF in active mode. There are 3 modes:
+ *	0) disabled - APF is disabled in active mode
+ *	1) enabled - APF is enabled for all packets in active mode
+ *	2) adaptive - APF is enabled for packets up to some throughput threshold
+ *
+ * Related: gActiveMcBcBpfMode
+ *
+ * Supported Feature: Active Mode APF
+ *
+ * Usage: Internal/External
+ * </ini>
+ */
+#define CFG_ACTIVE_UC_APF_MODE CFG_INI_UINT( \
+	"gActiveUcBpfMode", \
+	ACTIVE_APF_DISABLED, \
+	(ACTIVE_APF_MODE_COUNT - 1), \
+	ACTIVE_APF_DISABLED, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Control UC active APF mode")
+
+/*
+ * <ini>
+ * gActiveMcBcBpfMode - Control MC/BC active APF mode
+ * @Min: 0 (disabled)
+ * @Max: 1 (enabled)
+ * @Default: 0 (disabled)
+ *
+ * This config item controls MC/BC APF in active mode. There are 3 modes:
+ *	0) disabled - APF is disabled in active mode
+ *	1) enabled - APF is enabled for all packets in active mode
+ *	2) adaptive - APF is enabled for packets up to some throughput threshold
+ *
+ * Related: gActiveUcBpfMode
+ *
+ * Supported Feature: Active Mode APF
+ *
+ * Usage: Internal/External
+ * </ini>
+ */
+#define CFG_ACTIVE_MC_BC_APF_MODE CFG_INI_UINT( \
+	"gActiveUcBpfMode", \
+	ACTIVE_APF_DISABLED, \
+	ACTIVE_APF_ENABLED, \
+	ACTIVE_APF_DISABLED, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Control MC/BC active APF mode")
+
 #define CFG_PMO_APF_ALL \
-	CFG(CFG_PMO_APF_ENABLE)
+	CFG(CFG_PMO_APF_ENABLE) \
+	CFG(CFG_ACTIVE_UC_APF_MODE) \
+	CFG(CFG_ACTIVE_MC_BC_APF_MODE)
 
 #endif /* WLAN_PMO_APF_CFG_H__ */

+ 21 - 1
pmo/dispatcher/inc/wlan_pmo_common_cfg.h

@@ -389,6 +389,25 @@
 		50, \
 		CFG_VALUE_OR_DEFAULT, \
 		"Data activity timeout in wow mode")
+/*
+ * <ini>
+ * gRArateLimitInterval - RA rate limit interval
+ * @Min: 60
+ * @Max: 3600
+ * @Default: 60
+ * This ini is used to set RA rate limit interval.
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_RA_RATE_LIMIT_INTERVAL CFG_INI_UINT( \
+	"gRArateLimitInterval", \
+	60, \
+	3600, \
+	60, \
+	CFG_VALUE_OR_DEFAULT, \
+	"RA rate limit interval")
 
 #define CFG_PMO_COMMON_ALL \
 	CFG(CFG_ENABLE_SAP_SUSPEND) \
@@ -406,6 +425,7 @@
 	CFG(CFG_PMO_WOW_ENABLE) \
 	CFG(CFG_PMO_ACTIVE_MODE) \
 	CFG(CFG_PMO_PWR_FAILURE) \
-	CFG(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT)
+	CFG(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT) \
+	CFG(CFG_RA_RATE_LIMIT_INTERVAL)
 
 #endif /* WLAN_PMO_COMMON_CFG_H__ */

+ 22 - 0
pmo/dispatcher/inc/wlan_pmo_common_public_struct.h

@@ -279,6 +279,20 @@ enum pmo_auto_pwr_detect_failure_mode {
 	PMO_AUTO_PWR_FAILURE_DETECT_DISABLE
 };
 
+/**
+ * enum active_apf_mode - the modes active APF can operate in
+ * @ACTIVE_APF_DISABLED: APF is disabled in active mode
+ * @ACTIVE_APF_ENABLED: APF is enabled for all packets
+ * @ACTIVE_APF_ADAPTIVE: APF is enabled for packets up to some threshold
+ * @ACTIVE_APF_MODE_COUNT: The number of active APF modes
+ */
+enum active_apf_mode {
+	ACTIVE_APF_DISABLED = 0,
+	ACTIVE_APF_ENABLED,
+	ACTIVE_APF_ADAPTIVE,
+	ACTIVE_APF_MODE_COUNT
+};
+
 /**
  * struct pmo_psoc_cfg - user configuration required for pmo
  * @ptrn_match_enable_all_vdev: true when pattern match is enable for all vdev
@@ -325,6 +339,10 @@ enum pmo_auto_pwr_detect_failure_mode {
  * @wow_pulse_interval_low: The interval of low level in the pulse
  * @packet_filters_bitmap: Packet filter bitmap configuration
  * @wow_data_inactivity_timeout: power save wow data inactivity timeout
+ * @active_uc_apf_mode: Setting that determines how APF is applied in active
+ *	mode for uc packets
+ * @active_mc_bc_apf_mode: Setting that determines how APF is applied in
+ *	active mode for MC/BC packets
  */
 struct pmo_psoc_cfg {
 	bool ptrn_match_enable_all_vdev;
@@ -340,7 +358,9 @@ struct pmo_psoc_cfg {
 	bool ap_arpns_support;
 	bool d0_wow_supported;
 	bool ra_ratelimit_enable;
+#if FEATURE_WLAN_RA_FILTERING
 	uint16_t ra_ratelimit_interval;
+#endif
 	bool magic_ptrn_enable;
 	bool deauth_enable;
 	bool disassoc_enable;
@@ -381,6 +401,8 @@ struct pmo_psoc_cfg {
 #endif
 	bool enable_sap_suspend;
 	uint8_t wow_data_inactivity_timeout;
+	enum active_apf_mode active_uc_apf_mode;
+	enum active_apf_mode active_mc_bc_apf_mode;
 };
 
 /**

+ 32 - 1
pmo/dispatcher/inc/wlan_pmo_ucfg_api.h

@@ -1000,6 +1000,26 @@ ucfg_pmo_set_wow_data_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
  * Return: pmo packet filter feature enable/disable
  */
 bool ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * ucfg_pmo_get_active_uc_apf_mode() - to get the modes active APF
+ * for MC/BC packets
+ * @psoc: objmgr psoc handle
+ *
+ * Return: the modes active APF
+ */
+enum active_apf_mode
+ucfg_pmo_get_active_uc_apf_mode(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * ucfg_pmo_get_active_mc_bc_apf_mode() - to get the modes active APF
+ * for uc packets
+ * @psoc: objmgr psoc handle
+ *
+ * Return: the modes active APF
+ */
+enum active_apf_mode
+ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc);
 #ifdef FEATURE_WLAN_APF
 /**
  * ucfg_pmo_is_apf_enabled() - to get apf configuration
@@ -1624,6 +1644,18 @@ ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc)
 {
 	return false;
 }
+
+enum active_apf_mode
+ucfg_pmo_get_active_uc_apf_mode(struct wlan_objmgr_psoc *psoc);
+{
+	return 0;
+}
+
+enum active_apf_mode
+ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc)
+{
+	return 0;
+}
 #endif /* WLAN_POWER_MANAGEMENT_OFFLOAD */
 
 #ifdef WLAN_FEATURE_EXTWOW_SUPPORT
@@ -1819,5 +1851,4 @@ ucfg_pmo_get_runtime_pm_delay(struct wlan_objmgr_psoc *psoc)
  */
 bool
 ucfg_pmo_get_enable_sap_suspend(struct wlan_objmgr_psoc *psoc);
-
 #endif /* end  of _WLAN_PMO_UCFG_API_H_ */

+ 17 - 0
pmo/dispatcher/src/wlan_pmo_ucfg_api.c

@@ -806,3 +806,20 @@ bool ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc)
 
 	return pmo_psoc_ctx->psoc_cfg.packet_filter_enabled;
 }
+
+enum active_apf_mode
+ucfg_pmo_get_active_uc_apf_mode(struct wlan_objmgr_psoc *psoc)
+{
+	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
+
+	return pmo_psoc_ctx->psoc_cfg.active_uc_apf_mode;
+}
+
+enum active_apf_mode
+ucfg_pmo_get_active_mc_bc_apf_mode(struct wlan_objmgr_psoc *psoc)
+{
+	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
+
+	return pmo_psoc_ctx->psoc_cfg.active_mc_bc_apf_mode;
+}
+