diff mbox series

[4/7] nl80211: Introduce new Vendor header file for driver interface with IFX OUI

Message ID 20230425160239.volnhqy7kqp4r4kb@infineon.com
State Superseded
Headers show
Series [1/7] hostapd_cli: wpa_cli: introduce a CMD to dump the driver capability flags2 | expand

Commit Message

Gokul Sivakumar April 25, 2023, 4:02 p.m. UTC
Use a new Vendor header file to maintain Infineon specific vendor subcmds,
attributes and events. And the vendor subcmds and event NL80211 messages
are nested under NL80211_CMD_VENDOR with IFX OUI.

IFX OUI: 00:03:19 (Refer "Infineon AG" in https://standards-oui.ieee.org/)

And introduce a new build flag CONFIG_DRIVER_NL80211_IFX for Infineon WiFi.

Signed-off-by: Gokul Sivakumar <gokulkumar.sivakumar@infineon.com>
---
 hostapd/defconfig        |   3 +
 src/common/ifx_vendor.h  | 118 +++++++++++++++++++++++++++++++++++++++
 src/drivers/drivers.mak  |   3 +
 src/drivers/drivers.mk   |   3 +
 wpa_supplicant/defconfig |   3 +
 5 files changed, 130 insertions(+)
 create mode 100644 src/common/ifx_vendor.h

Comments

Felix Fietkau April 28, 2023, 12:46 p.m. UTC | #1
On 25.04.23 18:02, Gokul Sivakumar wrote:
> Use a new Vendor header file to maintain Infineon specific vendor subcmds,
> attributes and events. And the vendor subcmds and event NL80211 messages
> are nested under NL80211_CMD_VENDOR with IFX OUI.
> 
> IFX OUI: 00:03:19 (Refer "Infineon AG" in https://standards-oui.ieee.org/)
> 
> And introduce a new build flag CONFIG_DRIVER_NL80211_IFX for Infineon WiFi.
> 
> Signed-off-by: Gokul Sivakumar <gokulkumar.sivakumar@infineon.com>
What's the reason for putting all of this into vendor/driver specific 
hackery instead of adding proper upstream nl80211 APIs?

- Felix
Gokul Sivakumar May 7, 2023, 1 p.m. UTC | #2
On Fri, Apr 28, 2023 at 02:46:53PM +0200, Felix Fietkau wrote:
> On 25.04.23 18:02, Gokul Sivakumar wrote:
> > Use a new Vendor header file to maintain Infineon specific vendor subcmds,
> > attributes and events. And the vendor subcmds and event NL80211 messages
> > are nested under NL80211_CMD_VENDOR with IFX OUI.
> > 
> > IFX OUI: 00:03:19 (Refer "Infineon AG" in https://standards-oui.ieee.org/)
> > 
> > And introduce a new build flag CONFIG_DRIVER_NL80211_IFX for Infineon WiFi.
> > 
> > Signed-off-by: Gokul Sivakumar <gokulkumar.sivakumar@infineon.com>
> What's the reason for putting all of this into vendor/driver specific
> hackery instead of adding proper upstream nl80211 APIs?
> 
> - Felix

The subcmds listed here in this new vendor NL80211 header file are used for
triggering a vendor specific configurations/implementations in the WLAN
driver/firmware layers for the Infineon chips which wouldn't be suitable
to add into the standard NL80211 header.

For Example, "IFX_VENDOR_SCMD_FRAMEBURST" is a proprietary feature which is
supported by the Infineon vendor hardware & software.

Gokul
Felix Fietkau May 7, 2023, 7:34 p.m. UTC | #3
On 07.05.23 15:00, Gokul Sivakumar wrote:
> On Fri, Apr 28, 2023 at 02:46:53PM +0200, Felix Fietkau wrote:
>> On 25.04.23 18:02, Gokul Sivakumar wrote:
>> > Use a new Vendor header file to maintain Infineon specific vendor subcmds,
>> > attributes and events. And the vendor subcmds and event NL80211 messages
>> > are nested under NL80211_CMD_VENDOR with IFX OUI.
>> > 
>> > IFX OUI: 00:03:19 (Refer "Infineon AG" in https://standards-oui.ieee.org/)
>> > 
>> > And introduce a new build flag CONFIG_DRIVER_NL80211_IFX for Infineon WiFi.
>> > 
>> > Signed-off-by: Gokul Sivakumar <gokulkumar.sivakumar@infineon.com>
>> What's the reason for putting all of this into vendor/driver specific
>> hackery instead of adding proper upstream nl80211 APIs?
>> 
>> - Felix
> 
> The subcmds listed here in this new vendor NL80211 header file are used for
> triggering a vendor specific configurations/implementations in the WLAN
> driver/firmware layers for the Infineon chips which wouldn't be suitable
> to add into the standard NL80211 header.
> 
> For Example, "IFX_VENDOR_SCMD_FRAMEBURST" is a proprietary feature which is
> supported by the Infineon vendor hardware & software.

I agree that it makes sense to use vendor specific code for proprietary 
features. It just seems to me that for some of the things in there it 
would make more sense to extend the upstream API instead of polluting 
hostapd with vendor specific hacks.

- Felix
Gokul Sivakumar Aug. 22, 2023, 2:38 p.m. UTC | #4
On Sun, May 07, 2023 at 09:34:10PM +0200, Felix Fietkau wrote:
> On 07.05.23 15:00, Gokul Sivakumar wrote:
> > On Fri, Apr 28, 2023 at 02:46:53PM +0200, Felix Fietkau wrote:
> > > On 25.04.23 18:02, Gokul Sivakumar wrote:
> > > > Use a new Vendor header file to maintain Infineon specific vendor subcmds,
> > > > attributes and events. And the vendor subcmds and event NL80211 messages
> > > > are nested under NL80211_CMD_VENDOR with IFX OUI.
> > > >
> > > > IFX OUI: 00:03:19 (Refer "Infineon AG" in https://standards-oui.ieee.org/)
> > > >
> > > > And introduce a new build flag CONFIG_DRIVER_NL80211_IFX for Infineon WiFi.
> > > >
> > > > Signed-off-by: Gokul Sivakumar <gokulkumar.sivakumar@infineon.com>
> > > What's the reason for putting all of this into vendor/driver specific
> > > hackery instead of adding proper upstream nl80211 APIs?
> > > 
> > > - Felix
> > 
> > The subcmds listed here in this new vendor NL80211 header file are used for
> > triggering a vendor specific configurations/implementations in the WLAN
> > driver/firmware layers for the Infineon chips which wouldn't be suitable
> > to add into the standard NL80211 header.
> > 
> > For Example, "IFX_VENDOR_SCMD_FRAMEBURST" is a proprietary feature which is
> > supported by the Infineon vendor hardware & software.
> 
> I agree that it makes sense to use vendor specific code for proprietary
> features. It just seems to me that for some of the things in there it
> would make more sense to extend the upstream API instead of polluting
> hostapd with vendor specific hacks.
> 

Understood the concern here. Will shortly send an updated v3 patchset after
removing some of the newly introduced generic IFX vendor specific NL80211 API
from the v2 patchset, which could be potentially supported later by extending
the standard NL80211 API.

- Gokul
diff mbox series

Patch

diff --git a/hostapd/defconfig b/hostapd/defconfig
index a9eab4d9c..37499b4ee 100644
--- a/hostapd/defconfig
+++ b/hostapd/defconfig
@@ -21,6 +21,9 @@  CONFIG_DRIVER_NL80211=y
 # QCA vendor extensions to nl80211
 #CONFIG_DRIVER_NL80211_QCA=y
 
+# IFX vendor extensions to nl80211
+#CONFIG_DRIVER_NL80211_IFX=y
+
 # driver_nl80211.c requires libnl. If you are compiling it yourself
 # you may need to point hostapd to your version of libnl.
 #
diff --git a/src/common/ifx_vendor.h b/src/common/ifx_vendor.h
new file mode 100644
index 000000000..729c01901
--- /dev/null
+++ b/src/common/ifx_vendor.h
@@ -0,0 +1,118 @@ 
+/*
+ * Infineon OUI and vendor specific assignments
+ * Copyright (c) 2023, Cypress Semiconductor Corporation (an Infineon company)
+ *
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
+ */
+
+#ifndef IFX_VENDOR_H
+#define IFX_VENDOR_H
+
+/*
+ * This file is a registry of identifier assignments from the Infineon
+ * OUI 00:03:19 for purposes other than MAC address assignment. New identifiers
+ * can be assigned through normal review process for changes to the upstream
+ * hostap.git repository.
+ */
+#define OUI_IFX		0x000319
+
+/*
+ * enum ifx_nl80211_vendor_subcmds - IFX nl80211 vendor command identifiers
+ *
+ * @IFX_VENDOR_SCMD_UNSPEC: Reserved value 0
+ *
+ * @IFX_VENDOR_SCMD_DCMD: Handle the Dongle commands triggered from the userspace utilities.
+ *	These commands will be passed to the Dongle for processing.
+ *
+ * @IFX_VENDOR_SCMD_FRAMEBURST: Control the Frameburst feature. This feature allows more
+ *	efficient use of the airtime between the transmitting and receiving WLAN devices.
+ *
+ * @IFX_VENDOR_SCMD_ACS: Configure the Automatic Channel Selection (ACS) feature.
+ *
+ * @IFX_VENDOR_SCMD_SET_MAC_P2P_DEV: Set MAC address for a P2P Discovery device.
+ *	Uses Vendor attribute IFX_VENDOR_ATTR_MAC_ADDR to pass the MAC address.
+ *
+ * @IFX_VENDOR_SCMD_MUEDCA: Configure Multi User Enhanced Distrubuted Channel Access (MU-EDCA).
+ *
+ * @IFX_VENDOR_SCMD_LDPC: Enable support for handling Low Density Parity Check (LDPC) Coding
+ *	in received payload.
+ *
+ * @IFX_VENDOR_SCMD_AMSDU: Control AMSDU aggregation for both TX & RX on all the TID queues.
+ *
+ * @IFX_VENDOR_SCMD_TWT: Configure Target Wake Time (TWT) Session with the needed parameters.
+ *
+ * @IFX_VENDOR_SCMD_OCE: Configure the Optimized Connectivity Experience (OCE) functionality
+ *	related parameters.
+ *
+ * @IFX_VENDOR_SCMD_BSSCOLOR: Set BSS Color (1-63) for AP Mode operation in HE.
+ *
+ * @IFX_VENDOR_SCMD_RAND_MAC: Configure the Random MAC module.
+ *
+ * @IFX_VENDOR_SCMD_MBO: Configure Multi Band Operation (MBO) functionality related parameters.
+ *
+ * @IFX_VENDOR_SCMD_MPC: Control the Minimum Power Consumption (MPC) feature.
+ *	This is a STA-only power saving feature and not related to 802.11 power save.
+ *
+ * @IFX_VENDOR_SCMD_GIANTRX: Allow handling RX MGMT Packts of size 1840 bytes.
+ *
+ * @IFX_VENDOR_SCMD_PFN_CONFIG: Send the Preferred Network (PFN) information to the Dongle
+ *
+ * @IFX_VENDOR_SCMD_PFN_STATUS: Fetch the Preferred Network (PFN) information from the Dongle
+ *	through the driver.
+ *
+ * @IFX_VENDOR_SCMD_WNM: Configure the Wireless Network Management (WNM) 802.11v functionaltiy
+ *	related parameters.
+ *
+ * @IFX_VENDOR_SCMD_MAX: This acts as a the tail of cmds list.
+ *      Make sure it located at the end of the list.
+ */
+enum ifx_nl80211_vendor_subcmds {
+	IFX_VENDOR_SCMD_UNSPEC			= 0,
+	IFX_VENDOR_SCMD_DCMD			= 1,
+	/* Reserved 2-5 */
+	IFX_VENDOR_SCMD_FRAMEBURST		= 6,
+	/* Reserved 7-8 */
+	IFX_VENDOR_SCMD_ACS			= 9,
+	IFX_VENDOR_SCMD_SET_MAC_P2P_DEV		= 10,
+	IFX_VENDOR_SCMD_MUEDCA			= 11,
+	IFX_VENDOR_SCMD_LDPC			= 12,
+	IFX_VENDOR_SCMD_AMSDU			= 13,
+	IFX_VENDOR_SCMD_TWT			= 14,
+	IFX_VENDOR_SCMD_OCE			= 15,
+	IFX_VENDOR_SCMD_BSSCOLOR		= 16,
+	IFX_VENDOR_SCMD_RAND_MAC		= 17,
+	IFX_VENDOR_SCMD_MBO			= 18,
+	IFX_VENDOR_SCMD_MPC			= 19,
+	IFX_VENDOR_SCMD_GIANTRX			= 20,
+	IFX_VENDOR_SCMD_PFN_CONFIG		= 21,
+	IFX_VENDOR_SCMD_PFN_STATUS		= 22,
+	/* Reserved 23-24 */
+	IFX_VENDOR_SCMD_WNM			= 25,
+	IFX_VENDOR_SCMD_MAX
+};
+
+/*
+ * enum ifx_vendor_attr - IFX nl80211 vendor attributes
+ *
+ * @IFX_VENDOR_ATTR_UNSPEC: Reserved value 0
+ *
+ * @IFX_VENDOR_ATTR_LEN: Dongle Command Message Body Length.
+ *
+ * @IFX_VENDOR_ATTR_DATA: Dongle Commend Message Body.
+ *
+ * @IFX_VENDOR_ATTR_MAC_ADDR: Medium Access Control (MAC) address.
+ *
+ * @IFX_VENDOR_ATTR_MAX: This acts as a the tail of attrs list.
+ *      Make sure it located at the end of the list.
+ */
+enum ifx_vendor_attr {
+	IFX_VENDOR_ATTR_UNSPEC		= 0,
+	IFX_VENDOR_ATTR_LEN		= 1,
+	IFX_VENDOR_ATTR_DATA		= 2,
+	IFX_VENDOR_ATTR_MAC_ADDR	= 3,
+	/* Reserved 4-10 */
+	IFX_VENDOR_ATTR_MAX
+};
+
+#endif /* IFX_VENDOR_H */
diff --git a/src/drivers/drivers.mak b/src/drivers/drivers.mak
index a03d4a034..fe2c5554f 100644
--- a/src/drivers/drivers.mak
+++ b/src/drivers/drivers.mak
@@ -50,6 +50,9 @@  DRV_OBJS += ../src/drivers/driver_nl80211_scan.o
 ifdef CONFIG_DRIVER_NL80211_QCA
 DRV_CFLAGS += -DCONFIG_DRIVER_NL80211_QCA
 endif
+ifdef CONFIG_DRIVER_NL80211_IFX
+DRV_CFLAGS += -DCONFIG_DRIVER_NL80211_IFX
+endif
 NEED_SME=y
 NEED_AP_MLME=y
 NEED_NETLINK=y
diff --git a/src/drivers/drivers.mk b/src/drivers/drivers.mk
index 10eab6a92..03ec32da3 100644
--- a/src/drivers/drivers.mk
+++ b/src/drivers/drivers.mk
@@ -44,6 +44,9 @@  endif
 ifdef CONFIG_DRIVER_NL80211_BRCM
 DRV_CFLAGS += -DCONFIG_DRIVER_NL80211_BRCM
 endif
+ifdef CONFIG_DRIVER_NL80211_IFX
+DRV_CFLAGS += -DCONFIG_DRIVER_NL80211_IFX
+endif
 NEED_SME=y
 NEED_AP_MLME=y
 NEED_NETLINK=y
diff --git a/wpa_supplicant/defconfig b/wpa_supplicant/defconfig
index a4f20d439..03dba3465 100644
--- a/wpa_supplicant/defconfig
+++ b/wpa_supplicant/defconfig
@@ -34,6 +34,9 @@  CONFIG_DRIVER_NL80211=y
 # QCA vendor extensions to nl80211
 #CONFIG_DRIVER_NL80211_QCA=y
 
+# IFX vendor extensions to nl80211
+#CONFIG_DRIVER_NL80211_IFX=y
+
 # driver_nl80211.c requires libnl. If you are compiling it yourself
 # you may need to point hostapd to your version of libnl.
 #