From 4e80a0a5506e1479b020c462d6057a8364c5d924 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Tue, 3 Mar 2020 11:45:19 -0800 Subject: [PATCH] qcacld-3.0: Add policy attribute to WIFI_TEST_CONFIGURATION According to new changes in kernel 5.2 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.2 requirement add policy to following vendor command as part of this change: QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION Change-Id: I91a97a17fa27f93f20385a250f098d5b01081023 CRs-Fixed: 2634072 --- 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 de65f183af..2278aa7e13 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -6619,7 +6619,7 @@ qca_wlan_vendor_attr_he_omi_tx_policy [QCA_WLAN_VENDOR_ATTR_HE_OMI_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_HE_OMI_ULMU_DATA_DISABLE] = {.type = NLA_U8 }, }; -static const struct nla_policy +const struct nla_policy wlan_hdd_wifi_test_config_policy[ QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_WMM_ENABLE] = { @@ -14612,15 +14612,8 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = wlan_hdd_cfg80211_wifi_configuration_get }, - { - .info.vendor_id = QCA_NL80211_VENDOR_ID, - .info.subcmd = - QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION, - .flags = WIPHY_VENDOR_CMD_NEED_WDEV | - WIPHY_VENDOR_CMD_NEED_NETDEV | - WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_set_wifi_test_config - }, + + FEATURE_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION { .info.vendor_id = QCA_NL80211_VENDOR_ID, diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index c3fb56d3b6..c0e505d38d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -243,6 +243,22 @@ wlan_hdd_cfg80211_update_bss_db(struct hdd_adapter *adapter, #define CONNECTIVITY_CHECK_SET_TCP_ACK \ QCA_WLAN_VENDOR_CONNECTIVITY_CHECK_SET_TCP_ACK +extern const struct nla_policy +wlan_hdd_wifi_test_config_policy[ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_MAX + 1]; + +#define FEATURE_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION \ +{ \ + .info.vendor_id = QCA_NL80211_VENDOR_ID, \ + .info.subcmd = \ + QCA_NL80211_VENDOR_SUBCMD_WIFI_TEST_CONFIGURATION, \ + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ + WIPHY_VENDOR_CMD_NEED_NETDEV | \ + WIPHY_VENDOR_CMD_NEED_RUNNING, \ + .doit = wlan_hdd_cfg80211_set_wifi_test_config, \ + vendor_command_policy(wlan_hdd_wifi_test_config_policy, \ + QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_MAX) \ +}, int wlan_hdd_cfg80211_pmksa_candidate_notify(struct hdd_adapter *adapter, struct csr_roam_info *roam_info,