From e07616e9b279db1b779500771ab2fd964abb1b0d Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Wed, 4 Mar 2020 12:46:16 -0800 Subject: [PATCH] qcacld-3.0: Add policy attribute to BEACON_REPORTING According to new changes in kernel 5.4 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.4 requirement add policy to following vendor command as part of this change: QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING Change-Id: I2f7cba7cb16d4a13fab33398e3034e71902317f3 CRs-Fixed: 2635027 --- core/hdd/inc/wlan_hdd_bcn_recv.h | 10 ++++++++-- core/hdd/src/wlan_hdd_bcn_recv.c | 10 ++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_bcn_recv.h b/core/hdd/inc/wlan_hdd_bcn_recv.h index b603ee1f0431..77aef061c520 100644 --- a/core/hdd/inc/wlan_hdd_bcn_recv.h +++ b/core/hdd/inc/wlan_hdd_bcn_recv.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -57,6 +57,10 @@ void hdd_beacon_recv_pause_indication(hdd_handle_t hdd_handle, enum scan_event_type type, bool is_disconnected); +extern const struct nla_policy + beacon_reporting_params_policy + [QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_MAX + 1]; + #define BCN_RECV_FEATURE_VENDOR_COMMANDS \ { \ .info.vendor_id = QCA_NL80211_VENDOR_ID, \ @@ -64,7 +68,9 @@ void hdd_beacon_recv_pause_indication(hdd_handle_t hdd_handle, .flags = WIPHY_VENDOR_CMD_NEED_WDEV | \ WIPHY_VENDOR_CMD_NEED_NETDEV | \ WIPHY_VENDOR_CMD_NEED_RUNNING, \ - .doit = wlan_hdd_cfg80211_bcn_rcv_op\ + .doit = wlan_hdd_cfg80211_bcn_rcv_op, \ + vendor_command_policy(beacon_reporting_params_policy, \ + QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_MAX)\ }, #define BCN_RECV_FEATURE_VENDOR_EVENTS \ diff --git a/core/hdd/src/wlan_hdd_bcn_recv.c b/core/hdd/src/wlan_hdd_bcn_recv.c index 2a017917b676..c42a81735998 100644 --- a/core/hdd/src/wlan_hdd_bcn_recv.c +++ b/core/hdd/src/wlan_hdd_bcn_recv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -40,8 +40,9 @@ #define CHAR_BIT 8 /* Normally in */ #endif -static const struct nla_policy -beacon_reporting_params[QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_MAX + 1] = { +const struct nla_policy + beacon_reporting_params_policy + [QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_OP_TYPE] = {.type = NLA_U8}, [QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_ACTIVE_REPORTING] = {.type = NLA_FLAG}, @@ -348,7 +349,8 @@ static int __wlan_hdd_cfg80211_bcn_rcv_op(struct wiphy *wiphy, errno = wlan_cfg80211_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_MAX, - data, data_len, beacon_reporting_params); + data, + data_len, beacon_reporting_params_policy); if (errno) { hdd_err("Failed to parse the beacon reporting params %d", errno);