From 4decc31941af1c5d0523b64d864634d4eb764f4c Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Thu, 15 Jun 2017 14:17:25 -0700 Subject: [PATCH] qcacmn: Add 11d scan as wakeup event 11d scan is scheduled every one hour.The HOST can be asleep when new country is found. So add 11d scan as wakeup event. Change-Id: I495c010b9c1224ab17fc0b082292befaa6b4f1e8 CRs-Fixed: 2057841 --- pmo/core/src/wlan_pmo_wow.c | 6 ++++++ umac/regulatory/core/src/reg_services.c | 16 ++++++++++++++++ umac/regulatory/core/src/reg_services.h | 2 ++ .../dispatcher/inc/wlan_reg_services_api.h | 7 +++++++ .../dispatcher/src/wlan_reg_services_api.c | 5 +++++ 5 files changed, 36 insertions(+) diff --git a/pmo/core/src/wlan_pmo_wow.c b/pmo/core/src/wlan_pmo_wow.c index 95f649a48202..f6feec918629 100644 --- a/pmo/core/src/wlan_pmo_wow.c +++ b/pmo/core/src/wlan_pmo_wow.c @@ -25,6 +25,8 @@ #include "wlan_pmo_obj_mgmt_public_struct.h" #include #include "wlan_pmo_static_config.h" +#include "wlan_reg_services_api.h" + static inline int pmo_find_wow_ptrn_len(const char *ptrn) { @@ -199,6 +201,10 @@ bool pmo_core_is_wow_applicable(struct wlan_objmgr_psoc *psoc) return true; } + if (wlan_reg_is_11d_scan_inprogress(psoc)) { + pmo_debug("11d scan is in progress, enabling wow"); + return true; + } /* Iterate through VDEV list */ for (vdev_id = 0; vdev_id < WLAN_UMAC_PSOC_MAX_VDEVS; vdev_id++) { vdev = pmo_psoc_get_vdev(psoc, vdev_id); diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index 73f2d2633b3a..036e36eadf53 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -2008,6 +2008,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification( soc_reg_obj->dfs_enabled = true; soc_reg_obj->set_fcc_channel = false; soc_reg_obj->band_capability = BAND_ALL; + soc_reg_obj->enable_11d_supp = false; soc_reg_obj->indoor_chan_enabled = true; soc_reg_obj->master_vdev_cnt = 0; soc_reg_obj->vdev_cnt_11d = 0; @@ -2922,6 +2923,21 @@ QDF_STATUS reg_program_chan_list(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +bool reg_is_11d_scan_inprogress(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj; + + psoc_priv_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, + WLAN_UMAC_COMP_REGULATORY); + + if (!psoc_priv_obj) { + reg_err("reg psoc private obj is NULL"); + return false; + } + + return psoc_priv_obj->enable_11d_supp; +} + QDF_STATUS reg_get_current_cc(struct wlan_objmgr_psoc *psoc, struct cc_regdmn_s *rd) { diff --git a/umac/regulatory/core/src/reg_services.h b/umac/regulatory/core/src/reg_services.h index d03165383f51..47c74912b255 100644 --- a/umac/regulatory/core/src/reg_services.h +++ b/umac/regulatory/core/src/reg_services.h @@ -318,6 +318,8 @@ struct chan_change_cbk_entry { void *arg; }; +bool reg_is_11d_scan_inprogress(struct wlan_objmgr_psoc *psoc); + enum country_src reg_get_cc_and_src(struct wlan_objmgr_psoc *psoc, uint8_t *alpha2); diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index bd3ff7e63830..793ec02f99e1 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -386,6 +386,13 @@ bool wlan_reg_11d_enabled_on_host(struct wlan_objmgr_psoc *psoc); QDF_STATUS wlan_reg_get_chip_mode(struct wlan_objmgr_pdev *pdev, uint32_t *chip_mode); +/** + * wlan_reg_is_11d_scan_inprogress() - checks 11d scan status + * @psoc: psoc ptr + * + * Return: bool + */ +bool wlan_reg_is_11d_scan_inprogress(struct wlan_objmgr_psoc *psoc); /** * wlan_reg_get_freq_range() - Get 2GHz and 5GHz frequency range * @pdev: pdev pointer diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index bce948270034..3a8d7d3bccc4 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -452,6 +452,11 @@ QDF_STATUS wlan_reg_get_chip_mode(struct wlan_objmgr_pdev *pdev, return QDF_STATUS_SUCCESS; } +bool wlan_reg_is_11d_scan_inprogress(struct wlan_objmgr_psoc *psoc) +{ + return reg_is_11d_scan_inprogress(psoc); +} + QDF_STATUS wlan_reg_get_freq_range(struct wlan_objmgr_pdev *pdev, uint32_t *low_2g, uint32_t *high_2g,