فهرست منبع

qcacmn: Add dummy NLA parsing in driver for kernel >= 5.2

According to new changes in kernel 5.2 version onwards, kernel takes
care of validating the NLA policies as provided by the driver. In this
case there is no need to re-validate the same in the driver.

Add a stub to return true for NLA parse in case the kernel version is
greater than equal to 5.2

Change-Id: Iea1fdcac3000ede2f8b9398cb85443e545cdd3f0
CRs-Fixed: 2632534
Sourav Mohapatra 5 سال پیش
والد
کامیت
f14a0edd8e
1فایلهای تغییر یافته به همراه19 افزوده شده و 1 حذف شده
  1. 19 1
      os_if/linux/wlan_cfg80211.h

+ 19 - 1
os_if/linux/wlan_cfg80211.h

@@ -178,7 +178,7 @@ wlan_cfg80211_nla_parse_nested(struct nlattr *tb[],
 {
 	return nla_parse_nested(tb, maxtype, nla, policy);
 }
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
 static inline int wlan_cfg80211_nla_parse(struct nlattr **tb,
 					  int maxtype,
 					  const struct nlattr *head,
@@ -196,6 +196,24 @@ wlan_cfg80211_nla_parse_nested(struct nlattr *tb[],
 {
 	return nla_parse_nested(tb, maxtype, nla, policy, NULL);
 }
+#else
+static inline int wlan_cfg80211_nla_parse(struct nlattr **tb,
+					  int maxtype,
+					  const struct nlattr *head,
+					  int len,
+					  const struct nla_policy *policy)
+{
+	return 0;
+}
+
+static inline int
+wlan_cfg80211_nla_parse_nested(struct nlattr *tb[],
+			       int maxtype,
+			       const struct nlattr *nla,
+			       const struct nla_policy *policy)
+{
+	return 0;
+}
 #endif
 #define nla_parse(...) (obsolete, use wlan_cfg80211_nla_parse)
 #define nla_parse_nested(...) (obsolete, use wlan_cfg80211_nla_parse_nested)