From 21363751ad94a2b2cda21e3610ceae8f2203470b Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Thu, 12 Mar 2020 08:39:51 +0800 Subject: [PATCH] qcacld-3.0: Add policy attribute for ll_stats_clr 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 accommodate these changes, add policy for the following vendor command that is being registered in the driver QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR Change-Id: I5d29cc624021d489b641045e52d71db86cf3a09b CRs-Fixed: 2634435 --- core/hdd/src/wlan_hdd_cfg80211.c | 11 ----------- core/hdd/src/wlan_hdd_stats.h | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index b912b2079761..638e0eb0ae0d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -14445,17 +14445,6 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { FEATURE_LL_STATS_VENDOR_COMMANDS -#ifdef WLAN_FEATURE_LINK_LAYER_STATS - { - .info.vendor_id = QCA_NL80211_VENDOR_ID, - .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR, - .flags = WIPHY_VENDOR_CMD_NEED_WDEV | - WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_ll_stats_clear - }, - -#endif /* WLAN_FEATURE_LINK_LAYER_STATS */ - { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES, diff --git a/core/hdd/src/wlan_hdd_stats.h b/core/hdd/src/wlan_hdd_stats.h index 764522ec2c3b..25669390fa32 100644 --- a/core/hdd/src/wlan_hdd_stats.h +++ b/core/hdd/src/wlan_hdd_stats.h @@ -43,15 +43,30 @@ extern const struct nla_policy qca_wlan_vendor_ll_ext_policy[ QCA_WLAN_VENDOR_ATTR_LL_STATS_EXT_MAX + 1]; #ifdef WLAN_FEATURE_LINK_LAYER_STATS +/* QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR */ +extern const struct nla_policy qca_wlan_vendor_ll_clr_policy[ + QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX + 1]; + /* QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET */ extern const struct nla_policy qca_wlan_vendor_ll_set_policy[ QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX + 1]; -/* QCA_NL80211_VENDOR_SUBCMD_NDP */ +/* QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET */ extern const struct nla_policy qca_wlan_vendor_ll_get_policy[ QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX + 1]; #define FEATURE_LL_STATS_VENDOR_COMMANDS \ +{ \ + .info.vendor_id = QCA_NL80211_VENDOR_ID, \ + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR, \ + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ + WIPHY_VENDOR_CMD_NEED_NETDEV | \ + WIPHY_VENDOR_CMD_NEED_RUNNING, \ + .doit = wlan_hdd_cfg80211_ll_stats_clear, \ + vendor_command_policy(qca_wlan_vendor_ll_clr_policy, \ + QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX) \ +}, \ + \ { \ .info.vendor_id = QCA_NL80211_VENDOR_ID, \ .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET, \