Add new QCA vendor attribute to set thermal level

Add a new QCA vendor attribute to set thermal level to the driver from
userspace. The driver/firmware takes actions requested by userspace to
mitigate high temperature such as throttling TX etc. The driver may
choose the level of throttling and other actions for various thermal
levels set by userspace.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Vamsi Krishna 2020-01-13 18:07:13 +05:30 committed by Jouni Malinen
parent f28853fbc4
commit 0ecf735631

View File

@ -1323,6 +1323,11 @@ enum qca_wlan_vendor_acs_hw_mode {
* @QCA_WLAN_VENDOR_FEATURE_TWT: Device supports TWT (Target Wake Time).
* @QCA_WLAN_VENDOR_FEATURE_11AX: Device supports 802.11ax (HE)
* @QCA_WLAN_VENDOR_FEATURE_6GHZ_SUPPORT: Device supports 6 GHz band operation
* @QCA_WLAN_VENDOR_FEATURE_THERMAL_CONFIG: Device is capable of receiving
* and applying thermal configuration through
* %QCA_WLAN_VENDOR_ATTR_THERMAL_LEVEL and
* %QCA_WLAN_VENDOR_ATTR_THERMAL_COMPLETION_WINDOW attributes from
* userspace.
* @NUM_QCA_WLAN_VENDOR_FEATURES: Number of assigned feature bits
*/
enum qca_wlan_vendor_features {
@ -1337,6 +1342,7 @@ enum qca_wlan_vendor_features {
QCA_WLAN_VENDOR_FEATURE_TWT = 8,
QCA_WLAN_VENDOR_FEATURE_11AX = 9,
QCA_WLAN_VENDOR_FEATURE_6GHZ_SUPPORT = 10,
QCA_WLAN_VENDOR_FEATURE_THERMAL_CONFIG = 11,
NUM_QCA_WLAN_VENDOR_FEATURES /* keep last */
};
@ -6307,6 +6313,29 @@ enum qca_wlan_vendor_attr_wake_stats {
QCA_WLAN_VENDOR_GET_WAKE_STATS_AFTER_LAST - 1,
};
/**
* enum qca_wlan_vendor_thermal_level - Defines various thermal levels
* configured by userspace to the driver/firmware. The values will be
* encapsulated in QCA_WLAN_VENDOR_ATTR_THERMAL_LEVEL attribute.
* The driver/firmware takes actions requested by userspace such as throttling
* wifi TX etc. in order to mitigate high temperature.
*
* @QCA_WLAN_VENDOR_THERMAL_LEVEL_NONE: Stop/clear all throttling actions.
* @QCA_WLAN_VENDOR_THERMAL_LEVEL_LIGHT: Throttle TX lightly.
* @QCA_WLAN_VENDOR_THERMAL_LEVEL_MODERATE: Throttle TX moderately.
* @QCA_WLAN_VENDOR_THERMAL_LEVEL_SEVERE: Throttle TX severely.
* @QCA_WLAN_VENDOR_THERMAL_LEVEL_CRITICAL: Critical thermal level reached.
* @QCA_WLAN_VENDOR_THERMAL_LEVEL_EMERGENCY: Emergency thermal level reached.
*/
enum qca_wlan_vendor_thermal_level {
QCA_WLAN_VENDOR_THERMAL_LEVEL_NONE = 0,
QCA_WLAN_VENDOR_THERMAL_LEVEL_LIGHT = 1,
QCA_WLAN_VENDOR_THERMAL_LEVEL_MODERATE = 2,
QCA_WLAN_VENDOR_THERMAL_LEVEL_SEVERE = 3,
QCA_WLAN_VENDOR_THERMAL_LEVEL_CRITICAL = 4,
QCA_WLAN_VENDOR_THERMAL_LEVEL_EMERGENCY = 5,
};
/**
* enum qca_wlan_vendor_attr_thermal_cmd - Vendor subcmd attributes to set
* cmd value. Used for NL attributes for data used by
@ -6320,6 +6349,21 @@ enum qca_wlan_vendor_attr_thermal_cmd {
* u32 attribute.
*/
QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_VALUE = 1,
/* Userspace uses this attribute to configure thermal level to the
* driver/firmware. Used in request, u32 attribute, possible values
* are defined in enum qca_wlan_vendor_thermal_level.
*/
QCA_WLAN_VENDOR_ATTR_THERMAL_LEVEL = 2,
/* Userspace uses this attribute to configure the time in which the
* driver/firmware should complete applying settings it received from
* userspace with QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_SET_LEVEL
* command type. Used in request, u32 attribute, value is in
* milliseconds. A value of zero indicates to apply the settings
* immediately. The driver/firmware can delay applying the configured
* thermal settings within the time specified in this attribute if
* there is any critical ongoing operation.
*/
QCA_WLAN_VENDOR_ATTR_THERMAL_COMPLETION_WINDOW = 3,
/* keep last */
QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_AFTER_LAST,
@ -6343,12 +6387,15 @@ enum qca_wlan_vendor_attr_thermal_cmd {
* suspend action.
* @QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_RESUME: Request to execute thermal
* resume action.
* @QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_SET_LEVEL: Configure thermal level to
* the driver/firmware.
*/
enum qca_wlan_vendor_attr_thermal_cmd_type {
QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_GET_PARAMS,
QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_GET_TEMPERATURE,
QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_SUSPEND,
QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_RESUME,
QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_SET_LEVEL,
};
/**