Преглед на файлове

qcacld-3.0: Add policy attribute to SUBCMD_GET_CHAIN_RSSI

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_GET_CHAIN_RSSI

Change-Id: Id1d1f1ee339bcef83b714e33cc174f886fee5ce6
CRs-Fixed: 2634263
Srinivas Girigowda преди 5 години
родител
ревизия
802283bd11
променени са 1 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 10 2
      core/hdd/src/wlan_hdd_cfg80211.c

+ 10 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -13840,6 +13840,12 @@ nla_put_failure:
 	return -EINVAL;
 }
 
+static const struct
+nla_policy get_chain_rssi_policy[QCA_WLAN_VENDOR_ATTR_MAX + 1] = {
+	[QCA_WLAN_VENDOR_ATTR_MAC_ADDR]       = {.type = NLA_BINARY,
+						 .len = QDF_MAC_ADDR_SIZE},
+};
+
 /**
  * __wlan_hdd_cfg80211_get_chain_rssi() - get chain rssi
  * @wiphy: wiphy pointer
@@ -13876,7 +13882,7 @@ static int __wlan_hdd_cfg80211_get_chain_rssi(struct wiphy *wiphy,
 		return retval;
 
 	if (wlan_cfg80211_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_MAX,
-				    data, data_len, NULL)) {
+				    data, data_len, get_chain_rssi_policy)) {
 		hdd_err("Invalid ATTR");
 		return -EINVAL;
 	}
@@ -14956,7 +14962,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_get_chain_rssi
+		.doit = wlan_hdd_cfg80211_get_chain_rssi,
+		vendor_command_policy(get_chain_rssi_policy,
+				      QCA_WLAN_VENDOR_ATTR_MAX)
 	},
 
 	FEATURE_ACTIVE_TOS_VENDOR_COMMANDS