blob: 39b01df01b86133506439fad6e13f7d3c681389d [file] [log] [blame]
Pankaj Singh50e40422020-01-09 15:29:35 +05301/*
2 * Copyright (c) 2020 The Linux Foundation. All rights reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#ifndef __HDD_THERMAL_H
20#define __HDD_THERMAL_H
21/**
22 * DOC: wlan_hdd_thermal.h
23 * WLAN Host Device Driver thermal mitigation include file
24 */
25
26#include <linux/netdevice.h>
27#include <net/cfg80211.h>
28
29#ifdef FW_THERMAL_THROTTLE_SUPPORT
30
31int
32wlan_hdd_cfg80211_set_thermal_mitigation_policy(struct wiphy *wiphy,
33 struct wireless_dev *wdev,
34 const void *data, int data_len);
35
36/**
37 * wlan_hdd_thermal_config_support() - thermal mitigation support
38 *
39 * Return: true if thermal mitigation support enabled otherwise false
40 */
41bool wlan_hdd_thermal_config_support(void);
42
43#define FEATURE_THERMAL_VENDOR_COMMANDS \
44{ \
45 .info.vendor_id = QCA_NL80211_VENDOR_ID, \
46 .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD, \
47 .flags = WIPHY_VENDOR_CMD_NEED_WDEV, \
48 .doit = wlan_hdd_cfg80211_set_thermal_mitigation_policy \
49},
50#else
51#define FEATURE_THERMAL_VENDOR_COMMANDS
52
53static inline bool wlan_hdd_thermal_config_support(void)
54{
55 return false;
56}
57
58#endif /* FEATURE_THERMAL_VENDOR_COMMANDS */
59#endif /* __HDD_THERMAL_H */