qcacmn: Add wrapper for nla_parse_nested()
The Linux kernel version 4.12 introduced an API change to nla_parse_nested(). Add conditional compilation to call nla_parse_nested with the correct parameters based on the version of the linux kernel being compiled against. Change-Id: I878a29b352c998a751a979f66a9c3c4c7ecfd442 CRs-Fixed: 2167861
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -65,6 +65,7 @@
|
||||
},
|
||||
|
||||
#undef nla_parse
|
||||
#undef nla_parse_nested
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
|
||||
static inline int wlan_cfg80211_nla_parse(struct nlattr **tb,
|
||||
int maxtype,
|
||||
@@ -74,6 +75,15 @@ static inline int wlan_cfg80211_nla_parse(struct nlattr **tb,
|
||||
{
|
||||
return nla_parse(tb, maxtype, head, len, policy);
|
||||
}
|
||||
|
||||
static inline int
|
||||
wlan_cfg80211_nla_parse_nested(struct nlattr *tb[],
|
||||
int maxtype,
|
||||
const struct nlattr *nla,
|
||||
const struct nla_policy *policy)
|
||||
{
|
||||
return nla_parse_nested(tb, maxtype, nla, policy);
|
||||
}
|
||||
#else
|
||||
static inline int wlan_cfg80211_nla_parse(struct nlattr **tb,
|
||||
int maxtype,
|
||||
@@ -83,8 +93,18 @@ static inline int wlan_cfg80211_nla_parse(struct nlattr **tb,
|
||||
{
|
||||
return nla_parse(tb, maxtype, head, len, policy, NULL);
|
||||
}
|
||||
|
||||
static inline int
|
||||
wlan_cfg80211_nla_parse_nested(struct nlattr *tb[],
|
||||
int maxtype,
|
||||
const struct nlattr *nla,
|
||||
const struct nla_policy *policy)
|
||||
{
|
||||
return nla_parse_nested(tb, maxtype, nla, policy, NULL);
|
||||
}
|
||||
#endif
|
||||
#define nla_parse(...) (obsolete, use wlan_cfg80211_nla_parse or hdd_nla_parse)
|
||||
#define nla_parse(...) (obsolete, use wlan_cfg80211_nla_parse)
|
||||
#define nla_parse_nested(...) (obsolete, use wlan_cfg80211_nla_parse_nested)
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))
|
||||
static inline int
|
||||
|
مرجع در شماره جدید
Block a user