wifi: mt76: mt792x: Add MTK OUI support for wpa supplicant
Subsystems (2)
PATCH 1/1 wifi: mt76: mt792x: Add MTK OUI support for wpa supplicant
From: Michael Shih <[email protected]>
Implement MediaTek OUI vendor command in the mt76 driver by defining a
wiphy_vendor_command table with a GET_CHIP_INFO sub-command handler.
--- drivers/net/wireless/mediatek/mt76/Makefile | 2 +- drivers/net/wireless/mediatek/mt76/mt792x.h | 1 + .../net/wireless/mediatek/mt76/mt792x_core.c | 2 + .../wireless/mediatek/mt76/mt792x_vendor.c | 76 +++++++++++++++++++ .../wireless/mediatek/mt76/mt792x_vendor.h | 36 +++++++++ 5 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 drivers/net/wireless/mediatek/mt76/mt792x_vendor.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt792x_vendor.h
drivers/net/wireless/mediatek/mt76/Makefile +1 -1
@@ -38,7 +38,7 @@ mt76x02-usb-y := mt76x02_usb_mcu.o mt76x02_usb_core.o mt76-connac-lib-y := mt76_connac_mcu.o mt76_connac_mac.o mt76_connac3_mac.o mt792x-lib-y := mt792x_core.o mt792x_mac.o mt792x_trace.o \ - mt792x_debugfs.o mt792x_dma.o + mt792x_debugfs.o mt792x_dma.o mt792x_vendor.o mt792x-lib-$(CONFIG_ACPI) += mt792x_acpi_sar.o mt792x-usb-y := mt792x_usb.o
drivers/net/wireless/mediatek/mt76/mt792x.h +1 -0
@@ -538,6 +538,7 @@ int mt792x_pm_stats(struct seq_file *s, void *data);int mt792x_pm_idle_timeout_set (void *data,u64 val);int mt792x_pm_idle_timeout_get (void *data,u64 *val);int mt792x_init_wiphy (struct ieee80211_hw *hw); +void mt792x_vendor_register (struct ieee80211_hw *hw);struct ieee80211_ops * mt792x_get_mac80211_ops(struct device *dev, const struct ieee80211_ops *mac80211_ops,
drivers/net/wireless/mediatek/mt76/mt792x_core.c +2 -0
@@ -854,6 +854,8 @@ int mt792x_init_wiphy(struct ieee80211_hw *hw) hw->max_tx_fragments =4 ; +mt792x_vendor_register (hw); +return 0 ; }EXPORT_SYMBOL_GPL (mt792x_init_wiphy);
drivers/net/wireless/mediatek/mt76/mt792x_vendor.c new file +76 -0
76 lines not on this page · raw message
drivers/net/wireless/mediatek/mt76/mt792x_vendor.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: ISC */ +/* Copyright (C) 2026 MediaTek Inc. */ + +#ifndef __MT792X_VENDOR_H +#define __MT792X_VENDOR_H + +/* MediaTek nl80211 vendor OUI (24-bit OUI placed in the low 24 bits). +* This is the value advertised to user space (e.g. wpa_supplicant's +* wiphy_info_handler) via NL80211_ATTR_VENDOR_DATA in the GET_WIPHY reply. +*/ +#define MTK_NL80211_VENDOR_ID 0x000ce7 + +/* vendor sub-commands (defined by the vendor) */ +enum mtk_nl80211_vendor_subcmds { +MTK_NL80211_VENDOR_SUBCMD_UNSPEC =0 , +MTK_NL80211_VENDOR_SUBCMD_GET_CHIP_INFO =1 , +}; + +/* vendor event indexes (used by cfg80211_vendor_event*) */ +enum mtk_nl80211_vendor_events { +MTK_NL80211_VENDOR_EVENT_CHIP_INFO =0 , +}; + +/* attributes carried in the GET_CHIP_INFO vendor command reply */ +enum mtk_vendor_attr_chip_info { +MTK_VENDOR_ATTR_CHIP_INFO_INVALID =0 , +MTK_VENDOR_ATTR_CHIP_INFO_ID =1 , +MTK_VENDOR_ATTR_CHIP_INFO_OUI =2 , + +/* keep last */ + __MTK_VENDOR_ATTR_CHIP_INFO_MAX, +MTK_VENDOR_ATTR_CHIP_INFO_MAX = + __MTK_VENDOR_ATTR_CHIP_INFO_MAX -1 , +}; + +#endif /* __MT792X_VENDOR_H */
Signature · 1 line
2.45.2
PATCH v2 1/1 wifi: mt76: mt7928: Add MTK OUI support for nl80211 (ALOS support for wpa_supplicant to get MTK OUI)
Customer request MTK to support OUI for wpa supplicant.
CR-Id: BORA00080136
---
v2: Added "CONFIG_MT792x_VENDOR_CMD" for Kconfig build flag
--- drivers/net/wireless/mediatek/mt76/Kconfig | 12 +++ drivers/net/wireless/mediatek/mt76/Makefile | 1 + drivers/net/wireless/mediatek/mt76/mt792x.h | 5 ++ .../net/wireless/mediatek/mt76/mt792x_core.c | 2 + .../wireless/mediatek/mt76/mt792x_vendor.c | 76 +++++++++++++++++++ .../wireless/mediatek/mt76/mt792x_vendor.h | 36 +++++++++ 6 files changed, 132 insertions(+) create mode 100644 drivers/net/wireless/mediatek/mt76/mt792x_vendor.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt792x_vendor.h
drivers/net/wireless/mediatek/mt76/Kconfig +12 -0
@@ -33,6 +33,18 @@ config MT792x_LIB tristate select MT76_CONNAC_LIB +config MT792x_VENDOR_CMD + bool "MediaTek MT792x nl80211 vendor command support" + depends on MT792x_LIB + default y + help + Advertise the MediaTek OUI (0x000CE7) nl80211 vendor command + interface, allowing user space (e.g. wpa_supplicant) to query + chip information. This is a read-only query interface and has no + effect unless a matching vendor command is issued from user space. + + Say N to disable the interface entirely. + config MT792x_USB tristate select MT76_USB
drivers/net/wireless/mediatek/mt76/Makefile +1 -0
@@ -40,6 +40,7 @@ mt76-connac-lib-y := mt76_connac_mcu.o mt76_connac_mac.o mt76_connac3_mac.o mt792x-lib-y := mt792x_core.o mt792x_mac.o mt792x_trace.o \ mt792x_debugfs.o mt792x_dma.o mt792x-lib-$(CONFIG_ACPI) += mt792x_acpi_sar.o +mt792x-lib-$(CONFIG_MT792x_VENDOR_CMD) += mt792x_vendor.o mt792x-usb-y := mt792x_usb.o obj-$(CONFIG_MT76x0_COMMON) += mt76x0/
drivers/net/wireless/mediatek/mt76/mt792x.h +5 -0
@@ -558,6 +558,11 @@ int mt792x_pm_stats(struct seq_file *s, void *data);int mt792x_pm_idle_timeout_set (void *data,u64 val);int mt792x_pm_idle_timeout_get (void *data,u64 *val);int mt792x_init_wiphy (struct ieee80211_hw *hw); +#if IS_ENABLED (CONFIG_MT792x_VENDOR_CMD) +void mt792x_vendor_register (struct ieee80211_hw *hw); +#else +static inline void mt792x_vendor_register (struct ieee80211_hw *hw) {} +#endif struct ieee80211_ops * mt792x_get_mac80211_ops(struct device *dev, const struct ieee80211_ops *mac80211_ops,
drivers/net/wireless/mediatek/mt76/mt792x_core.c +2 -0
@@ -876,6 +876,8 @@ int mt792x_init_wiphy(struct ieee80211_hw *hw) hw->max_tx_fragments =4 ; +mt792x_vendor_register (hw); +return 0 ; }EXPORT_SYMBOL_GPL (mt792x_init_wiphy);
drivers/net/wireless/mediatek/mt76/mt792x_vendor.c new file +76 -0
76 lines not on this page · raw message
drivers/net/wireless/mediatek/mt76/mt792x_vendor.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: ISC */ +/* Copyright (C) 2026 MediaTek Inc. */ + +#ifndef __MT792X_VENDOR_H +#define __MT792X_VENDOR_H + +/* MediaTek nl80211 vendor OUI (24-bit OUI placed in the low 24 bits). +* This is the value advertised to user space (e.g. wpa_supplicant's +* wiphy_info_handler) via NL80211_ATTR_VENDOR_DATA in the GET_WIPHY reply. +*/ +#define MTK_NL80211_VENDOR_ID 0x000ce7 + +/* vendor sub-commands (defined by the vendor) */ +enum mtk_nl80211_vendor_subcmds { +MTK_NL80211_VENDOR_SUBCMD_UNSPEC =0 , +MTK_NL80211_VENDOR_SUBCMD_GET_CHIP_INFO =1 , +}; + +/* vendor event indexes (used by cfg80211_vendor_event*) */ +enum mtk_nl80211_vendor_events { +MTK_NL80211_VENDOR_EVENT_CHIP_INFO =0 , +}; + +/* attributes carried in the GET_CHIP_INFO vendor command reply */ +enum mtk_vendor_attr_chip_info { +MTK_VENDOR_ATTR_CHIP_INFO_INVALID =0 , +MTK_VENDOR_ATTR_CHIP_INFO_ID =1 , +MTK_VENDOR_ATTR_CHIP_INFO_OUI =2 , + +/* keep last */ + __MTK_VENDOR_ATTR_CHIP_INFO_MAX, +MTK_VENDOR_ATTR_CHIP_INFO_MAX = + __MTK_VENDOR_ATTR_CHIP_INFO_MAX -1 , +}; + +#endif /* __MT792X_VENDOR_H */
Signature · 1 line
2.45.2
PATCH v3 1/1 wifi: mt76: mt7928: Add MTK OUI support for nl80211 (ALOS support for wpa_supplicant to get MTK OUI)
Customer request MTK to support OUI for wpa supplicant.
---
v2: Added "CONFIG_MT792x_VENDOR_CMD" for Kconfig build flag
v3: Fix commit message.
--- drivers/net/wireless/mediatek/mt76/Kconfig | 12 +++ drivers/net/wireless/mediatek/mt76/Makefile | 1 + drivers/net/wireless/mediatek/mt76/mt792x.h | 5 ++ .../net/wireless/mediatek/mt76/mt792x_core.c | 2 + .../wireless/mediatek/mt76/mt792x_vendor.c | 76 +++++++++++++++++++ .../wireless/mediatek/mt76/mt792x_vendor.h | 36 +++++++++ 6 files changed, 132 insertions(+) create mode 100644 drivers/net/wireless/mediatek/mt76/mt792x_vendor.c create mode 100644 drivers/net/wireless/mediatek/mt76/mt792x_vendor.h
drivers/net/wireless/mediatek/mt76/Kconfig +12 -0
@@ -33,6 +33,18 @@ config MT792x_LIB tristate select MT76_CONNAC_LIB +config MT792x_VENDOR_CMD + bool "MediaTek MT792x nl80211 vendor command support" + depends on MT792x_LIB + default y + help + Advertise the MediaTek OUI (0x000CE7) nl80211 vendor command + interface, allowing user space (e.g. wpa_supplicant) to query + chip information. This is a read-only query interface and has no + effect unless a matching vendor command is issued from user space. + + Say N to disable the interface entirely. + config MT792x_USB tristate select MT76_USB
drivers/net/wireless/mediatek/mt76/Makefile +1 -0
@@ -40,6 +40,7 @@ mt76-connac-lib-y := mt76_connac_mcu.o mt76_connac_mac.o mt76_connac3_mac.o mt792x-lib-y := mt792x_core.o mt792x_mac.o mt792x_trace.o \ mt792x_debugfs.o mt792x_dma.o mt792x-lib-$(CONFIG_ACPI) += mt792x_acpi_sar.o +mt792x-lib-$(CONFIG_MT792x_VENDOR_CMD) += mt792x_vendor.o mt792x-usb-y := mt792x_usb.o obj-$(CONFIG_MT76x0_COMMON) += mt76x0/
drivers/net/wireless/mediatek/mt76/mt792x.h +5 -0
@@ -558,6 +558,11 @@ int mt792x_pm_stats(struct seq_file *s, void *data);int mt792x_pm_idle_timeout_set (void *data,u64 val);int mt792x_pm_idle_timeout_get (void *data,u64 *val);int mt792x_init_wiphy (struct ieee80211_hw *hw); +#if IS_ENABLED (CONFIG_MT792x_VENDOR_CMD) +void mt792x_vendor_register (struct ieee80211_hw *hw); +#else +static inline void mt792x_vendor_register (struct ieee80211_hw *hw) {} +#endif struct ieee80211_ops * mt792x_get_mac80211_ops(struct device *dev, const struct ieee80211_ops *mac80211_ops,
drivers/net/wireless/mediatek/mt76/mt792x_core.c +2 -0
@@ -876,6 +876,8 @@ int mt792x_init_wiphy(struct ieee80211_hw *hw) hw->max_tx_fragments =4 ; +mt792x_vendor_register (hw); +return 0 ; }EXPORT_SYMBOL_GPL (mt792x_init_wiphy);
drivers/net/wireless/mediatek/mt76/mt792x_vendor.c new file +76 -0
76 lines not on this page · raw message
drivers/net/wireless/mediatek/mt76/mt792x_vendor.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: ISC */ +/* Copyright (C) 2026 MediaTek Inc. */ + +#ifndef __MT792X_VENDOR_H +#define __MT792X_VENDOR_H + +/* MediaTek nl80211 vendor OUI (24-bit OUI placed in the low 24 bits). +* This is the value advertised to user space (e.g. wpa_supplicant's +* wiphy_info_handler) via NL80211_ATTR_VENDOR_DATA in the GET_WIPHY reply. +*/ +#define MTK_NL80211_VENDOR_ID 0x000ce7 + +/* vendor sub-commands (defined by the vendor) */ +enum mtk_nl80211_vendor_subcmds { +MTK_NL80211_VENDOR_SUBCMD_UNSPEC =0 , +MTK_NL80211_VENDOR_SUBCMD_GET_CHIP_INFO =1 , +}; + +/* vendor event indexes (used by cfg80211_vendor_event*) */ +enum mtk_nl80211_vendor_events { +MTK_NL80211_VENDOR_EVENT_CHIP_INFO =0 , +}; + +/* attributes carried in the GET_CHIP_INFO vendor command reply */ +enum mtk_vendor_attr_chip_info { +MTK_VENDOR_ATTR_CHIP_INFO_INVALID =0 , +MTK_VENDOR_ATTR_CHIP_INFO_ID =1 , +MTK_VENDOR_ATTR_CHIP_INFO_OUI =2 , + +/* keep last */ + __MTK_VENDOR_ATTR_CHIP_INFO_MAX, +MTK_VENDOR_ATTR_CHIP_INFO_MAX = + __MTK_VENDOR_ATTR_CHIP_INFO_MAX -1 , +}; + +#endif /* __MT792X_VENDOR_H */
Signature · 1 line
2.45.2
Felix Fietkau
maintainerRe: [PATCH v3] wifi: mt76: mt7928: Add MTK OUI support for nl80211 (ALOS support for wpa_supplicant to get MTK OUI)
Hi,
Quoted 3 lines · Michael Shih
Customer request MTK to support OUI for wpa supplicant.
Signed-off-by Michael Shih <[email protected]>
What is this supposed to be used for?
Thanks,
- Felix
Re: [PATCH v3] wifi: mt76: mt7928: Add MTK OUI support for nl80211 (ALOS support for wpa_supplicant to get MTK OUI)
Hi Felix,
This is a driver patch that supports advertising MediaTek OUI vendor command in the mt76 driver for WPA supplicant.
This support feature will only be triggered intentionally.
Therefore, I have added build flag in Kconfig so that it will not be enabled in upstream if not required, it is supposed to be used in Android platforms.
I hope this will clarify your question.
Thanks,
Michael.
Quoted 11 lines
Hi,
Quoted 3 lines · Michael Shih
Customer request MTK to support OUI for wpa supplicant.
Signed-off-by Michael Shih <[email protected]>What is this supposed to be used for?
Thanks,
- Felix
Felix Fietkau
maintainerRe: [PATCH v3] wifi: mt76: mt7928: Add MTK OUI support for nl80211 (ALOS support for wpa_supplicant to get MTK OUI)
Hi Michael,
What functionality sits behind this call, and is it something that might be worth implementing through a proper nl80211 API?
Thanks,
- Felix
Quoted 25 lines · Michael Shih (史君仲)
Hi Felix,
This is a driver patch that supports advertising MediaTek OUI vendor command in the mt76 driver for WPA supplicant.
This support feature will only be triggered intentionally.Therefore, I have added build flag in
Kconfigso that it will not be enabled in upstream if not required, it is supposed to be used in Android platforms.I hope this will clarify your question.
Thanks,
Michael.Quoted 11 lines
Hi,
Quoted 3 lines · Michael Shih
Customer request MTK to support OUI for wpa supplicant.
Signed-off-by Michael Shih <[email protected]>What is this supposed to be used for?
Thanks,
- Felix