From 67ce1e332ba417f6ccd7ba641041217183aa14d3 Mon Sep 17 00:00:00 2001 From: Will Huang Date: Wed, 25 Apr 2018 17:57:24 +0800 Subject: [PATCH] qcacld-3.0: Refine PMO wow to support legacy chip wma_is_service_enabled can't get valid service bitmap if call in hdd_update_pmo_config, use psoc_ctx->caps.unified_wow instead to check pattern id per vdev and legacy d0 wow capability. Change-Id: If7bf316f482c49253fc4b95b94e172727b27ffd1 CRs-Fixed: 2225847 --- components/pmo/core/inc/wlan_pmo_wow.h | 16 ++++++++-------- .../inc/wlan_pmo_common_public_struct.h | 2 -- .../dispatcher/src/wlan_pmo_tgt_suspend_resume.c | 4 +++- core/hdd/src/wlan_hdd_main.c | 2 -- core/wma/inc/wma_api.h | 3 +-- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/components/pmo/core/inc/wlan_pmo_wow.h b/components/pmo/core/inc/wlan_pmo_wow.h index 1135861b907f..4399d74f6cb3 100644 --- a/components/pmo/core/inc/wlan_pmo_wow.h +++ b/components/pmo/core/inc/wlan_pmo_wow.h @@ -122,7 +122,7 @@ static inline uint8_t pmo_get_and_increment_wow_default_ptrn( { uint8_t count; - if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.ptrn_id_per_vdev) { + if (vdev_ctx->pmo_psoc_ctx->caps.unified_wow) { qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock); count = vdev_ctx->num_wow_default_patterns++; qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock); @@ -146,7 +146,7 @@ static inline uint8_t pmo_get_and_increment_wow_default_ptrn( static inline void pmo_increment_wow_default_ptrn( struct pmo_vdev_priv_obj *vdev_ctx) { - if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.ptrn_id_per_vdev) { + if (vdev_ctx->pmo_psoc_ctx->caps.unified_wow) { qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock); vdev_ctx->num_wow_default_patterns++; qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock); @@ -168,7 +168,7 @@ static inline void pmo_increment_wow_default_ptrn( static inline void pmo_decrement_wow_default_ptrn( struct pmo_vdev_priv_obj *vdev_ctx) { - if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.ptrn_id_per_vdev) { + if (vdev_ctx->pmo_psoc_ctx->caps.unified_wow) { qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock); vdev_ctx->num_wow_default_patterns--; qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock); @@ -192,7 +192,7 @@ static inline uint8_t pmo_get_wow_default_ptrn( { uint8_t count; - if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.ptrn_id_per_vdev) { + if (vdev_ctx->pmo_psoc_ctx->caps.unified_wow) { qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock); count = vdev_ctx->num_wow_default_patterns; qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock); @@ -216,7 +216,7 @@ static inline uint8_t pmo_get_wow_default_ptrn( static inline void pmo_set_wow_default_ptrn( struct pmo_vdev_priv_obj *vdev_ctx, uint8_t value) { - if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.ptrn_id_per_vdev) { + if (vdev_ctx->pmo_psoc_ctx->caps.unified_wow) { qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock); vdev_ctx->num_wow_default_patterns = value; qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock); @@ -238,7 +238,7 @@ static inline void pmo_set_wow_default_ptrn( static inline void pmo_increment_wow_user_ptrn( struct pmo_vdev_priv_obj *vdev_ctx) { - if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.ptrn_id_per_vdev) { + if (vdev_ctx->pmo_psoc_ctx->caps.unified_wow) { qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock); vdev_ctx->num_wow_user_patterns++; qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock); @@ -260,7 +260,7 @@ static inline void pmo_increment_wow_user_ptrn( static inline void pmo_decrement_wow_user_ptrn( struct pmo_vdev_priv_obj *vdev_ctx) { - if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.ptrn_id_per_vdev) { + if (vdev_ctx->pmo_psoc_ctx->caps.unified_wow) { qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock); vdev_ctx->num_wow_user_patterns--; qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock); @@ -284,7 +284,7 @@ static inline uint8_t pmo_get_wow_user_ptrn( { uint8_t count; - if (vdev_ctx->pmo_psoc_ctx->psoc_cfg.ptrn_id_per_vdev) { + if (vdev_ctx->pmo_psoc_ctx->caps.unified_wow) { qdf_spin_lock_bh(&vdev_ctx->pmo_vdev_lock); count = vdev_ctx->num_wow_user_patterns; qdf_spin_unlock_bh(&vdev_ctx->pmo_vdev_lock); 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 990322fcdec4..a746a4edf4aa 100644 --- a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h +++ b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h @@ -262,7 +262,6 @@ enum pmo_auto_pwr_detect_failure_mode { /** * struct pmo_psoc_cfg - user configuration required for pmo * @ptrn_match_enable_all_vdev: true when pattern match is enable for all vdev - * @ptrn_id_per_vdev: true when pattern id can be same for different vdev * @apf_enable: true if psoc supports bpf else false * @arp_offload_enable: true if arp offload is supported for psoc else false * @hw_filter_mode: which mode the hardware filter should use during DTIM @@ -291,7 +290,6 @@ enum pmo_auto_pwr_detect_failure_mode { */ struct pmo_psoc_cfg { bool ptrn_match_enable_all_vdev; - bool ptrn_id_per_vdev; bool apf_enable; bool arp_offload_enable; enum pmo_hw_filter_mode hw_filter_mode; diff --git a/components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c b/components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c index d7ce34685483..ff6eb5ccdcb1 100644 --- a/components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c +++ b/components/pmo/dispatcher/src/wlan_pmo_tgt_suspend_resume.c @@ -140,7 +140,9 @@ QDF_STATUS pmo_tgt_psoc_send_wow_enable_req(struct wlan_objmgr_psoc *psoc, psoc_ctx = pmo_psoc_get_priv(psoc); pmo_tx_ops = GET_PMO_TX_OPS_FROM_PSOC(psoc); - if (psoc_ctx->psoc_cfg.d0_wow_supported && !param->can_suspend_link) { + if (psoc_ctx->psoc_cfg.d0_wow_supported && + !psoc_ctx->caps.unified_wow && + !param->can_suspend_link) { if (!pmo_tx_ops.psoc_send_d0wow_enable_req) { pmo_err("psoc_send_d0wow_enable_req is null"); return QDF_STATUS_E_NULL_VALUE; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 1cd1f083acab..a58499c76c36 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -12837,8 +12837,6 @@ static int hdd_update_pmo_config(struct hdd_context *hdd_ctx) (hdd_ctx->config->wowEnable & 0x01) ? true : false; psoc_cfg.ptrn_match_enable_all_vdev = (hdd_ctx->config->wowEnable & 0x02) ? true : false; - psoc_cfg.ptrn_id_per_vdev = - wma_is_service_enabled(wmi_service_unified_wow_capability); psoc_cfg.apf_enable = hdd_ctx->config->bpf_packet_filter_enable; psoc_cfg.arp_offload_enable = hdd_ctx->config->fhostArpOffload; psoc_cfg.hw_filter_mode = hdd_ctx->config->hw_filter_mode; diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 419cf94cba8e..c9f29d2182ed 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -309,8 +309,7 @@ bool wma_is_service_enabled(uint32_t service_type); #ifdef FEATURE_WLAN_D0WOW static inline bool wma_d0_wow_is_supported(void) { - return wma_is_service_enabled(WMI_SERVICE_D0WOW) && - (!wma_is_service_enabled(WMI_SERVICE_UNIFIED_WOW_CAPABILITY)); + return true; } #else static inline bool wma_d0_wow_is_supported(void)