From nobody Sun Feb 8 17:42:44 2026 Received: from mail-oi1-f227.google.com (mail-oi1-f227.google.com [209.85.167.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA06032B9A0 for ; Thu, 29 Jan 2026 16:02:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769702551; cv=none; b=q/Zs+FKF8kSgxLe/mD70GH1P9tRpLsS9ShcHXFvOoOGc748RVCVNhNh0Y3M+Gf3e0RWL4bedBuwK2qVf75o+i9qSxqVpZNu1SRD0spJXZyxryodmSjeB4n5AspeXlkKxJ7vErqMq9avkgfraNUccmF9RmpY8+jtXuc53z9w+cxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769702551; c=relaxed/simple; bh=p0+9v6bOKj6/t1LScVQUgu9L7VXJ0bMnHc+ppDkUBOc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eoxVoqwttf7mmzAbWMoCFj/PqLKbE59M8SvU1baZZTscApzld1rTAnFUdMmc70qgWwaqXX/nhH5yAJtZCsQv6ZyC3M1F/p4rORMMMccmiZwREpCm598tncQfLMN9BOQevCk7X5tJSs/BWOQ6rWjvtkHdc5bPP/Ixt/xRo46mYvQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=YOT828La; arc=none smtp.client-ip=209.85.167.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="YOT828La" Received: by mail-oi1-f227.google.com with SMTP id 5614622812f47-45f04f1348cso710557b6e.1 for ; Thu, 29 Jan 2026 08:02:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769702549; x=1770307349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ylrqotwPOThrY3/hhjb9VMXvSLNMw+ZG4RF4c6zLl9k=; b=hueFg0ShF6Y92tcfny6FANYTx3dpeZbM0fcbWi57viwnGy7JvQ0S2i2YXDd6RAfTGp DdrgbacUYbpty6WZoVPzOQ7XiSQ1XJKNMY4clcr8+t5zziFi2Q9i1Y9pzLXrJ9Jt4qCW JFx7iNVsOOd0e4Y8APhM5rhzAQ+Kk84KExZDzSOzPoSJOfKNUrQy3vivsPNs6dcj9CzS Jf5TGn0wK/oHBGk6Btb4KtrwX9qrnziRSO4SwlKOL5dNLblzMzd9uI8Z4TtPxHTz7rrf SEObTo+RUtBwul1/6g+7L9szxGiOFWQKI1APcgzGTH3y4Tt+ckfvft6Bb4nLDyVJHzA/ CeDg== X-Gm-Message-State: AOJu0YzBNj3FA3zl+5tSAaHFG5aaTXWvZfF0Ov83KpjKk9rZiJGIDKi7 caH6Amsvfc/G8QLudpSMjQ3u5R+YDw9hUlb5ZKcAOMIW6NHSmcO3Si2t1S/oETNHm/H2vEFr6AX 6+Dlpj+8rVxl+wMwyz3Y5oLVWjdQHYsn3zE2rBNjl5KcYo+htlIrCtgRt3AGm9GiaChC04eEzec wa4U5gXusJKah4UzjEuQYQg+PgYcAIWYME0ldjNKRA6E6zMQjs3oOUYSyXfO/5/ZG9X//5Lm2EA asAUy0Zu0Tzm7moYcM= X-Gm-Gg: AZuq6aI42f1QVzaSXNwJoK70o1WTaNocwFJ8aryLv8PPs0IiwKYErPV7RK5Q8MiL2c1 r4iJ9vGngB+Xjx66wPvwG2xnNernVp3PYKQHc8+56Rp01WSSt3k0S8uCtH6EAHFNAb0fCwZDQcf +e/9UPt8ki9lpI/zKDAzkFgl7KElKEoVxer9u17JfoG1q50heuE5kxJMV+/jv2lvqHKUyoM7QND fvzDbsLfI1gm1DPg9lX5zLu5VorzFfoOwVBx2G5xe/78uj8SAOmKDg5axv+7VevF9U5XtYAY239 e9EpfCZP0i9Hlk8TiKAIRpUo1cGnVJLPnXGVRmObbfRo8UMP5vw4QUaLpIauu1Q9sdb26TXmHcl qMlsy/6/dbCVxyE00C9bCNtcwtps9gkNbsz/hhnICD0uQtlxRDaiRegg5pPxIWcAhgNETSo6ftR IWsYb71OGAc/wsemuUO4fqz1H0T75iluAw3tF9l0B0l9XY X-Received: by 2002:a05:6808:2203:b0:45a:a7fd:cc9f with SMTP id 5614622812f47-45f34bd877fmr46970b6e.18.1769702548351; Thu, 29 Jan 2026 08:02:28 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-20.dlp.protect.broadcom.com. [144.49.247.20]) by smtp-relay.gmail.com with ESMTPS id 586e51a60fabf-40956d17201sm567500fac.0.2026.01.29.08.02.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jan 2026 08:02:28 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2a76b0673dcso10721075ad.0 for ; Thu, 29 Jan 2026 08:02:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1769702547; x=1770307347; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ylrqotwPOThrY3/hhjb9VMXvSLNMw+ZG4RF4c6zLl9k=; b=YOT828LalrP7R8hGkwft736OkLcFeWVyT29cBRrV8YFXjpzMIYuCH/A2RGHMPBhzCH amHdz4XKqb90WGU8RPTAH6jjo8VEEh51NhlInaoot5F4OrZnfqiOW9+C3oS2ggpZs//I QwQeFz2t86Q1WawIBH+/FqRU4pNC8BCGyVyak= X-Received: by 2002:a17:903:3b84:b0:297:df4e:fdd5 with SMTP id d9443c01a7336-2a870dd5039mr88229415ad.23.1769702546873; Thu, 29 Jan 2026 08:02:26 -0800 (PST) X-Received: by 2002:a17:903:3b84:b0:297:df4e:fdd5 with SMTP id d9443c01a7336-2a870dd5039mr88228665ad.23.1769702546080; Thu, 29 Jan 2026 08:02:26 -0800 (PST) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a88b4153efsm50354855ad.38.2026.01.29.08.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 08:02:25 -0800 (PST) From: Pavan Chebbi To: jgg@ziepe.ca, michael.chan@broadcom.com Cc: linux-kernel@vger.kernel.org, dave.jiang@intel.com, saeedm@nvidia.com, Jonathan.Cameron@huawei.com, gospo@broadcom.com, selvin.xavier@broadcom.com, leon@kernel.org, kalesh-anakkur.purayil@broadcom.com, Pavan Chebbi Subject: [PATCH v3 fwctl 5/5] fwctl/bnxt_fwctl: Add documentation entries Date: Thu, 29 Jan 2026 07:54:53 -0800 Message-Id: <20260129155453.3626544-6-pavan.chebbi@broadcom.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20260129155453.3626544-1-pavan.chebbi@broadcom.com> References: <20260129155453.3626544-1-pavan.chebbi@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Content-Type: text/plain; charset="utf-8" Add bnxt_fwctl to the driver and fwctl documentation pages. Reviewed-by: Andy Gospodarek Reviewed-by: Dave Jiang Signed-off-by: Pavan Chebbi --- .../userspace-api/fwctl/bnxt_fwctl.rst | 83 +++++++++++++++++++ Documentation/userspace-api/fwctl/fwctl.rst | 1 + Documentation/userspace-api/fwctl/index.rst | 1 + 3 files changed, 85 insertions(+) create mode 100644 Documentation/userspace-api/fwctl/bnxt_fwctl.rst diff --git a/Documentation/userspace-api/fwctl/bnxt_fwctl.rst b/Documentati= on/userspace-api/fwctl/bnxt_fwctl.rst new file mode 100644 index 000000000000..41a74a085324 --- /dev/null +++ b/Documentation/userspace-api/fwctl/bnxt_fwctl.rst @@ -0,0 +1,83 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +fwctl bnxt driver +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +:Author: Pavan Chebbi + +Overview +=3D=3D=3D=3D=3D=3D=3D=3D + +BNXT driver makes a fwctl service available through an auxiliary_device. +The bnxt_fwctl driver binds to this device and registers itself with the +fwctl subsystem. + +The bnxt_fwctl driver is agnostic to the device firmware internals. It +uses the Upper Layer Protocol (ULP) conduit provided by bnxt to send +HardWare Resource Manager (HWRM) commands to firmware. + +These commands can query or change firmware driven device configurations +and read/write registers that are useful for debugging. + +bnxt_fwctl User API +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Each RPC request contains a message request structure (HWRM input), +its length, optional request timeout, and dma buffers' information +if the command needs any DMA. The request is then put together with +the request data and sent through bnxt's message queue to the firmware, +and the results are returned to the caller. + +A typical user application can send a FWCTL_INFO command using ioctl() +to discover bnxt_fwctl's RPC capabilities as shown below: + + ioctl(fd, FWCTL_INFO, &fwctl_info_msg); + +where fwctl_info_msg (of type struct fwctl_info) describes bnxt_info_msg +(of type struct fwctl_info_bnxt). fwctl_info_msg is set up as follows: + + size =3D sizeof(struct fwctl_info); + flags =3D 0; + device_data_len =3D sizeof(bnxt_info_msg); + out_device_data =3D (__aligned_u64)&bnxt_info_msg; + +The uctx_caps of bnxt_info_msg represents the capabilities as described +in fwctl_bnxt_commands of include/uapi/fwctl/bnxt.h + +The FW RPC itself, FWCTL_RPC can be sent using ioctl() as: + + ioctl(fd, FWCTL_RPC, &fwctl_rpc_msg); + +where fwctl_rpc_msg (of type struct fwctl_rpc) encapsulates fwctl_rpc_bnxt +(see bnxt_rpc_msg below). fwctl_rpc_bnxt members are set up as per the +requirements of specific HWRM commands described in include/bnxt/hsi.h. +An example for HWRM_VER_GET is shown below: + + struct fwctl_rpc_bnxt bnxt_rpc_msg; + struct hwrm_ver_get_output resp; + struct fwctl_rpc fwctl_rpc_msg; + struct hwrm_ver_get_input req; + + req.req_type =3D HWRM_VER_GET; + req.hwrm_intf_maj =3D HWRM_VERSION_MAJOR; + req.hwrm_intf_min =3D HWRM_VERSION_MINOR; + req.hwrm_intf_upd =3D HWRM_VERSION_UPDATE; + req.cmpl_ring =3D -1; + req.target_id =3D -1; + + bnxt_rpc_msg.req_len =3D sizeof(struct hwrm_ver_get_input); + bnxt_rpc_msg.num_dma =3D 0; + bnxt_rpc_msg.req =3D (__aligned_u64)&req; + + fwctl_rpc_msg.size =3D sizeof(struct fwctl_rpc); + fwctl_rpc_msg.scope =3D FWCTL_RPC_DEBUG_READ_ONLY; + fwctl_rpc_msg.in_len =3D sizeof(bnxt_rpc_msg) + sizeof(req); + fwctl_rpc_msg.out_len =3D sizeof(struct hwrm_ver_get_output); + fwctl_rpc_msg.in =3D (__aligned_u64)&bnxt_rpc_msg; + fwctl_rpc_msg.out =3D (__aligned_u64)&resp; + +An example python3 program that can exercise this interface can be found in +the following git repository: + +https://github.com/Broadcom/fwctl-tools diff --git a/Documentation/userspace-api/fwctl/fwctl.rst b/Documentation/us= erspace-api/fwctl/fwctl.rst index a74eab8d14c6..826817bfd54d 100644 --- a/Documentation/userspace-api/fwctl/fwctl.rst +++ b/Documentation/userspace-api/fwctl/fwctl.rst @@ -148,6 +148,7 @@ area resulting in clashes will be resolved in favour of= a kernel implementation. fwctl User API =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 +.. kernel-doc:: include/uapi/fwctl/bnxt.h .. kernel-doc:: include/uapi/fwctl/fwctl.h .. kernel-doc:: include/uapi/fwctl/mlx5.h .. kernel-doc:: include/uapi/fwctl/pds.h diff --git a/Documentation/userspace-api/fwctl/index.rst b/Documentation/us= erspace-api/fwctl/index.rst index 316ac456ad3b..8062f7629654 100644 --- a/Documentation/userspace-api/fwctl/index.rst +++ b/Documentation/userspace-api/fwctl/index.rst @@ -10,5 +10,6 @@ to securely construct and execute RPCs inside device firm= ware. :maxdepth: 1 =20 fwctl + bnxt_fwctl fwctl-cxl pds_fwctl --=20 2.39.1