From cc46ff0ae5e3de0dff0691f4933a9f5dbf58e7ff Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Mon, 2 Mar 2020 16:34:42 -0800 Subject: [PATCH] qcacld-3.0: Add policy attribute to SET_TRACE_LEVEL According to new changes in kernel 5.4 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.4 requirement add policy to following vendor command as part of this change: QCA_NL80211_VENDOR_SUBCMD_SET_TRACE_LEVEL Change-Id: Ifbeba29b5c3c7783217ed5f2352286e5537753e6 CRs-Fixed: 2633340 --- core/hdd/src/wlan_hdd_cfg80211.c | 16 ++++++---------- core/hdd/src/wlan_hdd_cfg80211.h | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 214d03676b03..d50ca20db399 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -12892,9 +12892,10 @@ end: return err; } -static const struct nla_policy qca_wlan_vendor_set_trace_level_policy[ +const struct nla_policy qca_wlan_vendor_set_trace_level_policy[ QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_MAX + 1] = { - [QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_PARAM] = {.type = NLA_NESTED }, + [QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_PARAM] = + VENDOR_NLA_POLICY_NESTED(qca_wlan_vendor_set_trace_level_policy), [QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_MODULE_ID] = {.type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_TRACE_MASK] = {.type = NLA_U32 }, }; @@ -14758,14 +14759,9 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { vendor_command_policy(sar_limits_policy, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_MAX) }, - { - .info.vendor_id = QCA_NL80211_VENDOR_ID, - .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_TRACE_LEVEL, - .flags = WIPHY_VENDOR_CMD_NEED_WDEV | - WIPHY_VENDOR_CMD_NEED_NETDEV | - WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_set_trace_level - }, + + FEATURE_VENDOR_SUBCMD_SET_TRACE_LEVEL + { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 918b6210e08d..9f8dcc6460b6 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -295,6 +295,22 @@ extern const struct nla_policy QCA_ATTR_NUD_STATS_SET_MAX) \ }, +extern const struct nla_policy + qca_wlan_vendor_set_trace_level_policy + [QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_MAX + 1]; + +#define FEATURE_VENDOR_SUBCMD_SET_TRACE_LEVEL \ +{ \ + .info.vendor_id = QCA_NL80211_VENDOR_ID, \ + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_TRACE_LEVEL, \ + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ + WIPHY_VENDOR_CMD_NEED_NETDEV | \ + WIPHY_VENDOR_CMD_NEED_RUNNING, \ + .doit = wlan_hdd_cfg80211_set_trace_level, \ + vendor_command_policy(qca_wlan_vendor_set_trace_level_policy, \ + QCA_WLAN_VENDOR_ATTR_SET_TRACE_LEVEL_MAX) \ +}, + /** * hdd_cfg80211_wiphy_alloc() - Allocate wiphy *