From dd2a53d62c98843c2e0b6187fdaba4d6e0765fc5 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 27 Feb 2020 14:20:30 -0800 Subject: [PATCH] qcacld-3.0: Add policy attribute to SUBCMD_THERMAL_CMD According to new changes in kernel 5.2 version onwards, driver has to provide the policy for a NL command to be verified against while registering wiphy to the kernel. To satisfy kernel 5.2 requirement add policy to following vendor command as part of this change: QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD Change-Id: Ia5a5e62b3fe086c3fab58d92d12898f525f774b8 CRs-Fixed: 2631242 --- core/hdd/src/wlan_hdd_thermal.c | 2 +- core/hdd/src/wlan_hdd_thermal.h | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_thermal.c b/core/hdd/src/wlan_hdd_thermal.c index fb09212f6080..14f0e6546ca7 100644 --- a/core/hdd/src/wlan_hdd_thermal.c +++ b/core/hdd/src/wlan_hdd_thermal.c @@ -36,7 +36,7 @@ #include #include "wlan_fwol_ucfg_api.h" -static const struct nla_policy +const struct nla_policy wlan_hdd_thermal_mitigation_policy [QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_VALUE] = {.type = NLA_U32}, diff --git a/core/hdd/src/wlan_hdd_thermal.h b/core/hdd/src/wlan_hdd_thermal.h index 39b01df01b86..9e989554dd1e 100644 --- a/core/hdd/src/wlan_hdd_thermal.h +++ b/core/hdd/src/wlan_hdd_thermal.h @@ -25,6 +25,7 @@ #include #include +#include #ifdef FW_THERMAL_THROTTLE_SUPPORT @@ -40,12 +41,18 @@ wlan_hdd_cfg80211_set_thermal_mitigation_policy(struct wiphy *wiphy, */ bool wlan_hdd_thermal_config_support(void); -#define FEATURE_THERMAL_VENDOR_COMMANDS \ -{ \ - .info.vendor_id = QCA_NL80211_VENDOR_ID, \ - .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD, \ - .flags = WIPHY_VENDOR_CMD_NEED_WDEV, \ - .doit = wlan_hdd_cfg80211_set_thermal_mitigation_policy \ +extern const struct nla_policy + wlan_hdd_thermal_mitigation_policy + [QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_MAX + 1]; + +#define FEATURE_THERMAL_VENDOR_COMMANDS \ +{ \ + .info.vendor_id = QCA_NL80211_VENDOR_ID, \ + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_THERMAL_CMD, \ + .flags = WIPHY_VENDOR_CMD_NEED_WDEV, \ + .doit = wlan_hdd_cfg80211_set_thermal_mitigation_policy, \ + vendor_command_policy(wlan_hdd_thermal_mitigation_policy, \ + QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_MAX) \ }, #else #define FEATURE_THERMAL_VENDOR_COMMANDS