diff --git a/components/pmo/core/src/wlan_pmo_main.c b/components/pmo/core/src/wlan_pmo_main.c
index 8b1b837c0d6a..3af7dc4774d8 100644
--- a/components/pmo/core/src/wlan_pmo_main.c
+++ b/components/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/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h b/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h
index 88eef483541b..88993cfd7cbd 100644
--- a/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h
+++ b/components/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/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h
index 9c7279aee4a7..d9241ce7729d 100644
--- a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h
+++ b/components/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/components/pmo/dispatcher/inc/wlan_pmo_pkt_filter_cfg.h b/components/pmo/dispatcher/inc/wlan_pmo_pkt_filter_cfg.h
index a4b8a6ef82c0..3b1a28d53042 100644
--- a/components/pmo/dispatcher/inc/wlan_pmo_pkt_filter_cfg.h
+++ b/components/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/components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h b/components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h
index 6b8422fc6ca1..ee2eae09f6ec 100644
--- a/components/pmo/dispatcher/inc/wlan_pmo_ucfg_api.h
+++ b/components/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/components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c b/components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c
index 775212ff74bd..58dac26ec66e 100644
--- a/components/pmo/dispatcher/src/wlan_pmo_ucfg_api.c
+++ b/components/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;
+}
diff --git a/core/hdd/src/wlan_hdd_packet_filter.c b/core/hdd/src/wlan_hdd_packet_filter.c
index c1d728dd404e..baea335008e9 100644
--- a/core/hdd/src/wlan_hdd_packet_filter.c
+++ b/core/hdd/src/wlan_hdd_packet_filter.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
@@ -109,7 +109,7 @@ int wlan_hdd_set_filter(struct hdd_context *hdd_ctx,
int i = 0;
QDF_STATUS status = QDF_STATUS_SUCCESS;
- if (hdd_ctx->config->disablePacketFilter) {
+ if (!ucfg_pmo_is_pkt_filter_enabled(hdd_ctx->psoc)) {
hdd_warn("Packet filtering disabled in ini");
return 0;
}
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index 13d089f64757..ea2c2e4347f8 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -4183,25 +4183,18 @@ static int hdd_we_set_wow_data_inactivity_timeout(struct hdd_adapter *adapter,
{
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
mac_handle_t mac_handle = hdd_ctx->mac_handle;
- QDF_STATUS status;
if (!mac_handle)
return -EINVAL;
- if ((value < CFG_WOW_DATA_INACTIVITY_TIMEOUT_MIN) ||
- (value > CFG_WOW_DATA_INACTIVITY_TIMEOUT_MAX)) {
+ if (!cfg_in_range(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT, value)) {
hdd_err_rl("Invalid value %d", value);
return -EINVAL;
}
- status = sme_cfg_set_int(mac_handle,
- WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT,
- value);
+ ucfg_pmo_set_wow_data_inactivity_timeout(hdd_ctx->psoc, (uint8_t)value);
- if (QDF_IS_STATUS_ERROR(status))
- hdd_err("cfg set failed, value %d status %d", value, status);
-
- return qdf_status_to_os_return(status);
+ return 0;
}
static int hdd_we_set_tx_power(struct hdd_adapter *adapter, int value)