瀏覽代碼

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
Jingxiang Ge 5 年之前
父節點
當前提交
ba6213b1b6
共有 2 個文件被更改,包括 31 次插入24 次删除
  1. 26 0
      core/hdd/inc/wlan_hdd_tdls.h
  2. 5 24
      core/hdd/src/wlan_hdd_cfg80211.c

+ 26 - 0
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 */

+ 5 - 24
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,