diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index c885a39fa75a..395430ea005b 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -4716,4 +4716,22 @@ 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) +/** + * wlan_hdd_set_wlm_mode() - Function to set pm_qos config in wlm mode + * @hdd_ctx: HDD context + * @latency level: latency value received + * + * Return: None + */ +void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, + uint16_t latency_level); +#else +static inline +void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, + uint16_t latency_level) +{ +} +#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 a8e35ba148f9..628cefaea8db 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -8148,30 +8148,6 @@ static int hdd_config_total_beacon_miss_count(struct hdd_adapter *adapter, return qdf_status_to_os_return(status); } -#if defined(CLD_PM_QOS) && defined(WLAN_FEATURE_LL_MODE) -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) { - hdd_ctx->llm_enabled = true; - if (!hdd_ctx->hbw_requested) { - cpumask_setall(&hdd_ctx->pm_qos_req.cpus_affine); - pm_qos_update_request(&hdd_ctx->pm_qos_req, - DISABLE_KRAIT_IDLE_PS_VAL); - hdd_ctx->hbw_requested = true; - } - } else { - if (hdd_ctx->hbw_requested) { - cpumask_clear(&hdd_ctx->pm_qos_req.cpus_affine); - pm_qos_update_request(&hdd_ctx->pm_qos_req, - PM_QOS_DEFAULT_VALUE); - hdd_ctx->hbw_requested = false; - } - hdd_ctx->llm_enabled = false; - } -} -#endif - static int hdd_config_latency_level(struct hdd_adapter *adapter, const struct nlattr *attr) { diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 3fffcf3bd0a1..b4a13126a86e 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -796,22 +796,6 @@ QDF_STATUS wlan_hdd_send_sta_authorized_event( struct hdd_context *hdd_ctx, const struct qdf_mac_addr *mac_addr); -/** - * wlan_hdd_set_wlm_mode() - Function to set pm_qos config in wlm mode - * @hdd_ctx: HDD context - * @latency level: latency value received - * - * Return: None - */ -#if defined(CLD_PM_QOS) && defined(WLAN_FEATURE_LL_MODE) -void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level); -#else -static inline -void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level) -{ -} -#endif - /** * hdd_set_dynamic_antenna_mode() - set dynamic antenna mode * @adapter: Pointer to network adapter diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index fbfa8f4f87de..1ee562b2ce88 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9615,6 +9615,56 @@ 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_DEV_PM_QOS) +void wlan_hdd_set_wlm_mode(struct hdd_context *hdd_ctx, uint16_t latency_level) +{ + 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 (!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); + hdd_ctx->hbw_requested = true; + } + } else { + if (hdd_ctx->hbw_requested) { + hdd_pm_qos_update_cpu_mask(&pm_qos_cpu_mask, false); + hdd_pm_qos_update_request(hdd_ctx, &pm_qos_cpu_mask); + hdd_ctx->hbw_requested = false; + } + hdd_ctx->llm_enabled = false; + } +} +#else +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) { + hdd_ctx->llm_enabled = true; + if (!hdd_ctx->hbw_requested) { + cpumask_setall(&hdd_ctx->pm_qos_req.cpus_affine); + pm_qos_update_request(&hdd_ctx->pm_qos_req, + DISABLE_KRAIT_IDLE_PS_VAL); + hdd_ctx->hbw_requested = true; + } + } else { + if (hdd_ctx->hbw_requested) { + cpumask_clear(&hdd_ctx->pm_qos_req.cpus_affine); + pm_qos_update_request(&hdd_ctx->pm_qos_req, + PM_QOS_DEFAULT_VALUE); + hdd_ctx->hbw_requested = false; + } + hdd_ctx->llm_enabled = false; + } +} +#endif +#endif + /** * hdd_low_tput_gro_flush_skip_handler() - adjust GRO flush for low tput * @hdd_ctx: handle to hdd context