From f6834c4b4cd79b6d733cc7fccecfd61a124d2982 Mon Sep 17 00:00:00 2001 From: Rachit Kankane Date: Thu, 2 Aug 2018 18:47:50 +0530 Subject: [PATCH] qcacld-3.0: Featurize Dynamic Voltage Config Host provides INI way to control voltage configs, featurizing the same for Genoa. Change-Id: Ia58d84eb2e2a67ead189a51d2a0b98230513f8f9 CRs-Fixed: 2304125 --- Kbuild | 3 +++ configs/default_defconfig | 3 +++ configs/genoa.common | 4 ++++ configs/genoa.snoc.debug_defconfig | 2 ++ configs/genoa.snoc.perf_defconfig | 3 +++ core/hdd/inc/wlan_hdd_cfg.h | 2 ++ core/hdd/src/wlan_hdd_cfg.c | 2 ++ core/hdd/src/wlan_hdd_main.c | 14 +++++++++++++- core/sme/inc/sme_api.h | 2 ++ core/sme/src/common/sme_api.c | 2 ++ core/wma/inc/wma_api.h | 2 ++ core/wma/src/wma_utils.c | 2 ++ 12 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Kbuild b/Kbuild index 34159594e157..36fb1e29fcbf 100755 --- a/Kbuild +++ b/Kbuild @@ -2260,6 +2260,9 @@ cppflags-$(CONFIG_WLAN_NUD_TRACKING) += -DWLAN_NUD_TRACKING #Flag to enable set and get disable channel list feature cppflags-$(CONFIG_DISABLE_CHANNEL_LIST) += -DDISABLE_CHANNEL_LIST +#Flag to enable Dynamic Voltage WDCVS (Config Voltage Mode) +cppflags-$(CONFIG_WLAN_DYNAMIC_CVM) += -DFEATURE_WLAN_DYNAMIC_CVM + # configure log buffer size ifdef CONFIG_CFG_NUM_DP_TRACE_RECORD ccflags-y += -DMAX_QDF_DP_TRACE_RECORDS=$(CONFIG_CFG_NUM_DP_TRACE_RECORD) diff --git a/configs/default_defconfig b/configs/default_defconfig index 98d1e821db14..3731a17f387e 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -548,6 +548,9 @@ CONFIG_WLAN_NUD_TRACKING := y #Flag to enable set and get disable channel list feature CONFIG_DISABLE_CHANNEL_LIST :=y +#Flag to enable Dynamic Voltage WDCVS (Config Voltage Mode) +CONFIG_WLAN_DYNAMIC_CVM := y + CONFIG_WIFI_POS_CONVERGED := y ifneq ($(CONFIG_WIFI_POS_CONVERGED), y) CONFIG_WIFI_POS_LEGACY := y diff --git a/configs/genoa.common b/configs/genoa.common index b99b1ea370cd..2679e3bdda71 100644 --- a/configs/genoa.common +++ b/configs/genoa.common @@ -45,6 +45,10 @@ CONFIG_WLAN_FEATURE_DSRC := n CONFIG_FEATURE_MONITOR_MODE_SUPPORT := n CONFIG_DP_TRACE := y CONFIG_QCACLD_FEATURE_METERING := n + +#Flag to enable Dynamic Voltage WDCVS (Config Voltage Mode) +CONFIG_WLAN_DYNAMIC_CVM := n + #We might need to disable WEXT support in perf builds in future CONFIG_WLAN_WEXT_SUPPORT_ENABLE := y diff --git a/configs/genoa.snoc.debug_defconfig b/configs/genoa.snoc.debug_defconfig index 3bed4c6755c9..9cce65b2bcb0 100644 --- a/configs/genoa.snoc.debug_defconfig +++ b/configs/genoa.snoc.debug_defconfig @@ -71,6 +71,8 @@ endif # other features +#Flag to enable Dynamic Voltage WDCVS (Config Voltage Mode) +CONFIG_WLAN_DYNAMIC_CVM := y ifeq ($(CONFIG_CNSS2), y) ifeq ($(CONFIG_HIF_PCI), y) CONFIG_PLD_PCIE_CNSS_FLAG := y diff --git a/configs/genoa.snoc.perf_defconfig b/configs/genoa.snoc.perf_defconfig index 102bb88f6d9e..5c8905836bc4 100644 --- a/configs/genoa.snoc.perf_defconfig +++ b/configs/genoa.snoc.perf_defconfig @@ -53,6 +53,9 @@ CONFIG_FEATURE_EPPING := n CONFIG_WLAN_LOG_ENTER := n CONFIG_WLAN_LOG_EXIT := n +#Flag to enable Dynamic Voltage WDCVS (Config Voltage Mode) +CONFIG_WLAN_DYNAMIC_CVM := y + # Features gets enabled on slub debug CONFIG_WLAN_OBJMGR_DEBUG:= n CONFIG_FEATURE_MEMDUMP_ENABLE := n diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 014b13b1f59d..687a80936fd3 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -13926,8 +13926,10 @@ struct hdd_config { /* length includes separator */ char rm_capability[3 * DOT11F_IE_RRMENABLEDCAP_MAX_LEN]; +#ifdef FEATURE_WLAN_DYNAMIC_CVM /* Bitmap for operating voltage corner mode */ uint32_t vc_mode_cfg_bitmap; +#endif #ifdef MWS_COEX /* Bitmap for MWS-COEX 4G Quick FTDM */ diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 9e745f59d469..2d22552cd050 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -618,12 +618,14 @@ struct reg_table_entry g_registry_table[] = { CFG_ENABLE_LTE_COEX_MIN, CFG_ENABLE_LTE_COEX_MAX), +#ifdef FEATURE_WLAN_DYNAMIC_CVM REG_VARIABLE(CFG_VC_MODE_BITMAP, WLAN_PARAM_HexInteger, struct hdd_config, vc_mode_cfg_bitmap, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, CFG_VC_MODE_BITMAP_DEFAULT, CFG_VC_MODE_BITMAP_MIN, CFG_VC_MODE_BITMAP_MAX), +#endif REG_VARIABLE(CFG_ENABLE_SAP_MANDATORY_CHAN_LIST, WLAN_PARAM_Integer, struct hdd_config, enable_sap_mandatory_chan_list, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 091816296bfe..b838c9f8f902 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -10248,6 +10248,18 @@ static void wlan_hdd_p2p_lo_event_callback(void *context, evt->vdev_id); } +#ifdef FEATURE_WLAN_DYNAMIC_CVM +static inline int hdd_set_vc_mode_config(struct hdd_context *hdd_ctx) +{ + return sme_set_vc_mode_config(hdd_ctx->config->vc_mode_cfg_bitmap); +} +#else +static inline int hdd_set_vc_mode_config(struct hdd_context *hdd_ctx) +{ + return QDF_STATUS_SUCCESS; +} +#endif + /** * hdd_adaptive_dwelltime_init() - initialization for adaptive dwell time config * @hdd_ctx: HDD context @@ -10456,7 +10468,7 @@ static int hdd_features_init(struct hdd_context *hdd_ctx) if (hdd_ctx->config->enable_go_cts2self_for_sta) sme_set_cts2self_for_p2p_go(mac_handle); - if (sme_set_vc_mode_config(hdd_ctx->config->vc_mode_cfg_bitmap)) + if (hdd_set_vc_mode_config(hdd_ctx)) hdd_warn("Error in setting Voltage Corner mode config to FW"); if (hdd_rx_ol_init(hdd_ctx)) diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 713aecdcd3b9..b940ff4c322d 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -2152,6 +2152,7 @@ QDF_STATUS sme_send_limit_off_channel_params(tHalHandle hal, uint8_t vdev_id, bool is_tos_active, uint32_t max_off_chan_time, uint32_t rest_time, bool skip_dfs_chan); +#ifdef FEATURE_WLAN_DYNAMIC_CVM /** * sme_set_vc_mode_config() - Set voltage corner config to FW. * @bitmap: Bitmap that refers to voltage corner config with @@ -2160,6 +2161,7 @@ QDF_STATUS sme_send_limit_off_channel_params(tHalHandle hal, uint8_t vdev_id, * Return: QDF_STATUS */ QDF_STATUS sme_set_vc_mode_config(uint32_t vc_bitmap); +#endif /** * sme_set_del_pmkid_cache() - API to update PMKID cache diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 2e0b58c2631f..964f0ab03307 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -15633,6 +15633,7 @@ void sme_display_disconnect_stats(tHalHandle hal, uint8_t session_id) session->disconnect_stats.peer_kickout); } +#ifdef FEATURE_WLAN_DYNAMIC_CVM /** * sme_set_vc_mode_config() - Set voltage corner config to FW * @bitmap: Bitmap that referes to voltage corner config with @@ -15659,6 +15660,7 @@ QDF_STATUS sme_set_vc_mode_config(uint32_t vc_bitmap) } return QDF_STATUS_SUCCESS; } +#endif /** * sme_set_bmiss_bcnt() - set bmiss config parameters diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 8d79161dc37e..e5bda039d267 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -364,6 +364,7 @@ QDF_STATUS wma_crash_inject(WMA_HANDLE wma_handle, uint32_t type, */ uint32_t wma_critical_events_in_flight(void); +#ifdef FEATURE_WLAN_DYNAMIC_CVM /** * wma_set_vc_mode_config() - set voltage corner mode config to FW. * @wma_handle: pointer to wma handle. @@ -376,6 +377,7 @@ uint32_t wma_critical_events_in_flight(void); */ QDF_STATUS wma_set_vc_mode_config(void *wma_handle, uint32_t vc_bitmap); +#endif QDF_STATUS wma_process_dhcp_ind(WMA_HANDLE wma_handle, tAniDHCPInd *ta_dhcp_ind); diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 68df2c61ffa5..83a7637cd6a3 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -4523,6 +4523,7 @@ tSirWifiPeerType wmi_to_sir_peer_type(enum wmi_peer_type type) } #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ +#ifdef FEATURE_WLAN_DYNAMIC_CVM /** * wma_set_vc_mode_config() - set voltage corner mode config to FW. * @wma_handle: pointer to wma handle. @@ -4557,6 +4558,7 @@ QDF_STATUS wma_set_vc_mode_config(void *wma_handle, return QDF_STATUS_SUCCESS; } +#endif int wma_chip_power_save_failure_detected_handler(void *handle, uint8_t *cmd_param_info,