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
This commit is contained in:
Alan Chen 2020-03-04 12:46:16 -08:00 • committed by nshrivas
commit e07616e9b2
2 changed files with 14 additions and 6 deletions

View file

@ -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 \

View file

@ -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 <limits.h> */
#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);