Linux wireless drivers development
 help / color / mirror / Atom feed
From: jeff.chen_1@oss.nxp.com
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net, francesco@dolcini.it,
	kees+treewide@kernel.org, arend.vanspriel@broadcom.com,
	benjamin.berg@intel.com, Jeff Chen <jeff.chen_1@nxp.com>
Subject: [PATCH nxpwifi-next v3 1/3] wifi: nl80211: vendor-cmd: add NXP vendor command definitions
Date: Mon,  5 Oct 2026 13:44:12 +0800	[thread overview]
Message-ID: <20261005054414.2874415-2-jeff.chen_1@oss.nxp.com> (raw)
In-Reply-To: <20261005054414.2874415-1-jeff.chen_1@oss.nxp.com>

From: Jeff Chen <jeff.chen_1@nxp.com>

Add NXP vendor command and attribute definitions for use with
NL80211_CMD_VENDOR.

The initial user of this interface is the Transmit Rate-based Power
Control (TRPC) configuration command.

The TRPC table is a firmware-defined ABI that contains TX power limit
data. Existing nl80211 TX power interfaces allow TX power levels to be
configured, but do not provide an interface for exchanging TRPC table
data between userspace and firmware.

Therefore, the TRPC configuration interface is exposed through a vendor
command. The kernel does not interpret the TRPC table contents and only
passes the table data between userspace and firmware.

Example use cases include:
- Reading firmware TX power limit configuration for verification.
- Updating platform-specific TX power limit tables.
- Supporting manufacturing, validation, regulatory, and platform
  bring-up workflows that require access to firmware-defined TX power
  limit data.

Assisted-by: LLM
Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
---
 include/uapi/linux/nl80211-vnd-nxp.h | 81 ++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 include/uapi/linux/nl80211-vnd-nxp.h

diff --git a/include/uapi/linux/nl80211-vnd-nxp.h b/include/uapi/linux/nl80211-vnd-nxp.h
new file mode 100644
index 000000000000..4e18d0f5af03
--- /dev/null
+++ b/include/uapi/linux/nl80211-vnd-nxp.h
@@ -0,0 +1,81 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/*
+ * NXP vendor command definitions for nl80211
+ *
+ * Copyright 2026 NXP
+ */
+
+#ifndef __VENDOR_CMD_NXP_H__
+#define __VENDOR_CMD_NXP_H__
+
+#define NXP_OUI		0x006037
+
+/**
+ * enum nxp_vendor_cmd - supported NXP vendor commands
+ *
+ * @NXP_VENDOR_CMD_TXPOWER_LIMIT: Access firmware Transmit Rate-based
+ *      Power Control (TRPC) configuration. The command uses the
+ *      attributes defined by &enum nxp_txpwrlimit_attrs.
+ *
+ *      SET operations provide TRPC table data through
+ *      %NXP_ATTR_TXPWRLIMIT_DATA. GET operations return the requested TRPC
+ *      table in %NXP_ATTR_TXPWRLIMIT_DATA.
+ *
+ *      The kernel does not interpret the TRPC table contents and only
+ *      passes the table data between userspace and firmware.
+ */
+enum nxp_vendor_cmd {
+	NXP_VENDOR_CMD_TXPOWER_LIMIT,
+};
+
+/**
+ * enum nxp_txpwrlimit_action - operation for %NXP_ATTR_TXPWRLIMIT_ACTION
+ *
+ * @NXP_TXPWRLIMIT_ACTION_GET: Retrieve the TRPC table for the selected
+ *	subband.
+ * @NXP_TXPWRLIMIT_ACTION_SET: Update the TRPC table for the selected
+ *	subband using data from %NXP_ATTR_TXPWRLIMIT_DATA.
+ */
+enum nxp_txpwrlimit_action {
+	NXP_TXPWRLIMIT_ACTION_GET,
+	NXP_TXPWRLIMIT_ACTION_SET,
+};
+
+/**
+ * enum nxp_txpwrlimit_subband - firmware TRPC subband selectors
+ *
+ * The selector values are defined by the firmware Transmit Rate-based
+ * Power Control (TRPC) interface.
+ *
+ * @NXP_TXPWRLIMIT_SUBBAND_2G: 2.4 GHz band.
+ * @NXP_TXPWRLIMIT_SUBBAND_5G_0: 5 GHz subband 0.
+ * @NXP_TXPWRLIMIT_SUBBAND_5G_1: 5 GHz subband 1.
+ * @NXP_TXPWRLIMIT_SUBBAND_5G_2: 5 GHz subband 2.
+ * @NXP_TXPWRLIMIT_SUBBAND_5G_3: 5 GHz subband 3.
+ */
+enum nxp_txpwrlimit_subband {
+	NXP_TXPWRLIMIT_SUBBAND_2G	= 0x00,
+	NXP_TXPWRLIMIT_SUBBAND_5G_0	= 0x10,
+	NXP_TXPWRLIMIT_SUBBAND_5G_1	= 0x11,
+	NXP_TXPWRLIMIT_SUBBAND_5G_2	= 0x12,
+	NXP_TXPWRLIMIT_SUBBAND_5G_3	= 0x13,
+};
+
+/**
+ * enum nxp_txpwrlimit_attrs - TX power limit vendor attributes
+ * @NXP_ATTR_TXPWRLIMIT_UNSPEC: Unspecified attribute.
+ * @NXP_ATTR_TXPWRLIMIT_ACTION: Operation from &enum nxp_txpwrlimit_action.
+ * @NXP_ATTR_TXPWRLIMIT_SUBBAND: Target subband.
+ * @NXP_ATTR_TXPWRLIMIT_DATA: Firmware-defined TRPC table data.
+ */
+enum nxp_txpwrlimit_attrs {
+	NXP_ATTR_TXPWRLIMIT_UNSPEC,
+	NXP_ATTR_TXPWRLIMIT_ACTION,
+	NXP_ATTR_TXPWRLIMIT_SUBBAND,
+	NXP_ATTR_TXPWRLIMIT_DATA,
+
+	__NXP_ATTR_TXPWRLIMIT_AFTER_LAST,
+	NXP_ATTR_TXPWRLIMIT_MAX = __NXP_ATTR_TXPWRLIMIT_AFTER_LAST - 1
+};
+
+#endif /* __VENDOR_CMD_NXP_H__ */
-- 
2.34.1


  reply	other threads:[~2026-10-05  5:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05  5:44 [PATCH nxpwifi-next v3 0/3] wifi: nxpwifi: add TX power limit configuration support jeff.chen_1
2026-10-05  5:44 ` jeff.chen_1 [this message]
2026-10-05  5:49   ` [PATCH nxpwifi-next v3 1/3] wifi: nl80211: vendor-cmd: add NXP vendor command definitions Johannes Berg
2026-10-05  8:31   ` jeff.chen_1
2026-10-05  5:44 ` [PATCH nxpwifi-next v3 2/3] wifi: nxpwifi: add firmware TRPC command support jeff.chen_1
2026-10-05  5:44 ` [PATCH nxpwifi-next v3 3/3] wifi: nxpwifi: add netlink vendor command for TX power limits jeff.chen_1

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261005054414.2874415-2-jeff.chen_1@oss.nxp.com \
    --to=jeff.chen_1@oss.nxp.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=benjamin.berg@intel.com \
    --cc=francesco@dolcini.it \
    --cc=jeff.chen_1@nxp.com \
    --cc=johannes@sipsolutions.net \
    --cc=kees+treewide@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox