From ba6213b1b6fa2b8fbc552dce6877f506b8c7fcb9 Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Fri, 6 Mar 2020 11:50:00 +0800 Subject: [PATCH] qcacld-3.0: Add policy attribute for tdls/supported_feature 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_TDLS_ENABLE QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES Change-Id: I4ad3d952d2af8f1d7f37179f9c92b0e77fc2eb23 CRs-Fixed: 2635755 --- core/hdd/inc/wlan_hdd_tdls.h | 26 ++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg80211.c | 29 +++++------------------------ 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index 5fd738ad4079..e73e1fa5ef25 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -43,6 +43,32 @@ extern const struct nla_policy .doit = wlan_hdd_cfg80211_configure_tdls_mode, \ vendor_command_policy(wlan_hdd_tdls_mode_configuration_policy, \ QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_MAX) \ +}, \ +{ \ + .info.vendor_id = QCA_NL80211_VENDOR_ID, \ + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE, \ + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ + WIPHY_VENDOR_CMD_NEED_NETDEV | \ + WIPHY_VENDOR_CMD_NEED_RUNNING, \ + .doit = wlan_hdd_cfg80211_exttdls_enable, \ + vendor_command_policy(VENDOR_CMD_RAW_DATA, 0) \ +}, \ +{ \ + .info.vendor_id = QCA_NL80211_VENDOR_ID, \ + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE, \ + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ + WIPHY_VENDOR_CMD_NEED_NETDEV | \ + WIPHY_VENDOR_CMD_NEED_RUNNING, \ + .doit = wlan_hdd_cfg80211_exttdls_disable, \ + vendor_command_policy(VENDOR_CMD_RAW_DATA, 0) \ +}, \ +{ \ + .info.vendor_id = QCA_NL80211_VENDOR_ID, \ + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS, \ + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ + WIPHY_VENDOR_CMD_NEED_NETDEV, \ + .doit = wlan_hdd_cfg80211_exttdls_get_status, \ + vendor_command_policy(VENDOR_CMD_RAW_DATA, 0) \ }, /* Bit mask flag for tdls_option to FW */ diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index b56b1477a221..214d03676b03 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -14423,33 +14423,14 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { .doit = wlan_hdd_cfg80211_ll_stats_get }, #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ -#ifdef FEATURE_WLAN_TDLS - { - .info.vendor_id = QCA_NL80211_VENDOR_ID, - .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_ENABLE, - .flags = WIPHY_VENDOR_CMD_NEED_WDEV | - WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_exttdls_enable - }, - { - .info.vendor_id = QCA_NL80211_VENDOR_ID, - .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_DISABLE, - .flags = WIPHY_VENDOR_CMD_NEED_WDEV | - WIPHY_VENDOR_CMD_NEED_NETDEV | WIPHY_VENDOR_CMD_NEED_RUNNING, - .doit = wlan_hdd_cfg80211_exttdls_disable - }, - { - .info.vendor_id = QCA_NL80211_VENDOR_ID, - .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_TDLS_GET_STATUS, - .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, - .doit = wlan_hdd_cfg80211_exttdls_get_status - }, -#endif + { .info.vendor_id = QCA_NL80211_VENDOR_ID, .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_FEATURES, - .flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV, - .doit = wlan_hdd_cfg80211_get_supported_features + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wlan_hdd_cfg80211_get_supported_features, + vendor_command_policy(VENDOR_CMD_RAW_DATA, 0) }, { .info.vendor_id = QCA_NL80211_VENDOR_ID,