From 4966f697ef6c0b3beadc559f148e163759495da0 Mon Sep 17 00:00:00 2001 From: Arif Hussain Date: Tue, 27 Nov 2018 16:40:51 -0800 Subject: [PATCH] qcacld-3.0: Refactor CFG_WMI_WQ_WATCHDOG cfg Refactor following CFG_WMI_WQ_WATCHDOG cfg items. Change-Id: Ib65c6cda2a2574940604e8b67bc29a6749add842 CRs-Fixed: 2357070 --- components/mlme/core/src/wlan_mlme_main.c | 2 + .../mlme/dispatcher/inc/cfg_mlme_timeout.h | 27 ++++++++++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 2 + .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 22 ++++++++++ .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 43 +++++++++++++++++++ core/hdd/inc/wlan_hdd_cfg.h | 24 ----------- core/hdd/src/wlan_hdd_cfg.c | 7 --- 7 files changed, 96 insertions(+), 31 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index b9a30f2ccd35..91729344a406 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -585,6 +585,8 @@ static void mlme_init_timeout_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_AP_LINK_MONITOR_TIMEOUT); timeouts->ps_data_inactivity_timeout = cfg_get(psoc, CFG_PS_DATA_INACTIVITY_TIMEOUT); + timeouts->wmi_wq_watchdog_timeout = + cfg_get(psoc, CFG_WMI_WQ_WATCHDOG); } static void mlme_init_ht_cap_in_cfg(struct wlan_objmgr_psoc *psoc, diff --git a/components/mlme/dispatcher/inc/cfg_mlme_timeout.h b/components/mlme/dispatcher/inc/cfg_mlme_timeout.h index 7caed90aa9e3..0c23fe357586 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_timeout.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_timeout.h @@ -285,6 +285,32 @@ CFG_VALUE_OR_DEFAULT, \ "PS data inactivity timeout") +/* + * + * wmi_wq_watchdog - Sets timeout period for wmi watchdog bite. + * @Min: 0 + * @Max: 30 + * @Default: 20 + * + * This ini is used to set timeout period for wmi watchdog bite. If it is + * 0 then wmi watchdog bite is disabled. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: External + * + * + */ +#define CFG_WMI_WQ_WATCHDOG CFG_INI_UINT( \ + "wmi_wq_watchdog", \ + 0, \ + 30, \ + 20, \ + CFG_VALUE_OR_DEFAULT, \ + "timeout period for wmi watchdog bite") + #define CFG_TIMEOUT_ALL \ CFG(CFG_JOIN_FAILURE_TIMEOUT) \ CFG(CFG_AUTH_FAILURE_TIMEOUT) \ @@ -297,6 +323,7 @@ CFG(CFG_HEART_BEAT_THRESHOLD) \ CFG(CFG_AP_KEEP_ALIVE_TIMEOUT) \ CFG(CFG_AP_LINK_MONITOR_TIMEOUT) \ + CFG(CFG_WMI_WQ_WATCHDOG) \ CFG(CFG_PS_DATA_INACTIVITY_TIMEOUT) #endif /* __CFG_MLME_TIMEOUT_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index e3cb559f2615..09a9abb1e723 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1568,6 +1568,7 @@ struct wlan_mlme_power { * @ap_keep_alive_timeout: AP keep alive timeout value * @ap_link_monitor_timeout: AP link monitor timeout value * @ps_data_inactivity_timeout: PS data inactivity timeout + * @wmi_wq_watchdog_timeout: timeout period for wmi watchdog bite */ struct wlan_mlme_timeout { uint32_t join_failure_timeout; @@ -1582,6 +1583,7 @@ struct wlan_mlme_timeout { uint32_t ap_keep_alive_timeout; uint32_t ap_link_monitor_timeout; uint32_t ps_data_inactivity_timeout; + uint32_t wmi_wq_watchdog_timeout; }; /** diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 7041c01c0bea..5a388432ac4b 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -1203,6 +1203,28 @@ QDF_STATUS ucfg_mlme_set_fast_roam_in_concurrency_enabled(struct wlan_objmgr_psoc *psoc, bool val); +/** + * ucfg_mlme_get_wmi_wq_watchdog_timeout() - Get timeout for wmi watchdog bite + * @psoc: pointer to psoc object + * @wmi_wq_watchdog_timeout: buffer to hold value + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_get_wmi_wq_watchdog_timeout(struct wlan_objmgr_psoc *psoc, + uint32_t *wmi_wq_watchdog_timeout); + +/** + * ucfg_mlme_set_wmi_wq_watchdog_timeout() - Set timeout for wmi watchdog bite + * @psoc: pointer to psoc object + * @wmi_wq_watchdog_timeout: value to be set + * + * Return: QDF Status + */ +QDF_STATUS +ucfg_mlme_set_wmi_wq_watchdog_timeout(struct wlan_objmgr_psoc *psoc, + uint32_t wmi_wq_watchdog_timeout); + /** * ucfg_mlme_get_ps_data_inactivity_timeout() - Get data inactivity timeout * @psoc: pointer to psoc object diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index abe96955e635..268c68fdec36 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1118,6 +1118,49 @@ ucfg_mlme_get_current_mcs_set(struct wlan_objmgr_psoc *psoc, len); } +QDF_STATUS +ucfg_mlme_get_wmi_wq_watchdog_timeout(struct wlan_objmgr_psoc *psoc, + uint32_t *wmi_wq_watchdog_timeout) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + *wmi_wq_watchdog_timeout = cfg_default(CFG_WMI_WQ_WATCHDOG); + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + *wmi_wq_watchdog_timeout = + mlme_obj->cfg.timeouts.wmi_wq_watchdog_timeout; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +ucfg_mlme_set_wmi_wq_watchdog_timeout(struct wlan_objmgr_psoc *psoc, + uint32_t wmi_wq_watchdog_timeout) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("mlme obj null"); + return QDF_STATUS_E_INVAL; + } + + if (!cfg_in_range(CFG_WMI_WQ_WATCHDOG, wmi_wq_watchdog_timeout)) { + mlme_err("wmi watchdog bite timeout is invalid %d", + wmi_wq_watchdog_timeout); + return QDF_STATUS_E_INVAL; + } + + mlme_obj->cfg.timeouts.wmi_wq_watchdog_timeout = + wmi_wq_watchdog_timeout; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS ucfg_mlme_get_ps_data_inactivity_timeout(struct wlan_objmgr_psoc *psoc, uint32_t *inactivity_timeout) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 881ea4502f7b..91bd90df8b2c 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -4434,29 +4434,6 @@ enum hdd_link_speed_rpt_type { #define CFG_OFFLOAD_NEIGHBOR_REPORT_MAX_REQ_CAP_MAX (300) #define CFG_OFFLOAD_NEIGHBOR_REPORT_MAX_REQ_CAP_DEFAULT (3) -/* - * - * wmi_wq_watchdog - Sets timeout period for wmi watchdog bite - * @Min: 0 - * @Max: 30 - * @Default: 20 - * - * This ini is used to set timeout period for wmi watchdog bite. If it is - * 0 then wmi watchdog bite is disabled. - * - * Related: None - * - * Supported Feature: STA - * - * Usage: External - * - * - */ -#define CFG_WMI_WQ_WATCHDOG "wmi_wq_watchdog" -#define CFG_WMI_WQ_WATCHDOG_MIN (0) -#define CFG_WMI_WQ_WATCHDOG_MAX (30) /* 30s */ -#define CFG_WMI_WQ_WATCHDOG_DEFAULT (20) /* 20s */ - /* * * gEnableDTIMSelectionDiversity - Enable/Disable chain @@ -5253,7 +5230,6 @@ struct hdd_config { uint32_t neighbor_report_offload_max_req_cap; bool action_oui_enable; uint8_t action_oui_str[ACTION_OUI_MAXIMUM_ID][ACTION_OUI_MAX_STR_LEN]; - uint16_t wmi_wq_watchdog_timeout; uint8_t enable_tx_sch_delay; uint32_t enable_secondary_rate; bool is_unit_test_framework_enabled; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 8f1f6d76021c..5942ef1581df 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -1272,13 +1272,6 @@ struct reg_table_entry g_registry_table[] = { CFG_OFFLOAD_NEIGHBOR_REPORT_MAX_REQ_CAP_MIN, CFG_OFFLOAD_NEIGHBOR_REPORT_MAX_REQ_CAP_MAX), - REG_VARIABLE(CFG_WMI_WQ_WATCHDOG, WLAN_PARAM_Integer, - struct hdd_config, wmi_wq_watchdog_timeout, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_WMI_WQ_WATCHDOG_DEFAULT, - CFG_WMI_WQ_WATCHDOG_MIN, - CFG_WMI_WQ_WATCHDOG_MAX), - REG_VARIABLE(CFG_DTIM_SELECTION_DIVERSITY_NAME, WLAN_PARAM_Integer, struct hdd_config, enable_dtim_selection_diversity,