Jelajahi Sumber

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
Alan Chen 5 tahun lalu
induk
melakukan
cc46ff0ae5
2 mengubah file dengan 22 tambahan dan 10 penghapusan
  1. 6 10
      core/hdd/src/wlan_hdd_cfg80211.c
  2. 16 0
      core/hdd/src/wlan_hdd_cfg80211.h

+ 6 - 10
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 =

+ 16 - 0
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
  *