From 802283bd112d4dfcd41e756631415fe591d795f1 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Tue, 3 Mar 2020 17:17:37 -0800 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_cfg80211.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index b232c7a71f42..3d5d1045f253 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/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