Browse Source

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
Paul Zhang 5 years ago
parent
commit
3e231a9fd2
2 changed files with 11 additions and 5 deletions
  1. 2 1
      core/hdd/inc/wlan_hdd_nan.h
  2. 9 4
      core/hdd/src/wlan_hdd_cfg80211.c

+ 2 - 1
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,                \

+ 9 - 4
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