From b112466b8dc0ba5acf71acf525851281e4ebf2f0 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Fri, 28 Feb 2020 11:07:06 -0800 Subject: [PATCH] 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 --- os_if/linux/wlan_cfg80211.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/os_if/linux/wlan_cfg80211.h b/os_if/linux/wlan_cfg80211.h index dd234082248b..0c344fece5b6 100644 --- a/os_if/linux/wlan_cfg80211.h +++ b/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)