瀏覽代碼

qcacmn: Add wrapper API wlan_cfg80211_nla_strscpy

From 5.11 kernel, nla_strlcpy() is renamed to nla_strscpy() since
it works more like strscpy() than strlcpy() after the enhancement.
Hence handle it accordingly in WLAN driver by creating wrapper API
wlan_cfg80211_nla_strscpy().

Change-Id: I4c5ca1738048605c842c827d1706353bc012fed8
CRs-fixed: 3060060
Yue Ma 3 年之前
父節點
當前提交
9579188f04
共有 1 個文件被更改,包括 14 次插入0 次删除
  1. 14 0
      os_if/linux/wlan_cfg80211.h

+ 14 - 0
os_if/linux/wlan_cfg80211.h

@@ -454,4 +454,18 @@ wlan_cfg80211_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
 	return nla_put_u64_64bit(skb, attrtype, value, NL80211_ATTR_PAD);
 	return nla_put_u64_64bit(skb, attrtype, value, NL80211_ATTR_PAD);
 }
 }
 #endif
 #endif
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
+static inline ssize_t
+wlan_cfg80211_nla_strscpy(char *dst, const struct nlattr *nla, size_t dstsize)
+{
+	return nla_strlcpy(dst, nla, dstsize);
+}
+#else
+static inline ssize_t
+wlan_cfg80211_nla_strscpy(char *dst, const struct nlattr *nla, size_t dstsize)
+{
+	return nla_strscpy(dst, nla, dstsize);
+}
+#endif
 #endif
 #endif