From 585217225c99033ae4d7c9a0b38c0e139f1e25a9 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Mon, 7 Jan 2019 14:15:32 +0800 Subject: [PATCH] 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 --- pmo/core/src/wlan_pmo_main.c | 8 ++++- pmo/dispatcher/inc/wlan_pmo_common_cfg.h | 28 ++++++++++++++-- .../inc/wlan_pmo_common_public_struct.h | 3 +- pmo/dispatcher/inc/wlan_pmo_pkt_filter_cfg.h | 27 ++++++++++++++-- pmo/dispatcher/inc/wlan_pmo_ucfg_api.h | 32 ++++++++++++++++++- pmo/dispatcher/src/wlan_pmo_ucfg_api.c | 18 ++++++++++- 6 files changed, 107 insertions(+), 9 deletions(-) diff --git a/pmo/core/src/wlan_pmo_main.c b/pmo/core/src/wlan_pmo_main.c index 8b1b837c0d..3af7dc4774 100644 --- a/pmo/core/src/wlan_pmo_main.c +++ b/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) diff --git a/pmo/dispatcher/inc/wlan_pmo_common_cfg.h b/pmo/dispatcher/inc/wlan_pmo_common_cfg.h index 88eef48354..88993cfd7c 100644 --- a/pmo/dispatcher/inc/wlan_pmo_common_cfg.h +++ b/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") +/* + * + * 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 + * + * + */ +#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__ */ diff --git a/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h b/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h index 9c7279aee4..d9241ce772 100644 --- a/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h +++ b/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; }; /** diff --git a/pmo/dispatcher/inc/wlan_pmo_pkt_filter_cfg.h b/pmo/dispatcher/inc/wlan_pmo_pkt_filter_cfg.h index a4b8a6ef82..3b1a28d530 100644 --- a/pmo/dispatcher/inc/wlan_pmo_pkt_filter_cfg.h +++ b/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__ +/* + * + * gDisablePacketFilter - Disable packet filter disable + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * + * Related: None + * + * Usage: External + * + * + */ +#define CFG_PMO_DISABLE_PKT_FILTER CFG_INI_BOOL( \ + "gDisablePacketFilter", \ + true, \ + "Disable packet filter feature") + #ifdef WLAN_FEATURE_PACKET_FILTERING /* * @@ -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__ */ diff --git a/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h b/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h index 6b8422fc6c..ee2eae09f6 100644 --- a/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h +++ b/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 diff --git a/pmo/dispatcher/src/wlan_pmo_ucfg_api.c b/pmo/dispatcher/src/wlan_pmo_ucfg_api.c index 775212ff74..58dac26ec6 100644 --- a/pmo/dispatcher/src/wlan_pmo_ucfg_api.c +++ b/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; +}