diff mbox series

[PATCHv2,1/6] nl80211: vendor-cmd: qca: add command for CFR configuration

Message ID 1645005922-7252-2-git-send-email-quic_vnaralas@quicinc.com
State New
Headers show
Series ath11k: add single shot/periodic CFR capture support for IPQ8074 | expand

Commit Message

Venkateswara Naralasetty (QUIC) Feb. 16, 2022, 10:05 a.m. UTC
Channel Frequency Response feature is to get the channel state
information from the hardware based on the user configurations
and send the CSI data to user space.

CSI data is further processed in user space which can be used to
identify the motion of the objects.

Add vendor command support to configure per peer CFR parameters.

An example of usage:
iw dev wlanx vendor send 0x1374 0xad cfr-en <val> bw <bw> method <method>
periodicity <period> addr <mac_addr>

0x1374: vendor id
0xad: : vendor subcmd id
val: 0 to disable CFR capture
     1 to enable CFR capture

bw: CFR capture bandwidth(use the values in enum nl80211_chan_width)
	1 - 20MHZ
	2 - 40MHZ
	3 - 80MHZ

method: Method used by hardware to collect the CFR dump
	0 - from the ACKs of QOS NULL packets
	1 - from the ACKs of QOS NULL packets with phase
	2 - from the ACK of probe response packet

periodicity: Periodicity in ms at which CFR dump need to be collect
	0 - single shot capture
	non zero - for Periodic captures

mac_addr: mac address of the peer for which CFR capture is requested.

Signed-off-by: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
---
v2:
 * Updated the commit log.

 include/uapi/linux/nl80211-vnd-qca.h | 104 +++++++++++++++++++++++++++++++++++
 1 file changed, 104 insertions(+)
 create mode 100644 include/uapi/linux/nl80211-vnd-qca.h

Comments

Johannes Berg March 11, 2022, 11:04 a.m. UTC | #1
On Wed, 2022-02-16 at 15:35 +0530, Venkateswara Naralasetty wrote:
> Channel Frequency Response feature is to get the channel state
> information from the hardware based on the user configurations
> and send the CSI data to user space.
> 
> CSI data is further processed in user space which can be used to
> identify the motion of the objects.
> 
> Add vendor command support to configure per peer CFR parameters.
> 
> An example of usage:
> iw dev wlanx vendor send 0x1374 0xad cfr-en <val> bw <bw> method <method>
> periodicity <period> addr <mac_addr>
> 
> 0x1374: vendor id
> 0xad: : vendor subcmd id
> val: 0 to disable CFR capture
>      1 to enable CFR capture
> 
> bw: CFR capture bandwidth(use the values in enum nl80211_chan_width)
> 	1 - 20MHZ
> 	2 - 40MHZ
> 	3 - 80MHZ
> 
> method: Method used by hardware to collect the CFR dump
> 	0 - from the ACKs of QOS NULL packets
> 	1 - from the ACKs of QOS NULL packets with phase
> 	2 - from the ACK of probe response packet
> 
> periodicity: Periodicity in ms at which CFR dump need to be collect
> 	0 - single shot capture
> 	non zero - for Periodic captures
> 
> mac_addr: mac address of the peer for which CFR capture is requested.
> 
> Signed-off-by: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
> ---
> v2:
>  * Updated the commit log.
> 

That's a bit better, thanks.

However, it still doesn't address the question of why it needs to be
vendor specific API.

Is this something fundamentally tied to the hardware? Fundamentally
vendor specific? I'm not sure I see why it would be?

johannes
Venkateswara Naralasetty (QUIC) March 15, 2022, 11:56 a.m. UTC | #2
> -----Original Message-----
> From: Johannes Berg <johannes@sipsolutions.net>
> Sent: Friday, March 11, 2022 4:34 PM
> To: Venkateswara Naralasetty (QUIC) <quic_vnaralas@quicinc.com>;
> ath11k@lists.infradead.org
> Cc: linux-wireless@vger.kernel.org
> Subject: Re: [PATCHv2 1/6] nl80211: vendor-cmd: qca: add command for CFR
> configuration
> 
> On Wed, 2022-02-16 at 15:35 +0530, Venkateswara Naralasetty wrote:
> > Channel Frequency Response feature is to get the channel state
> > information from the hardware based on the user configurations and
> > send the CSI data to user space.
> >
> > CSI data is further processed in user space which can be used to
> > identify the motion of the objects.
> >
> > Add vendor command support to configure per peer CFR parameters.
> >
> > An example of usage:
> > iw dev wlanx vendor send 0x1374 0xad cfr-en <val> bw <bw> method
> > <method> periodicity <period> addr <mac_addr>
> >
> > 0x1374: vendor id
> > 0xad: : vendor subcmd id
> > val: 0 to disable CFR capture
> >      1 to enable CFR capture
> >
> > bw: CFR capture bandwidth(use the values in enum nl80211_chan_width)
> > 	1 - 20MHZ
> > 	2 - 40MHZ
> > 	3 - 80MHZ
> >
> > method: Method used by hardware to collect the CFR dump
> > 	0 - from the ACKs of QOS NULL packets
> > 	1 - from the ACKs of QOS NULL packets with phase
> > 	2 - from the ACK of probe response packet
> >
> > periodicity: Periodicity in ms at which CFR dump need to be collect
> > 	0 - single shot capture
> > 	non zero - for Periodic captures
> >
> > mac_addr: mac address of the peer for which CFR capture is requested.
> >
> > Signed-off-by: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
> > ---
> > v2:
> >  * Updated the commit log.
> >
> 
> That's a bit better, thanks.
> 
> However, it still doesn't address the question of why it needs to be vendor
> specific API.
> 
> Is this something fundamentally tied to the hardware? Fundamentally
> vendor specific? I'm not sure I see why it would be?

CFR capture method can be different from HW to HW. Few HWs might not support all the methods.

> 
> johannes
diff mbox series

Patch

diff --git a/include/uapi/linux/nl80211-vnd-qca.h b/include/uapi/linux/nl80211-vnd-qca.h
new file mode 100644
index 0000000..3c1158d
--- /dev/null
+++ b/include/uapi/linux/nl80211-vnd-qca.h
@@ -0,0 +1,104 @@ 
+/* SPDX-License-Identifier: ISC */
+/*
+ * Qualcomm Atheros OUI and vendor specific assignments
+ * Copyright (c) 2014-2017, Qualcomm Atheros, Inc.
+ * Copyright (c) 2018-2020, The Linux Foundation
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights
+ */
+
+#ifndef _UAPI_NL80211_VND_QCA_H
+#define _UAPI_NL80211_VND_QCA_H
+
+
+/* Vendor id to be used in vendor specific command and events to user space
+ * NOTE: The authoritative place for definition of QCA_NL80211_VENDOR_ID,
+ * vendor subcmd definitions prefixed with QCA_NL80211_VENDOR_SUBCMD, and
+ * qca_wlan_vendor_attr is open source file src/common/qca-vendor.h in
+ * git://w1.fi/srv/git/hostap.git; the values here are just a copy of that
+ */
+#define OUI_QCA 0x001374
+
+/**
+ * enum qca_nl80211_vendor_subcmds - QCA nl80211 vendor command identifiers
+ * @QCA_NL80211_VENDOR_SUBCMD_PEER_CFR_CAPTURE_CFG: This command is used to
+ * configure parameters per peer to capture Channel Frequency Response
+ * (CFR) and enable Periodic CFR capture. The attributes for this command
+ * are defined in enum qca_wlan_vendor_peer_cfr_capture_attr. This command
+ * can also be used to send CFR data from the driver to userspace when
+ * netlink events are used to send CFR data.
+ *
+ */
+enum qca_nl80211_vendor_subcmds {
+	QCA_NL80211_VENDOR_SUBCMD_PEER_CFR_CAPTURE_CFG = 173,
+};
+
+/**
+ * enum qca_wlan_vendor_cfr_method - QCA vendor CFR methods used by
+ * attribute QCA_WLAN_VENDOR_ATTR_PEER_CFR_METHOD as part of vendor
+ * command QCA_NL80211_VENDOR_SUBCMD_PEER_CFR_CAPTURE_CFG.
+ * @QCA_WLAN_VENDOR_CFR_METHOD_QOS_NULL: CFR method using QoS Null frame
+ * @QCA_WLAN_VENDOR_CFR_QOS_NULL_WITH_PHASE: CFR method using QoS Null frame
+ * with phase
+ * @QCA_WLAN_VENDOR_CFR_PROBE_RESPONSE: CFR method using Probe Response frame
+ */
+enum qca_wlan_vendor_cfr_method {
+	QCA_WLAN_VENDOR_CFR_METHOD_QOS_NULL = 0,
+	QCA_WLAN_VENDOR_CFR_QOS_NULL_WITH_PHASE = 1,
+	QCA_WLAN_VENDOR_CFR_PROBE_RESPONSE = 2,
+};
+
+/**
+ * enum qca_wlan_vendor_peer_cfr_capture_attr - Used by the vendor command
+ * QCA_NL80211_VENDOR_SUBCMD_PEER_CFR_CAPTURE_CFG to configure peer
+ * Channel Frequency Response capture parameters and enable periodic CFR
+ * capture.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_CFR_PEER_MAC_ADDR: Optional (6-byte MAC address)
+ * MAC address of peer. This is for CFR version 1 only.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_PEER_CFR_ENABLE: Required (flag)
+ * Enable peer CFR capture. This attribute is mandatory to enable peer CFR
+ * capture. If this attribute is not present, peer CFR capture is disabled.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_PEER_CFR_BANDWIDTH: Optional (u8)
+ * BW of measurement, attribute uses the values in enum nl80211_chan_width
+ * Supported values: 20, 40, 80, 80+80, 160.
+ * Note that all targets may not support all bandwidths.
+ * This attribute is mandatory for version 1 if attribute
+ * QCA_WLAN_VENDOR_ATTR_PEER_CFR_ENABLE is used.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_PEER_CFR_PERIODICITY: Optional (u32)
+ * Periodicity of CFR measurement in milliseconds.
+ * Periodicity should be a multiple of Base timer.
+ * Current Base timer value supported is 10 milliseconds (default).
+ * 0 for one shot capture.
+ * This attribute is mandatory for version 1 if attribute
+ * QCA_WLAN_VENDOR_ATTR_PEER_CFR_ENABLE is used.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_PEER_CFR_METHOD: Optional (u8)
+ * Method used to capture Channel Frequency Response.
+ * Attribute uses the values defined in enum qca_wlan_vendor_cfr_method.
+ * This attribute is mandatory for version 1 if attribute
+ * QCA_WLAN_VENDOR_ATTR_PEER_CFR_ENABLE is used.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_PERIODIC_CFR_CAPTURE_ENABLE: Optional (flag)
+ * Enable periodic CFR capture.
+ * This attribute is mandatory for version 1 to enable Periodic CFR capture.
+ * If this attribute is not present, periodic CFR capture is disabled.
+ */
+enum qca_wlan_vendor_peer_cfr_capture_attr {
+	QCA_WLAN_VENDOR_ATTR_PEER_CFR_CAPTURE_INVALID = 0,
+	QCA_WLAN_VENDOR_ATTR_CFR_PEER_MAC_ADDR = 1,
+	QCA_WLAN_VENDOR_ATTR_PEER_CFR_ENABLE = 2,
+	QCA_WLAN_VENDOR_ATTR_PEER_CFR_BANDWIDTH = 3,
+	QCA_WLAN_VENDOR_ATTR_PEER_CFR_PERIODICITY = 4,
+	QCA_WLAN_VENDOR_ATTR_PEER_CFR_METHOD = 5,
+	QCA_WLAN_VENDOR_ATTR_PERIODIC_CFR_CAPTURE_ENABLE = 6,
+
+	/* Keep last */
+	QCA_WLAN_VENDOR_ATTR_PEER_CFR_AFTER_LAST,
+	QCA_WLAN_VENDOR_ATTR_PEER_CFR_MAX =
+		QCA_WLAN_VENDOR_ATTR_PEER_CFR_AFTER_LAST - 1,
+};
+
+#endif /* QCA_VENDOR_H */