From nobody Sun Feb 8 20:00:07 2026 Received: from mail-ua1-f100.google.com (mail-ua1-f100.google.com [209.85.222.100]) (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 529F3126C02 for ; Mon, 26 Jan 2026 05:44:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.100 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769406284; cv=none; b=AipLyC9Qu2m/vXxInwZ7lIZOpOxaByWrBvORiSG80+TGMZrdjDkXji+vgTWAatIGZ+I1KJ0anOV9MIqfwqxI3/jum2z0y0k6GzkkPRo0mjnsYSZ4FfctwuAQ9IhHiDmYe/fy11GBM6BxFviJhA9a8lYc8nc3H61fyb3O9HFRdRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769406284; c=relaxed/simple; bh=p0+9v6bOKj6/t1LScVQUgu9L7VXJ0bMnHc+ppDkUBOc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QWutYt9Go9gi4T8xhuM2qKV0gKFDvqhtQxAgZsc9lLyxYcgLYRA/Q7mt5xHMDXxdSnhXWTZtSF7+lzoeb7qd629XM2A9XX+ZCkKaNNNq0RMcY4DC3AGxEorEzg9xQ/2s5Kc74zB5QxdKnPwjSlEAcuDH46RAncRRFyqGrFANaD4= 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=Z/VM6HtZ; arc=none smtp.client-ip=209.85.222.100 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="Z/VM6HtZ" Received: by mail-ua1-f100.google.com with SMTP id a1e0cc1a2514c-941275fece4so887841241.1 for ; Sun, 25 Jan 2026 21:44:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769406282; x=1770011082; 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=iPTs9JEbPLXI2vY0VGYEuKpjfV9mALLQxuqZFWZSApOOVsDTthMdUdKHtPKM/3JhD4 eNM1CzJsI5XrajgANor0/WDyz4fq4orODuvc3mGY23EhH6mn2NOuHsoGmqRgHjoZEWPg iUYhwTdB6Ud5Cd3A7gQGGUtnyu4fwb2Kh1XHchGUPOEuLi7qvdMcq+hfCHTvOshR4U0y g26ava+10CEWaLaiV2yWTfVLlFkDJX3OcZplzPtZpD2fSJ8BgIPFG8/WZoeoXki43x7S ca491ebaa1KkZpRsA6lnshNQFNyk80Z2r9157ZHXfmp4VJHdKdO273YNc5DhvhaOv7kL Ebxw== X-Gm-Message-State: AOJu0Yw1u77nX47hvHF8Y1cbe6qAi/CXZrZBnEbs/AqH2zD+eFe1jVL7 Z6ZkEEatPN9CDxaBFWH9iiSKw72Omikxk4Qb1sSZWc+kNmkbIyPqwhjB8tvRwOoYLe/JAHaTdcw jItOwkQWKwWitJpZ61m9m3yzf+sCyrO6OQ7i74fIbFADlm35/F1d1zkkgtmrKDj/bukKfHtzpeD NTAFCH77SdUGYiZU9+qAeaJ2xqQlSuqclqFiSKyNf1yXE0WJ/gxo9C42tjs8l/IfVGr+PWy7VwF es9dl3ptzO5TfwMxeI= X-Gm-Gg: AZuq6aL4U/XcHwLi54VfnQf2lJuppgvKxHRJcZmX3yVNUEiylQ7yDmDx83s4MYMTJOf 0CfOLjuwC8DDXXPVAoirAPDfmDkHNwII2/7LetKkpm7+w4KhAkRiYkrdngIYuxhVAmWeiu/Rc5k +5HA09NPpsXR8SCcjQf/WwCAzQu1QSJRUzVpFXFAmYiPiBMMzFCz25ymlFSPSPNhcq5UGsnjdFc 2Ar+2FQ6vthqp4MbVcU+QxjY3g4yoNwitWqEOVMk3SlodPqbRCBkgxwwrlJ4d7JfkeEgQeDiJCt FuruDtVwUS+YJz226CG3zri/NfifdTXipRmgEo+2mg7jTDB/D3JFuZpIvylVEJZKEcKRSuSpM5m 3+uJfthFDZvXxgdJ+X/y46NXW8qI45hQ/zV8pDjdGhRuVsnoXGNzJn5MhdLePPF3jYcmrq576mV Ogu21NV0HVs2s1LUP6Fy2KMNJ4ws70qquMNk7cLjPZUvOUFCk= X-Received: by 2002:a05:6122:240c:b0:563:5f68:7a75 with SMTP id 71dfb90a1353d-5665ca08509mr800878e0c.20.1769406282161; Sun, 25 Jan 2026 21:44:42 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-100.dlp.protect.broadcom.com. [144.49.247.100]) by smtp-relay.gmail.com with ESMTPS id 71dfb90a1353d-5663faf1a4dsm1285392e0c.3.2026.01.25.21.44.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Jan 2026 21:44:42 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-c54e81eeab9so2643741a12.3 for ; Sun, 25 Jan 2026 21:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1769406281; x=1770011081; 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=Z/VM6HtZvjh3QKa473ElxV+JFV8otTiqSqTKB/TgjRoJEL8s/3ITNb7/zeiDXuxyGD OKX7k1W/O2fTzWAMI2MXjsdfgiAfP79INZDIy4KwoE9P6PnqUZczechFO9rtuGZwbkym mLcSeK0TsrAEs4mf7Pzw6ruPsx5T3M7u/SAgg= X-Received: by 2002:a05:6a21:3988:b0:366:1921:c569 with SMTP id adf61e73a8af0-38e9f0f3f90mr2904413637.4.1769406280931; Sun, 25 Jan 2026 21:44:40 -0800 (PST) X-Received: by 2002:a05:6a21:3988:b0:366:1921:c569 with SMTP id adf61e73a8af0-38e9f0f3f90mr2904392637.4.1769406280373; Sun, 25 Jan 2026 21:44:40 -0800 (PST) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c635a3f2ddcsm7427213a12.17.2026.01.25.21.44.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jan 2026 21:44:39 -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 v2 fwctl 5/5] fwctl/bnxt_fwctl: Add documentation entries Date: Sun, 25 Jan 2026 21:37:10 -0800 Message-Id: <20260126053710.3474483-6-pavan.chebbi@broadcom.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20260126053710.3474483-1-pavan.chebbi@broadcom.com> References: <20260126053710.3474483-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