From nobody Sun Feb 8 19:40:10 2026 Received: from mail-yx1-f98.google.com (mail-yx1-f98.google.com [74.125.224.98]) (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 CDDE83542E3 for ; Fri, 30 Jan 2026 16:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.98 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769791769; cv=none; b=hJPoAB2WwDnRYBqz3Bw5tGAKg/sr/GB+r9kMMRv/lldejCZQQ2kvLchT4GyyAG/s5Gdg0nUW8S5hfPyBbXveBHsPqGlpItjyzp/8KpphJEeDoGR4vM6brRsSP8nxvkB2haW0kXz2AKMtbeHY1PtP+9Ddjlv1Q4SEsSKpHOovNTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769791769; c=relaxed/simple; bh=p0+9v6bOKj6/t1LScVQUgu9L7VXJ0bMnHc+ppDkUBOc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AD8axW9TMB/o5LBe1WVpSZNu/cY7Nop9+1zU9qJZa0rb73il+3blQO5SIrj0EBtoEIGthhreph+36xipdv6A4pQGQWJbiRro+F1XFfESy4FJg+MuzDsPp1pkUmvdgL5Ygz6P8kKaDCcdiX2mSObdkh2wASLz0ZPkBA4vU5B0mL4= 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=ESoc4kZh; arc=none smtp.client-ip=74.125.224.98 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="ESoc4kZh" Received: by mail-yx1-f98.google.com with SMTP id 956f58d0204a3-649605d3664so2603898d50.3 for ; Fri, 30 Jan 2026 08:49:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769791766; x=1770396566; 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=NnllrQTrHR7i0ECfNVnCO8WTL4imduxpWLBsZ3HnM5guPNBJXs+wn2Jx5iYfkqjJIK ezoWu0vw/3Mcyple3oJAbv9h9PALDyDFTm+ShLy3f3lNfnBeH1keIjB8p3cfOSRv9Wx8 LylvEy31SFRip5QtlYYCScXsqxfHpabwlEG1aFC5qTKMCl7CEUvteLZfHB7POyvblzrg FMAk2onbUrqLCZKHV0lgcEf+52HFkxww46cjQanroWyqqmQzKdgh+kwWiniVpCzAhxal qVmfnRQrgMMQvImA/h6hP2Wuatl2EotYjEmyKjVxOGnteT84PP3IzC+dySvQsB5Ehepy ey1Q== X-Gm-Message-State: AOJu0Yxzun/7lKYsuTk5ehTPRBCGtvBuYBOLqCJ2UnpvMy/qtj7Kj8dk 3kxSrO+13I82GWJ5uPUoxH/A05nmJErdRmdkVExIEYngou6vzLK9AIdOcthrRGT1EgoiG8f74At /TpmdMpx4rYSKTLgh9KXcP9SHaYD3xs0CJ0VDh78i7o4nSojjAnA24yb2BYdULn2EzU0qQpU4Lw 8D2Lc4QQvA7+eFvQIYVg2/I/Auos37YUS1hAXTH4G0d8159+pV25n1Q/I9rXqjEV+xqFhR/dS4T YbIbDMT2c+ZDgQDESs= X-Gm-Gg: AZuq6aJkGgL4ZD8y74AkEq83/3EHkbYJEwN8EnMLKeXWgDC2NvAR1ZEE/hiae4CSPFv Wly6brw1m7jOZ/cqRAg+qoTtyYcoa3xGrakwfhe3r2LXnWQrbrGopE9g2birtUr36KC3OwwHlFm QMXauflSdVX9baa6UZkP8Pm/VpG+OY0Psr8r2eD8vkLAKKFAaw2QH4/CAqTxRQqgCTgiMoEhbY/ lw66rdF9Q5EznoNkYSLLZnDlmzVfCUcXw/Uss603VRPcfVFjdZIHnmFevRKZj/8/rVddmzJ95KM dftUxjycq17hNtTDRr9RA+ZffWbJLXNdd4okrmflntXUESILUR1nczihZn8FZlDlkCstx3S9emu AQfSV17bfOnDcHefbTpEtoYDcMDOnJPd9bnNtwG6xvhuRzA0Ywu6RPnk+2f0IB21HZfN42F5tBn LSCzPikT/yUTj6DVepK7oj3hqpz99vaoEyIANJq3DgIusC X-Received: by 2002:a05:690e:4107:b0:649:6830:2f76 with SMTP id 956f58d0204a3-649a8436a83mr2608030d50.17.1769791766424; Fri, 30 Jan 2026 08:49:26 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-17.dlp.protect.broadcom.com. [144.49.247.17]) by smtp-relay.gmail.com with ESMTPS id 956f58d0204a3-649960731b8sm881378d50.1.2026.01.30.08.49.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Jan 2026 08:49:26 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-c6136af8e06so1564290a12.1 for ; Fri, 30 Jan 2026 08:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1769791765; x=1770396565; 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=ESoc4kZhH59+e4mBxZC8o1iG3r0ohrY1jpAU/FhZrO4bCjxmjWv8LM26WKta+mQOmn iqELdHY5eaSxtn7N54pqoRraBUnjNATp0FVJL7fNNJ+2Wrx+JeAgBqYxmI97P37/bYh2 +8xY2ZPtmaeViZjm19opIN7ojtMM0pyLl7b9g= X-Received: by 2002:a17:902:ef52:b0:297:df4e:fdd5 with SMTP id d9443c01a7336-2a8d7ed959dmr39351465ad.23.1769791765156; Fri, 30 Jan 2026 08:49:25 -0800 (PST) X-Received: by 2002:a17:902:ef52:b0:297:df4e:fdd5 with SMTP id d9443c01a7336-2a8d7ed959dmr39351345ad.23.1769791764756; Fri, 30 Jan 2026 08:49:24 -0800 (PST) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a88b5d9a7bsm80193085ad.79.2026.01.30.08.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 08:49:24 -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 v4 fwctl 5/5] fwctl/bnxt_fwctl: Add documentation entries Date: Fri, 30 Jan 2026 08:41:46 -0800 Message-Id: <20260130164146.3752166-6-pavan.chebbi@broadcom.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20260130164146.3752166-1-pavan.chebbi@broadcom.com> References: <20260130164146.3752166-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