From 3e231a9fd262c42803240f42c1645e32b6e64abd Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Wed, 4 Mar 2020 12:52:34 +0800 Subject: [PATCH] qcacld-3.0: Add policy attribute to hdd_wiphy_vendor_commands According to new changes in kernel 5.4 version onwards, driver has to provide the policy for a NL command to ve verified against while registering wiphy to the kernel. To accommodate these changes, add policy for all the following vendor commands that are being registered in the driver QCA_NL80211_VENDOR_SUBCMD_ROAMING QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY QCA_NL80211_VENDOR_SUBCMD_NAN QCA_NL80211_VENDOR_SUBCMD_STATS_EXT Change-Id: Ie2fb541d45ecc04dc5d3f80a3af9060c390ae7f5 CRs-Fixed: 2634373 --- core/hdd/inc/wlan_hdd_nan.h | 3 ++- core/hdd/src/wlan_hdd_cfg80211.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_nan.h b/core/hdd/inc/wlan_hdd_nan.h index d83b6c822c10..8fd59d67ab51 100644 --- a/core/hdd/inc/wlan_hdd_nan.h +++ b/core/hdd/inc/wlan_hdd_nan.h @@ -74,7 +74,8 @@ int wlan_hdd_cfg80211_nan_ext_request(struct wiphy *wiphy, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ WIPHY_VENDOR_CMD_NEED_NETDEV | \ WIPHY_VENDOR_CMD_NEED_RUNNING, \ - .doit = wlan_hdd_cfg80211_nan_request \ + .doit = wlan_hdd_cfg80211_nan_request, \ + vendor_command_policy(VENDOR_CMD_RAW_DATA, 0) \ }, \ { \ .info.vendor_id = QCA_NL80211_VENDOR_ID, \ diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index d552bd51034a..b938ace1129f 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -14416,7 +14416,8 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, - .doit = is_driver_dfs_capable + .doit = is_driver_dfs_capable, + vendor_command_policy(VENDOR_CMD_RAW_DATA, 0) }, { .info.vendor_id = QCA_NL80211_VENDOR_ID, @@ -14436,7 +14437,8 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_STATS_EXT, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_stats_ext_request + .doit = wlan_hdd_cfg80211_stats_ext_request, + vendor_command_policy(VENDOR_CMD_RAW_DATA, 0) }, #endif FEATURE_EXTSCAN_VENDOR_COMMANDS @@ -14717,7 +14719,8 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_avoid_freq + .doit = wlan_hdd_cfg80211_avoid_freq, + vendor_command_policy(VENDOR_CMD_RAW_DATA, 0) }, #endif { @@ -14777,7 +14780,9 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_set_fast_roaming + .doit = wlan_hdd_cfg80211_set_fast_roaming, + vendor_command_policy(qca_wlan_vendor_attr, + QCA_WLAN_VENDOR_ATTR_MAX) }, FEATURE_DISA_VENDOR_COMMANDS FEATURE_TDLS_VENDOR_COMMANDS