qcacld-3.0: Support obtaining thermal level for non-offload case

Currently thermal level can be got from upper layer only
for FW thermal mgmt offload case. Per the requirement,
refine the code to support it for thermal non-offload
case as well.
Similar to offload thermal mitigation, add TX_OFF and
shutdown two states for non-offload case. Host will fully
stop TX traffic in TX_OFF state and target will trigger
shutdown when temperature come to the range of shutdown.
Per above requirement, add below four INI to configure
thermal temperature threshold value as need for TX off
and target shutdown.
gThermalTempMinLevel4
gThermalTempMaxLevel4
gThermalTempMinLevel5
gThermalTempMaxLevel5

Change-Id: I40d097ab8a5801052553ad7adedd38be475c7669
CRs-Fixed: 3413165
This commit is contained in:
Qun Zhang
2022-12-08 11:08:54 +08:00
کامیت شده توسط Madan Koyyalamudi
والد a86d1881cc
کامیت 29869c5fa8
9فایلهای تغییر یافته به همراه241 افزوده شده و 11 حذف شده

مشاهده پرونده

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -55,4 +56,27 @@ target_if_fwol_unregister_event_handler(struct wlan_objmgr_psoc *psoc,
*/
QDF_STATUS target_if_fwol_register_tx_ops(struct wlan_fwol_tx_ops *tx_ops);
/**
* target_if_fwol_notify_thermal_throttle() - Notify thermal throttle level
* to upper layer
* @psoc: PSOC object manager
* @info: Thermal throttle information from target
*
* This function is used to notify thermal throttle level to upper layer
* when thermal management event receive.
*
* Return: QDF_STATUS_SUCCESS for success otherwise failure
*/
#ifdef FW_THERMAL_THROTTLE_SUPPORT
QDF_STATUS
target_if_fwol_notify_thermal_throttle(struct wlan_objmgr_psoc *psoc,
struct thermal_throttle_info *info);
#else
static inline QDF_STATUS
target_if_fwol_notify_thermal_throttle(struct wlan_objmgr_psoc *psoc,
struct thermal_throttle_info *info)
{
return QDF_STATUS_E_INVAL;
}
#endif
#endif /* __TARGET_IF_FWOL_H__ */

مشاهده پرونده

@@ -321,6 +321,49 @@ target_if_fwol_is_thermal_stats_enable(struct wlan_fwol_psoc_obj *fwol_obj)
#endif
#if defined FW_THERMAL_THROTTLE_SUPPORT || defined THERMAL_STATS_SUPPORT
QDF_STATUS
target_if_fwol_notify_thermal_throttle(struct wlan_objmgr_psoc *psoc,
struct thermal_throttle_info *info)
{
struct wlan_fwol_psoc_obj *fwol_obj;
struct wlan_fwol_rx_ops *rx_ops;
QDF_STATUS status;
fwol_obj = fwol_get_psoc_obj(psoc);
if (!fwol_obj) {
target_if_err("Failed to get FWOL Obj");
return QDF_STATUS_E_INVAL;
}
rx_ops = &fwol_obj->rx_ops;
if (!rx_ops) {
target_if_err("rx_ops Null");
return QDF_STATUS_E_INVAL;
}
if (!info) {
target_if_err("info Null");
return QDF_STATUS_E_INVAL;
}
if (rx_ops->notify_thermal_throttle_handler) {
if (info->level == THERMAL_UNKNOWN) {
target_if_debug("Invalid thermal target lvl");
return QDF_STATUS_E_INVAL;
}
status = rx_ops->notify_thermal_throttle_handler(psoc, info);
if (QDF_IS_STATUS_ERROR(status)) {
target_if_debug("notify thermal_throttle failed.");
return QDF_STATUS_E_INVAL;
}
} else {
target_if_debug("No notify thermal_throttle callback");
return QDF_STATUS_E_INVAL;
}
return status;
}
/**
* target_if_fwol_thermal_throttle_event_handler() - handler for thermal
* throttle event
@@ -456,7 +499,6 @@ target_if_fwol_unregister_thermal_throttle_handler(
if (QDF_IS_STATUS_ERROR(status))
target_if_debug("Failed to unregister thermal stats event cb");
}
#else
static void
target_if_fwol_register_thermal_throttle_handler(struct wlan_objmgr_psoc *psoc)