From 1c570b38f4fedeb7fac3b1ec220cdd14a25fe9e9 Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Thu, 27 Feb 2020 15:43:33 -0800 Subject: [PATCH] qcacld-3.0: Add policy attribute to SUBCMD_NUD_STATS_SET According to new changes in kernel 5.4 version onwards, driver has to provide the policy for a NL command to be verified against while registering wiphy to the kernel. To satisfy kernel 5.4 requirement add policy to following vendor command as part of this change: QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_SET Change-Id: I1023872146d398252cd8dbde8431cd8c5e839a31 CRs-Fixed: 2631294 --- core/hdd/src/wlan_hdd_cfg80211.c | 13 +++---------- core/hdd/src/wlan_hdd_cfg80211.h | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 258bbf45fc36..ad8e684965ba 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -12621,7 +12621,7 @@ static int wlan_hdd_cfg80211_set_fast_roaming(struct wiphy *wiphy, QCA_ATTR_NUD_STATS_SET_MAX const struct nla_policy -qca_wlan_vendor_set_nud_stats[STATS_SET_MAX + 1] = { +qca_wlan_vendor_set_nud_stats_policy[STATS_SET_MAX + 1] = { [STATS_SET_START] = {.type = NLA_FLAG }, [STATS_GW_IPV4] = {.type = NLA_U32 }, [STATS_SET_DATA_PKT_INFO] = {.type = NLA_U32 }, @@ -13073,7 +13073,7 @@ static int __wlan_hdd_cfg80211_set_nud_stats(struct wiphy *wiphy, } err = wlan_cfg80211_nla_parse(tb, STATS_SET_MAX, data, data_len, - qca_wlan_vendor_set_nud_stats); + qca_wlan_vendor_set_nud_stats_policy); if (err) { hdd_err("STATS_SET_START ATTR"); return err; @@ -14943,14 +14943,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_ll_stats_ext_set_param }, - { - .info.vendor_id = QCA_NL80211_VENDOR_ID, - .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_SET, - .flags = WIPHY_VENDOR_CMD_NEED_WDEV | - WIPHY_VENDOR_CMD_NEED_NETDEV | - WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_set_nud_stats - }, + FEATURE_VENDOR_SUBCMD_NUD_STATS_SET { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_GET, diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index c0e505d38d97..918b6210e08d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -279,6 +279,22 @@ wlan_hdd_cfg80211_roam_metrics_handover(struct hdd_adapter *adapter, struct csr_roam_info *roam_info); #endif +extern const struct nla_policy + qca_wlan_vendor_set_nud_stats_policy + [QCA_ATTR_NUD_STATS_SET_MAX + 1]; + +#define FEATURE_VENDOR_SUBCMD_NUD_STATS_SET \ +{ \ + .info.vendor_id = QCA_NL80211_VENDOR_ID, \ + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_NUD_STATS_SET, \ + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ + WIPHY_VENDOR_CMD_NEED_NETDEV | \ + WIPHY_VENDOR_CMD_NEED_RUNNING, \ + .doit = wlan_hdd_cfg80211_set_nud_stats, \ + vendor_command_policy(qca_wlan_vendor_set_nud_stats_policy, \ + QCA_ATTR_NUD_STATS_SET_MAX) \ +}, + /** * hdd_cfg80211_wiphy_alloc() - Allocate wiphy *