diff options
| author | Dustin Brown <dustinb@codeaurora.org> | 2016-11-23 12:25:33 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-11-29 15:52:04 -0800 |
| commit | f72db9aeac660404c377131215a6fe3ba2435a0e (patch) | |
| tree | a6c449e9bac336f939ef310d172472d44266e8eb | |
| parent | cc0b1397161d2439adb29784a43a06b1f40d6448 (diff) | |
qcacld-3.0: Make RX wakelock duration configurable
Propagation from qcacld-2.0
Change hard coded RX wakelock duration into an ini configuration item.
Only aquire the wakelock for unicast traffic, and if the configured
wakelock item is greater than 0.
Change-Id: I46b946ddfeae510a5446ff4ab012c09e4964a50c
CRs-Fixed: 1068594
| -rw-r--r-- | Kbuild | 4 | ||||
| -rw-r--r-- | Kconfig | 4 | ||||
| -rw-r--r-- | core/hdd/inc/wlan_hdd_cfg.h | 6 | ||||
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 6 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_cfg.c | 6 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 5 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_softap_tx_rx.c | 19 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_tx_rx.c | 18 |
8 files changed, 35 insertions, 33 deletions
@@ -1399,10 +1399,6 @@ ifeq ($(CONFIG_SMP),y) CDEFINES += -DQCA_CONFIG_SMP endif -ifeq ($(CONFIG_WLAN_FEATURE_RX_WAKELOCK), y) -CDEFINES += -DWLAN_FEATURE_HOLD_RX_WAKELOCK -endif - #Enable Channel Matrix restriction for all Rome only targets ifneq (y,$(filter y,$(CONFIG_CNSS_EOS) $(CONFIG_ICNSS))) CDEFINES += -DWLAN_ENABLE_CHNL_MATRIX_RESTRICTION @@ -108,10 +108,6 @@ config WLAN_LRO depends on CONFIG_INET_LRO default n -config WLAN_FEATURE_RX_WAKELOCK - bool "Enable RX wake lock feature" - default n - config WLAN_SYNC_TSF bool "Enable QCOM sync multi devices tsf feature" default n diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index e097b16ce414..daa93108b37b 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -3614,6 +3614,11 @@ enum dot11p_mode { #define CFG_CRASH_FW_TIMEOUT_ENABLE (1) #define CFG_CRASH_FW_TIMEOUT_DEFAULT (0) +/* Hold wakelock for unicast RX packets for the specified duration */ +#define CFG_RX_WAKELOCK_TIMEOUT_NAME "rx_wakelock_timeout" +#define CFG_RX_WAKELOCK_TIMEOUT_DEFAULT (50) +#define CFG_RX_WAKELOCK_TIMEOUT_MIN (0) +#define CFG_RX_WAKELOCK_TIMEOUT_MAX (100) /*--------------------------------------------------------------------------- Type declarations @@ -4288,6 +4293,7 @@ struct hdd_config { bool sta_prefer_80MHz_over_160MHz; uint8_t sap_max_inactivity_override; bool fw_timeout_crash; + uint32_t rx_wakelock_timeout; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 9321876ec459..fb033a1417fb 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -221,9 +221,6 @@ #define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14 #define WLAN_HDD_TDLS_ACTION_FRAME 12 -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK -#define HDD_WAKE_LOCK_DURATION 50 /* in msecs */ -#endif #define WLAN_HDD_QOS_ACTION_FRAME 1 #define WLAN_HDD_QOS_MAP_CONFIGURE 4 @@ -1363,10 +1360,7 @@ struct hdd_context_s { /** P2P Device MAC Address for the adapter */ struct qdf_mac_addr p2pDeviceAddress; -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK qdf_wake_lock_t rx_wake_lock; -#endif - qdf_wake_lock_t sap_wake_lock; #ifdef FEATURE_WLAN_TDLS diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 86fcd53a1bee..015faf43c39d 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -4063,6 +4063,12 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_CRASH_FW_TIMEOUT_DEFAULT, CFG_CRASH_FW_TIMEOUT_DISABLE, CFG_CRASH_FW_TIMEOUT_ENABLE), + REG_VARIABLE(CFG_RX_WAKELOCK_TIMEOUT_NAME, WLAN_PARAM_Integer, + struct hdd_config, rx_wakelock_timeout, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_RX_WAKELOCK_TIMEOUT_DEFAULT, + CFG_RX_WAKELOCK_TIMEOUT_MIN, + CFG_RX_WAKELOCK_TIMEOUT_MAX) }; /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index bb753a1f4944..89ad0e1e6b23 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4658,7 +4658,6 @@ out: return ret; } -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK /** * hdd_rx_wake_lock_destroy() - Destroy RX wakelock * @hdd_ctx: HDD context. @@ -4684,10 +4683,6 @@ static void hdd_rx_wake_lock_create(hdd_context_t *hdd_ctx) { qdf_wake_lock_create(&hdd_ctx->rx_wake_lock, "qcom_rx_wakelock"); } -#else -static void hdd_rx_wake_lock_destroy(hdd_context_t *hdd_ctx) { } -static void hdd_rx_wake_lock_create(hdd_context_t *hdd_ctx) { } -#endif /** * hdd_roc_context_init() - Init ROC context diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index f5c670d1174f..89c232111682 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -621,13 +621,18 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf) sizeof(qdf_nbuf_data(rxBuf)), QDF_RX)); skb->protocol = eth_type_trans(skb, skb->dev); -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - cds_host_diag_log_work(&pHddCtx->rx_wake_lock, - HDD_WAKE_LOCK_DURATION, - WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); - qdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock, - HDD_WAKE_LOCK_DURATION); -#endif + + /* hold configurable wakelock for unicast traffic */ + if (pHddCtx->config->rx_wakelock_timeout && + skb->pkt_type != PACKET_BROADCAST && + skb->pkt_type != PACKET_MULTICAST) { + cds_host_diag_log_work(&pHddCtx->rx_wake_lock, + pHddCtx->config->rx_wakelock_timeout, + WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); + qdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock, + pHddCtx->config-> + rx_wakelock_timeout); + } /* Remove SKB from internal tracking table before submitting * it to stack diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 93283605640c..511f7407248c 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -974,13 +974,17 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf) return QDF_STATUS_SUCCESS; } -#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK - cds_host_diag_log_work(&pHddCtx->rx_wake_lock, - HDD_WAKE_LOCK_DURATION, - WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); - qdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock, - HDD_WAKE_LOCK_DURATION); -#endif + /* hold configurable wakelock for unicast traffic */ + if (pHddCtx->config->rx_wakelock_timeout && + skb->pkt_type != PACKET_BROADCAST && + skb->pkt_type != PACKET_MULTICAST) { + cds_host_diag_log_work(&pHddCtx->rx_wake_lock, + pHddCtx->config->rx_wakelock_timeout, + WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); + qdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock, + pHddCtx->config-> + rx_wakelock_timeout); + } /* Remove SKB from internal tracking table before submitting * it to stack |
