Эх сурвалжийг харах

qcacmn: Define vendor_command_policy macro to support policy check

According to new changes in kernel 5.2 version onwards, driver has to
provide the policy for each NL command to be verified against while
registering wiphy to the kernel.

To enable support for this, define a new macro taking care of the version
compatibility.

Change-Id: I0bf7153d1889e5b31c07d6bf4c7a95f5e72dd93c
CRs-Fixed: 2632019
Rajeev Kumar 5 жил өмнө
parent
commit
b112466b8d

+ 9 - 0
os_if/linux/wlan_cfg80211.h

@@ -58,6 +58,15 @@
 #define osif_nofl_debug(params...) \
 	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_OS_IF, params)
 
+/* For kernel version >= 5.2, driver needs to provide policy */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0))
+#define vendor_command_policy(__policy, __maxattr) \
+	.policy = __policy,                        \
+	.maxattr = __maxattr
+#else
+#define vendor_command_policy(__policy, __maxattr)
+#endif /*End of (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) */
+
 #if defined(NBUF_MEMORY_DEBUG) && defined(NETLINK_BUF_TRACK)
 #define wlan_cfg80211_vendor_free_skb(skb) \
 	qdf_nbuf_free(skb)