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

qcacld-3.0: Refactor one WNI cfg and two INI cfg about PMO

Based on new cfg framework, refactor below WNI and INI cfg items:
 - WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT
 - g_wow_data_inactivity_timeout
 - gDisablePacketFilter

Change-Id: I9a975263021ba4fd5ccea19ed1147a661f73317f
CRs-Fixed: 2375866
Wu Gao 6 жил өмнө
parent
commit
585217225c

+ 7 - 1
pmo/core/src/wlan_pmo_main.c

@@ -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
@@ -123,11 +123,15 @@ static void wlan_pmo_pkt_filter_init_cfg(struct wlan_objmgr_psoc *psoc,
 					 struct pmo_psoc_cfg *psoc_cfg)
 {
 	psoc_cfg->packet_filters_bitmap = cfg_get(psoc, CFG_PMO_PKT_FILTER);
+	psoc_cfg->packet_filter_enabled =
+		!cfg_get(psoc, CFG_PMO_DISABLE_PKT_FILTER);
 }
 #else
 static void wlan_pmo_pkt_filter_init_cfg(struct wlan_objmgr_psoc *psoc,
 					 struct pmo_psoc_cfg *psoc_cfg)
 {
+	psoc_cfg->packet_filter_enabled =
+		!cfg_get(psoc, CFG_PMO_DISABLE_PKT_FILTER);
 }
 #endif
 
@@ -176,6 +180,8 @@ static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc,
 	psoc_cfg->auto_power_save_fail_mode =
 			cfg_get(psoc, CFG_PMO_PWR_FAILURE);
 	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);
 }
 
 QDF_STATUS pmo_psoc_open(struct wlan_objmgr_psoc *psoc)

+ 26 - 2
pmo/dispatcher/inc/wlan_pmo_common_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
@@ -367,6 +367,29 @@
 			1, \
 			"Enable/disable SAP Suspend")
 
+/*
+ * <ini>
+ * g_wow_data_inactivity_timeout - Data activity timeout in wow mode.
+ * @Min: 1
+ * @Max: 255
+ * @Default: 50
+ *
+ * This ini is used to set data inactivity timeout in wow mode.
+ *
+ * Supported Feature: inactivity timeout in wow mode
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT CFG_INI_UINT( \
+		"g_wow_data_inactivity_timeout", \
+		1, \
+		255, \
+		50, \
+		CFG_VALUE_OR_DEFAULT, \
+		"Data activity timeout in wow mode")
+
 #define CFG_PMO_COMMON_ALL \
 	CFG(CFG_ENABLE_SAP_SUSPEND) \
 	CFG(CFG_PMO_ENABLE_HOST_ARPOFFLOAD) \
@@ -382,6 +405,7 @@
 	CFG(CFG_PMO_WOWLAN_DISASSOC_ENABLE) \
 	CFG(CFG_PMO_WOW_ENABLE) \
 	CFG(CFG_PMO_ACTIVE_MODE) \
-	CFG(CFG_PMO_PWR_FAILURE)
+	CFG(CFG_PMO_PWR_FAILURE) \
+	CFG(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT)
 
 #endif /* WLAN_PMO_COMMON_CFG_H__ */

+ 2 - 1
pmo/dispatcher/inc/wlan_pmo_common_public_struct.h

@@ -324,6 +324,7 @@ enum pmo_auto_pwr_detect_failure_mode {
  * @wow_pulse_interval_high: The interval of high level in the pulse
  * @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
  */
 struct pmo_psoc_cfg {
 	bool ptrn_match_enable_all_vdev;
@@ -379,7 +380,7 @@ struct pmo_psoc_cfg {
 	uint8_t packet_filters_bitmap;
 #endif
 	bool enable_sap_suspend;
-
+	uint8_t wow_data_inactivity_timeout;
 };
 
 /**

+ 24 - 3
pmo/dispatcher/inc/wlan_pmo_pkt_filter_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
@@ -19,6 +19,25 @@
 #ifndef WLAN_PMO_PACKET_FILTER_CFG_H__
 #define WLAN_PMO_PACKET_FILTER_CFG_H__
 
+/*
+ * <ini>
+ * gDisablePacketFilter - Disable packet filter disable
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ *
+ * Related: None
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_PMO_DISABLE_PKT_FILTER CFG_INI_BOOL( \
+	"gDisablePacketFilter", \
+	true, \
+	"Disable packet filter feature")
+
 #ifdef WLAN_FEATURE_PACKET_FILTERING
 /*
  * <ini>
@@ -56,8 +75,10 @@
 	"Packet filter bitmap configure")
 
 #define CFG_PACKET_FILTER_ALL \
-	CFG(CFG_PMO_PKT_FILTER)
+	CFG(CFG_PMO_PKT_FILTER) \
+	CFG(CFG_PMO_DISABLE_PKT_FILTER)
 #else
-#define CFG_PACKET_FILTER_ALL
+#define CFG_PACKET_FILTER_ALL \
+	CFG(CFG_PMO_DISABLE_PKT_FILTER)
 #endif /* WLAN_FEATURE_PACKET_FILTERING */
 #endif /* WLAN_PMO_PACKET_FILTER_CFG_H__ */

+ 31 - 1
pmo/dispatcher/inc/wlan_pmo_ucfg_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
@@ -982,6 +982,24 @@ bool ucfg_pmo_is_active_mode_offloaded(struct wlan_objmgr_psoc *psoc);
 enum pmo_auto_pwr_detect_failure_mode
 ucfg_pmo_get_auto_power_fail_mode(struct wlan_objmgr_psoc *psoc);
 
+/**
+ * ucfg_pmo_set_wow_data_inactivity_timeout() - Set wow data inactivity timeout
+ * @psoc: pointer to psoc object
+ * @val: wow data inactivity timeout value
+ *
+ * Return: None
+ */
+void
+ucfg_pmo_set_wow_data_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
+					 uint8_t val);
+
+/**
+ * ucfg_pmo_is_pkt_filter_enabled() - pmo packet filter feature enable or not
+ * @psoc: objmgr psoc handle
+ *
+ * Return: pmo packet filter feature enable/disable
+ */
+bool ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc);
 #ifdef FEATURE_WLAN_APF
 /**
  * ucfg_pmo_is_apf_enabled() - to get apf configuration
@@ -1594,6 +1612,18 @@ ucfg_pmo_power_save_offload_enabled(struct wlan_objmgr_psoc *psoc)
 {
 	return 0;
 }
+
+static inline void
+ucfg_pmo_set_wow_data_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
+					 uint8_t val)
+{
+}
+
+static inline bool
+ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc)
+{
+	return false;
+}
 #endif /* WLAN_POWER_MANAGEMENT_OFFLOAD */
 
 #ifdef WLAN_FEATURE_EXTWOW_SUPPORT

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

@@ -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
@@ -790,3 +790,19 @@ ucfg_pmo_get_enable_sap_suspend(struct wlan_objmgr_psoc *psoc)
 
 	return pmo_psoc_ctx->psoc_cfg.enable_sap_suspend;
 }
+
+void
+ucfg_pmo_set_wow_data_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
+					 uint8_t val)
+{
+	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
+
+	pmo_psoc_ctx->psoc_cfg.wow_data_inactivity_timeout = val;
+}
+
+bool ucfg_pmo_is_pkt_filter_enabled(struct wlan_objmgr_psoc *psoc)
+{
+	struct pmo_psoc_priv_obj *pmo_psoc_ctx = pmo_psoc_get_priv(psoc);
+
+	return pmo_psoc_ctx->psoc_cfg.packet_filter_enabled;
+}