diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 395430ea005b..70df7a0e4846 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1941,7 +1941,7 @@ struct hdd_context { int radio_index; qdf_work_t sap_pre_cac_work; bool hbw_requested; - bool llm_enabled; + bool pm_qos_request; enum RX_OFFLOAD ol_enable; #ifdef WLAN_FEATURE_NAN bool nan_datapath_enabled; @@ -4716,22 +4716,21 @@ static inline void hdd_beacon_latency_event_cb(uint32_t latency_level) */ void hdd_netdev_update_features(struct hdd_adapter *adapter); -#if defined(CLD_PM_QOS) && defined(WLAN_FEATURE_LL_MODE) +#if defined(CLD_PM_QOS) /** - * wlan_hdd_set_wlm_mode() - Function to set pm_qos config in wlm mode + * wlan_hdd_set_pm_qos_request() - Function to set pm_qos config in wlm mode * @hdd_ctx: HDD context - * @latency level: latency value received + * @pm_qos_request: pm_qos_request flag * * Return: None */ -void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, - uint16_t latency_level); +void wlan_hdd_set_pm_qos_request(struct hdd_context *hdd_ctx, + bool pm_qos_request); #else static inline -void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, - uint16_t latency_level) +void wlan_hdd_set_pm_qos_request(struct hdd_context *hdd_ctx, + bool pm_qos_request) { } #endif - #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 628cefaea8db..3e8eedf16c9f 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -8148,6 +8148,23 @@ static int hdd_config_total_beacon_miss_count(struct hdd_adapter *adapter, return qdf_status_to_os_return(status); } +#ifdef WLAN_FEATURE_LL_MODE +static inline +void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level) +{ + if (latency_level == + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_ULTRALOW) + wlan_hdd_set_pm_qos_request(hdd_ctx, true); + else + wlan_hdd_set_pm_qos_request(hdd_ctx, false); +} +#else +static inline +void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level) +{ +} +#endif + static int hdd_config_latency_level(struct hdd_adapter *adapter, const struct nlattr *attr) { diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 1ee562b2ce88..d387a72b9d25 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9615,17 +9615,16 @@ static inline void hdd_pm_qos_update_request(struct hdd_context *hdd_ctx, } #endif /* CLD_PM_QOS */ -#if defined(CLD_PM_QOS) && defined(WLAN_FEATURE_LL_MODE) +#if defined(CLD_PM_QOS) #if defined(CLD_DEV_PM_QOS) -void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level) +void wlan_hdd_set_pm_qos_request(struct hdd_context *hdd_ctx, + bool pm_qos_request) { cpumask_t pm_qos_cpu_mask; cpumask_clear(&pm_qos_cpu_mask); - - if (latency_level == - QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_ULTRALOW) { - hdd_ctx->llm_enabled = true; + if (pm_qos_request) { + hdd_ctx->pm_qos_request = true; if (!hdd_ctx->hbw_requested) { hdd_pm_qos_update_cpu_mask(&pm_qos_cpu_mask, true); hdd_pm_qos_update_request(hdd_ctx, &pm_qos_cpu_mask); @@ -9637,15 +9636,15 @@ void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level) hdd_pm_qos_update_request(hdd_ctx, &pm_qos_cpu_mask); hdd_ctx->hbw_requested = false; } - hdd_ctx->llm_enabled = false; + hdd_ctx->pm_qos_request = false; } } #else -void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level) +void wlan_hdd_set_pm_qos_request(struct hdd_context *hdd_ctx, + bool pm_qos_request) { - if (latency_level == - QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_ULTRALOW) { - hdd_ctx->llm_enabled = true; + if (pm_qos_request) { + hdd_ctx->pm_qos_request = true; if (!hdd_ctx->hbw_requested) { cpumask_setall(&hdd_ctx->pm_qos_req.cpus_affine); pm_qos_update_request(&hdd_ctx->pm_qos_req, @@ -9659,7 +9658,7 @@ void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level) PM_QOS_DEFAULT_VALUE); hdd_ctx->hbw_requested = false; } - hdd_ctx->llm_enabled = false; + hdd_ctx->pm_qos_request = false; } } #endif @@ -9780,7 +9779,8 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx, if ((next_vote_level == PLD_BUS_WIDTH_LOW) || (next_vote_level == PLD_BUS_WIDTH_IDLE)) { - if (hdd_ctx->hbw_requested && !hdd_ctx->llm_enabled) { + if (hdd_ctx->hbw_requested && + !hdd_ctx->pm_qos_request) { PLD_REMOVE_PM_QOS(hdd_ctx->parent_dev); hdd_ctx->hbw_requested = false; } @@ -9964,7 +9964,7 @@ static void hdd_pld_request_bus_bandwidth(struct hdd_context *hdd_ctx, if (next_vote_level < PLD_BUS_WIDTH_MEDIUM) cpumask_clear(&pm_qos_cpu_mask); - if (!hdd_ctx->llm_enabled) + if (!hdd_ctx->pm_qos_request) hdd_pm_qos_update_request(hdd_ctx, &pm_qos_cpu_mask); } @@ -18364,7 +18364,12 @@ void hdd_beacon_latency_event_cb(uint32_t latency_level) hdd_err_rl("Invalid HDD_CTX"); return; } - wlan_hdd_set_wlm_mode(hdd_ctx, latency_level); + + if (latency_level == + QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL_ULTRALOW) + wlan_hdd_set_pm_qos_request(hdd_ctx, true); + else + wlan_hdd_set_pm_qos_request(hdd_ctx, false); } #endif