Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c04a7bb authored by Ahmad Masri's avatar Ahmad Masri Committed by Alexei Avshalom Lazar
Browse files

wil6210: add policy for all vendor commands



Kernel 5.3.0 and later checks that all vendor commands registered
with the device has a policy. add relevant policies for all
commands.

Change-Id: I4a24618d10f17cd61b8f6e4b149a5494b0af9639
Signed-off-by: default avatarAhmad Masri <amasri@codeaurora.org>
parent 9e6b7650
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/etherdevice.h>
@@ -362,6 +362,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_LOC_GET_CAPA,
		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
			 WIPHY_VENDOR_CMD_NEED_RUNNING,
		.policy = VENDOR_CMD_RAW_DATA,
		.doit = wil_ftm_get_capabilities
	},
	{
@@ -369,6 +370,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_FTM_START_SESSION,
		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
			 WIPHY_VENDOR_CMD_NEED_RUNNING,
		.policy = wil_nl80211_loc_policy,
		.doit = wil_ftm_start_session
	},
	{
@@ -376,6 +378,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_FTM_ABORT_SESSION,
		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
			 WIPHY_VENDOR_CMD_NEED_RUNNING,
		.policy = VENDOR_CMD_RAW_DATA,
		.doit = wil_ftm_abort_session
	},
	{
@@ -383,6 +386,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_FTM_CFG_RESPONDER,
		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
			 WIPHY_VENDOR_CMD_NEED_RUNNING,
		.policy = VENDOR_CMD_RAW_DATA,
		.doit = wil_ftm_configure_responder
	},
	{
@@ -390,6 +394,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_AOA_MEAS,
		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
			 WIPHY_VENDOR_CMD_NEED_RUNNING,
		.policy = wil_nl80211_loc_policy,
		.doit = wil_aoa_start_measurement
	},
	{
@@ -397,6 +402,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_AOA_ABORT_MEAS,
		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
			 WIPHY_VENDOR_CMD_NEED_RUNNING,
		.policy = VENDOR_CMD_RAW_DATA,
		.doit = wil_aoa_abort_measurement
	},
	{
@@ -438,6 +444,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_BRP_SET_ANT_LIMIT,
		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
			 WIPHY_VENDOR_CMD_NEED_RUNNING,
		.policy = wil_brp_ant_limit_policy,
		.doit = wil_brp_set_ant_limit
	},
	{
@@ -445,6 +452,7 @@ static const struct wiphy_vendor_command wil_nl80211_vendor_commands[] = {
		.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_UNSPEC,
		.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
			 WIPHY_VENDOR_CMD_NEED_NETDEV,
		.policy = wil_nl_60g_policy,
		.doit = wil_nl_60g_handle_cmd
	},
};
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: ISC
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */

#include <linux/etherdevice.h>
#include <net/netlink.h>
@@ -36,7 +36,7 @@ enum qca_attr_loc_reuse {
	QCA_ATTR_PAD = 13,
};

static const struct
const struct
nla_policy wil_nl80211_loc_policy[QCA_ATTR_LOC_MAX + 1] = {
	[QCA_ATTR_FTM_SESSION_COOKIE] = { .type = NLA_U64 },
	[QCA_ATTR_LOC_CAPA] = { .type = NLA_NESTED },
+4 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: ISC */
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. */
/* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */

#ifndef __WIL6210_FTM_H__
#define __WIL6210_FTM_H__
@@ -491,6 +491,9 @@ struct wil_ftm_priv {
	struct work_struct aoa_timeout_work;
};

extern const struct
nla_policy wil_nl80211_loc_policy[];

int wil_ftm_get_capabilities(struct wiphy *wiphy, struct wireless_dev *wdev,
			     const void *data, int data_len);
int wil_ftm_start_session(struct wiphy *wiphy, struct wireless_dev *wdev,
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: ISC */
/*
 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */

#ifndef __WIL6210_H__
@@ -14,6 +14,7 @@
#include <linux/timex.h>
#include <linux/types.h>
#include <linux/irqreturn.h>
#include <net/netlink.h>
#include "wmi.h"
#include "wil_platform.h"
#include "ftm.h"