qcacld-3.0: 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: I5214e9622d63ec928f5814f5840528f8c0d61422
CRs-Fixed: 2167853
This commit is contained in:
Dustin Brown 2018-01-05 13:33:04 -08:00 • committed by snandini
commit 24277bb93e
2 changed files with 18 additions and 1 deletions

View file

@ -2762,6 +2762,7 @@ static inline void hdd_update_hlp_info(struct net_device *dev,
#endif
#undef nla_parse
#undef nla_parse_nested
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
static inline void hdd_dev_setup_destructor(struct net_device *dev)
{
@ -2774,6 +2775,13 @@ hdd_nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head,
{
return nla_parse(tb, maxtype, head, len, policy);
}
static inline int
hdd_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 void hdd_dev_setup_destructor(struct net_device *dev)
{
@ -2786,8 +2794,17 @@ hdd_nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head,
{
return nla_parse(tb, maxtype, head, len, policy, NULL);
}
static inline int
hdd_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 /* KERNEL_VERSION(4, 12, 0) */
#define nla_parse(...) (obsolete, use wlan_cfg80211_nla_parse or hdd_nla_parse)
#define nla_parse_nested(...) \
(obsolete, use wlan_cfg80211_nla_parse_nested or hdd_nla_parse_nested)
/**
* hdd_dp_trace_init() - initialize DP Trace by calling the QDF API

View file

@ -12708,7 +12708,7 @@ static int __wlan_hdd_cfg80211_fetch_bss_transition_status(struct wiphy *wiphy,
nla_for_each_nested(attr,
tb[QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO],
rem) {
ret = nla_parse_nested(
ret = hdd_nla_parse_nested(
tb_msg,
QCA_WLAN_VENDOR_ATTR_BTM_CANDIDATE_INFO_MAX,
attr, btm_cand_list_policy);