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
This commit is contained in:
Dustin Brown
2016-11-23 12:25:33 -08:00
committed by qcabuildsw
parent 1ee72881bc
commit cd756941d2
8 changed files with 53 additions and 33 deletions

4
Kbuild
View File

@@ -1479,10 +1479,6 @@ ifeq ($(CONFIG_SMP),y)
CDEFINES += -DQCA_CONFIG_SMP CDEFINES += -DQCA_CONFIG_SMP
endif endif
ifeq ($(CONFIG_WLAN_FEATURE_RX_WAKELOCK), y)
CDEFINES += -DWLAN_FEATURE_HOLD_RX_WAKELOCK
endif
#Enable Channel Matrix restriction for all Rome only targets #Enable Channel Matrix restriction for all Rome only targets
ifneq (y,$(filter y,$(CONFIG_CNSS_EOS) $(CONFIG_ICNSS))) ifneq (y,$(filter y,$(CONFIG_CNSS_EOS) $(CONFIG_ICNSS)))
CDEFINES += -DWLAN_ENABLE_CHNL_MATRIX_RESTRICTION CDEFINES += -DWLAN_ENABLE_CHNL_MATRIX_RESTRICTION

View File

@@ -108,10 +108,6 @@ config WLAN_LRO
depends on CONFIG_INET_LRO depends on CONFIG_INET_LRO
default n default n
config WLAN_FEATURE_RX_WAKELOCK
bool "Enable RX wake lock feature"
default n
config WLAN_SYNC_TSF config WLAN_SYNC_TSF
bool "Enable QCOM sync multi devices tsf feature" bool "Enable QCOM sync multi devices tsf feature"
default n default n

View File

@@ -3597,6 +3597,29 @@ enum dot11p_mode {
#define CFG_CRASH_FW_TIMEOUT_ENABLE (1) #define CFG_CRASH_FW_TIMEOUT_ENABLE (1)
#define CFG_CRASH_FW_TIMEOUT_DEFAULT (0) #define CFG_CRASH_FW_TIMEOUT_DEFAULT (0)
/*
* <ini>
* rx_wakelock_timeout - Amount of time to hold wakelock for RX unicast packets
* @Min: 0
* @Max: 100
* @Default: 50
*
* This ini item configures the amount of time, in milliseconds, that the driver
* should prevent system power collapse after receiving an RX unicast packet.
* A conigured value of 0 disables the RX Wakelock feature completely.
*
* Related: None.
*
* Supported Feature: RX Wakelock
*
* Usage: Internal/External
*
* </ini>
*/
#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 Type declarations
@@ -4269,6 +4292,7 @@ struct hdd_config {
bool sta_prefer_80MHz_over_160MHz; bool sta_prefer_80MHz_over_160MHz;
uint8_t sap_max_inactivity_override; uint8_t sap_max_inactivity_override;
bool fw_timeout_crash; bool fw_timeout_crash;
uint32_t rx_wakelock_timeout;
}; };
#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

View File

@@ -219,9 +219,6 @@
#define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14 #define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14
#define WLAN_HDD_TDLS_ACTION_FRAME 12 #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_ACTION_FRAME 1
#define WLAN_HDD_QOS_MAP_CONFIGURE 4 #define WLAN_HDD_QOS_MAP_CONFIGURE 4
@@ -1341,10 +1338,7 @@ struct hdd_context_s {
/** P2P Device MAC Address for the adapter */ /** P2P Device MAC Address for the adapter */
struct qdf_mac_addr p2pDeviceAddress; struct qdf_mac_addr p2pDeviceAddress;
#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
qdf_wake_lock_t rx_wake_lock; qdf_wake_lock_t rx_wake_lock;
#endif
qdf_wake_lock_t sap_wake_lock; qdf_wake_lock_t sap_wake_lock;
#ifdef FEATURE_WLAN_TDLS #ifdef FEATURE_WLAN_TDLS

View File

@@ -4048,6 +4048,12 @@ REG_TABLE_ENTRY g_registry_table[] = {
CFG_CRASH_FW_TIMEOUT_DEFAULT, CFG_CRASH_FW_TIMEOUT_DEFAULT,
CFG_CRASH_FW_TIMEOUT_DISABLE, CFG_CRASH_FW_TIMEOUT_DISABLE,
CFG_CRASH_FW_TIMEOUT_ENABLE), 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)
}; };
/** /**

View File

@@ -4654,7 +4654,6 @@ out:
return ret; return ret;
} }
#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
/** /**
* hdd_rx_wake_lock_destroy() - Destroy RX wakelock * hdd_rx_wake_lock_destroy() - Destroy RX wakelock
* @hdd_ctx: HDD context. * @hdd_ctx: HDD context.
@@ -4680,10 +4679,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"); 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 * hdd_roc_context_init() - Init ROC context

View File

@@ -662,13 +662,18 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
sizeof(qdf_nbuf_data(rxBuf)), QDF_RX)); sizeof(qdf_nbuf_data(rxBuf)), QDF_RX));
skb->protocol = eth_type_trans(skb, skb->dev); skb->protocol = eth_type_trans(skb, skb->dev);
#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
cds_host_diag_log_work(&pHddCtx->rx_wake_lock, /* hold configurable wakelock for unicast traffic */
HDD_WAKE_LOCK_DURATION, if (pHddCtx->config->rx_wakelock_timeout &&
WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); skb->pkt_type != PACKET_BROADCAST &&
qdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock, skb->pkt_type != PACKET_MULTICAST) {
HDD_WAKE_LOCK_DURATION); cds_host_diag_log_work(&pHddCtx->rx_wake_lock,
#endif 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 /* Remove SKB from internal tracking table before submitting
* it to stack * it to stack

View File

@@ -1013,13 +1013,17 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK /* hold configurable wakelock for unicast traffic */
cds_host_diag_log_work(&pHddCtx->rx_wake_lock, if (pHddCtx->config->rx_wakelock_timeout &&
HDD_WAKE_LOCK_DURATION, skb->pkt_type != PACKET_BROADCAST &&
WIFI_POWER_EVENT_WAKELOCK_HOLD_RX); skb->pkt_type != PACKET_MULTICAST) {
qdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock, cds_host_diag_log_work(&pHddCtx->rx_wake_lock,
HDD_WAKE_LOCK_DURATION); pHddCtx->config->rx_wakelock_timeout,
#endif 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 /* Remove SKB from internal tracking table before submitting
* it to stack * it to stack