From d454d427932e495f833ce50d14eb73644445828a Mon Sep 17 00:00:00 2001 From: Arun Khandavalli Date: Wed, 17 Aug 2016 12:47:05 +0530 Subject: [PATCH] qcacld-3.0: Increase WMA_STA_WOW_DEFAULT_PTRN_MAX to 5 qcacld-2.0 to qcacld-3.0 propagation The problem with the existing code is: * WMA_STA_WOW_DEFAULT_PTRN_MAX is set to 4 and in wma_wow_sta() we make sure atleast WMA_STA_WOW_DEFAULT_PTRN_MAX free slots are available before configuring the default wow pattern. But after this check we are actually configuring 5 default wow patterns. * If BPF is enabled, we are limiting the Max WoW patterns to 2, because the free slots are 2 which is less than the expected default free slots WMA_STA_WOW_DEFAULT_PTRN_MAX. we are not configuring default STA mode wow pattern and hence no wakeups observed for incoming packets. Address this issue by changing the WMA_STA_WOW_DEFAULT_PTRN_MAX to 5 and MAX WoW filters to WMA_STA_WOW_DEFAULT_PTRN_MAX if BPF is enabled. Change-Id: If433cff18ce511e7fdffadff69ee13b762a1719b CRs-Fixed: 973054 --- core/hdd/src/wlan_hdd_main.c | 7 ++++++- core/wma/inc/wma.h | 2 +- core/wma/inc/wma_types.h | 2 -- core/wma/src/wma_main.c | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 249d31db769e..0090d0b0d4ec 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1497,8 +1497,13 @@ void hdd_update_tgt_cfg(void *context, void *param) hdd_ctx->bpf_enabled = (cfg->bpf_enabled && hdd_ctx->config->bpf_packet_filter_enable); + /* + * If BPF is enabled, maxWowFilters set to WMA_STA_WOW_DEFAULT_PTRN_MAX + * because we need atleast WMA_STA_WOW_DEFAULT_PTRN_MAX free slots to + * configure the STA mode wow pattern. + */ if (hdd_ctx->bpf_enabled) - hdd_ctx->config->maxWoWFilters = MAX_WOW_FILTERS; + hdd_ctx->config->maxWoWFilters = WMA_STA_WOW_DEFAULT_PTRN_MAX; /* Configure NAN datapath features */ hdd_nan_datapath_target_config(hdd_ctx, cfg); diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index fc37487ba183..f7ecbd58a4cc 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -243,7 +243,7 @@ enum ds_mode { #define WMA_NUM_BITS_IN_BYTE 8 #define WMA_AP_WOW_DEFAULT_PTRN_MAX 4 -#define WMA_STA_WOW_DEFAULT_PTRN_MAX 4 +#define WMA_STA_WOW_DEFAULT_PTRN_MAX 5 #define WMA_BSS_STATUS_STARTED 0x1 #define WMA_BSS_STATUS_STOPPED 0x2 diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index c63042e328b4..a49ad83552f3 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -475,8 +475,6 @@ /* Bit 6 will be used to control BD rate for Management frames */ #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 -#define MAX_WOW_FILTERS 2 - #define wma_tx_frame(hHal, pFrmBuf, frmLen, frmType, txDir, tid, pCompFunc, \ pData, txFlag, sessionid, channel_freq) \ (QDF_STATUS)( wma_tx_packet( \ diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index d7036b981a37..d1cb9f37c658 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -3324,7 +3324,7 @@ static void wma_update_fw_config(tp_wma_handle wma_handle, if (WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap, WMI_SERVICE_BPF_OFFLOAD)) tgt_cap->wlan_resource_config.num_wow_filters = - MAX_WOW_FILTERS; + WMA_STA_WOW_DEFAULT_PTRN_MAX; } /**