From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua1-f99.google.com (mail-ua1-f99.google.com [209.85.222.99]) (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 82631392C2D for ; Thu, 26 Feb 2026 08:34:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772094849; cv=none; b=hAc46GK+HwUpW77CqTe1NmHrjVX3AspaNs592rCZXtjQDd00GsZt2qsVEFZ5bb/6OMawV5HyD0Vb1MjNj6HN8WsIBlpguMz/iEfu0eyfWmlJ2hpfk2waKoX3v1tqS7OU5HrxEwECO37jj7hjK4OQQ9Fc7m6sdJKRTwKp2lNKscA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772094849; c=relaxed/simple; bh=Es2E4P0fjbSgU/NkqBJYWq+WVGskaIWh6x+xoP5+IHc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Je1dy3igT/AEeSw589jtrXL1qiTNQHE3siMZcMaX9s97n6Kwou+5oRf+KwTS+Pht7d7/5a4RtqPv/IHTlFvoRLTB/HLm1n+eQHmusVdhg57uVZrBWdoWFH+FAWUx68kz1qKb/QxfaqPTtjuQkZertYLmmNmvS2U3H9BOHx7R2aY= 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=LRxw1prU; arc=none smtp.client-ip=209.85.222.99 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="LRxw1prU" Received: by mail-ua1-f99.google.com with SMTP id a1e0cc1a2514c-94dd06a96easo456661241.2 for ; Thu, 26 Feb 2026 00:34:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772094846; x=1772699646; 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=2FyOyN/U47kbIetX0AyHYHUcNDSNWQShComY15+Z9C4=; b=ubJi2AgE91d4MxDUuJzcsJTjWejDgzUwstNmgTa3t+1CND/pgo4v6uqOsqcmOFdfml 2J01b/mg6lc4TfI4ez6JX6VAH8bKOUaPL/RhSdK7hOMW5N67K8fXbKXKv2rvDmIuAQQt nsivC5vW1I4RUFUg4N+wg2HCVkatRgLroqgAM+2AsNWlx/9qnf5cToMvkO4e0hCafi11 wBNPQlzXy8zIUCPsbatzbRaOTZ02prKb+Cs8VY2DcOXmOavrka9j3GD2N/y00D0Lm+dw +KAtqrDn+3LNSJQ8R37LV2ZXVckmbKHbRqYFPahUZSsOtJCl/TsQZeBdQ8X6mgTDLVyK JfHw== X-Gm-Message-State: AOJu0Yzui0zDsOJkm8Ft88FQ7E5QN/Vp1RX6BFSA46sVVrg9gZo4daNF rG4JwKLLof6AgsxwS8bQ8NmR0jBy4VvcF4oFusRKgoG/DBGH4x1rT28xxuoQxR+d3Azpyhb+KX/ OaVMMV/UR6iPgprV9d6sULff7yLQnAkJKAoGHHYNx/iTxGPl4G4VE/0c5sY711lpMrsrEp2y6k0 Dv6nMoUbx1fQdnQyP5bhNbWc0GfqwCmU/DRalpv4ytFAaiXAeT1Fz+dBjVafPAMTrjvkDK1XDZT pCbsN0sNRNebnW9jRZckw== X-Gm-Gg: ATEYQzxO6BUVPDDuwnR82r/r/hDzzywea2q8aOAiO3hvtampX5sSH9fVLNCbKhptd1q nXtJAFY+3AOf18XmhM5gAzZoT8YvuBDbDykPy3sMnhPdyUHaAJUZL9ETGmlxZwEPFTL0+IWrdwM sesnHocA6CakfOOBPITvWniRoZnygJ9XagXUNXhiTGdxE1fqB3HqtZKD2i2R8SbgjJiPABHiBhd 2dM/ZJlQgF6VSNJDKJ5CDlSLbFHClZvgDZS1m0XHaIWNAeRe4ezwouQHMOhuambh6UL5evFjTxF PpW5SFfrdKy2y9jSWldMfmjNE8sHmyCX2aqJqRmBVBId/I1yAdpKU2JSp/lIMIVI7yhjAun9c2H L6LJFk9GPUYBVHVXGnPeH3TyfyYKOlSyX55O4y9gScQdzI+kfyUQOgh+FjmS0BCnQ1EtVTep7sF Xlg5tqc2uqt8B9gzp8iwovjngF8DlBqFYHv5RjZ+IiDrnhDIy+14HAEMsNp5g= X-Received: by 2002:a05:6102:304d:b0:5fd:efb0:8562 with SMTP id ada2fe7eead31-5ff20caf75cmr635521137.39.1772094846349; Thu, 26 Feb 2026 00:34:06 -0800 (PST) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-103.dlp.protect.broadcom.com. [144.49.247.103]) by smtp-relay.gmail.com with ESMTPS id ada2fe7eead31-5ff1e9f156fsm168235137.4.2026.02.26.00.34.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2026 00:34:06 -0800 (PST) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-c6e74e55d35so346696a12.3 for ; Thu, 26 Feb 2026 00:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1772094845; x=1772699645; 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=2FyOyN/U47kbIetX0AyHYHUcNDSNWQShComY15+Z9C4=; b=LRxw1prUeMy+izHmwOBgyEQJWRm/ErVXgpVRun/GoKV0xbjfvLa0JUiYR0tzrjd9sr zzZ4PIavYpBSRafZTXiPFde/yGjnCbtiushavnS+SuvLk44syWwShokG495pQoDaI9AW oPjtvQUIyBS9isYV6Ld1Fmj047jxuCB89E1pM= X-Received: by 2002:a05:6a00:f08:b0:821:8ea4:480e with SMTP id d2e1a72fcca58-8273bc93800mr1261113b3a.10.1772094844884; Thu, 26 Feb 2026 00:34:04 -0800 (PST) X-Received: by 2002:a05:6a00:f08:b0:821:8ea4:480e with SMTP id d2e1a72fcca58-8273bc93800mr1261088b3a.10.1772094843980; Thu, 26 Feb 2026 00:34:03 -0800 (PST) Received: from PC-MID-R740.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82739d4c9b5sm1661613b3a.9.2026.02.26.00.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 00:34:03 -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 v5 fwctl 4/5] fwctl/bnxt_fwctl: Add bnxt fwctl device Date: Thu, 26 Feb 2026 00:23:17 -0800 Message-Id: <20260226082318.525518-5-pavan.chebbi@broadcom.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20260226082318.525518-1-pavan.chebbi@broadcom.com> References: <20260226082318.525518-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: 8bit X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Create bnxt_fwctl device. This will bind to bnxt's aux device. On the upper edge, it will register with the fwctl subsystem. It will make use of bnxt's ULP functions to send FW commands. Reviewed-by: Andy Gospodarek Reviewed-by: Dave Jiang Signed-off-by: Pavan Chebbi --- MAINTAINERS | 6 + drivers/fwctl/Kconfig | 11 ++ drivers/fwctl/Makefile | 1 + drivers/fwctl/bnxt/Makefile | 4 + drivers/fwctl/bnxt/main.c | 278 ++++++++++++++++++++++++++++++++++++ include/uapi/fwctl/bnxt.h | 44 ++++++ include/uapi/fwctl/fwctl.h | 1 + 7 files changed, 345 insertions(+) create mode 100644 drivers/fwctl/bnxt/Makefile create mode 100644 drivers/fwctl/bnxt/main.c create mode 100644 include/uapi/fwctl/bnxt.h diff --git a/MAINTAINERS b/MAINTAINERS index 12f49de7fe03..15cc43ccb919 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10395,6 +10395,12 @@ F: drivers/fwctl/ F: include/linux/fwctl.h F: include/uapi/fwctl/ +FWCTL BNXT DRIVER +M: Pavan Chebbi +L: linux-kernel@vger.kernel.org +S: Maintained +F: drivers/fwctl/bnxt/ + FWCTL MLX5 DRIVER M: Saeed Mahameed R: Itay Avraham diff --git a/drivers/fwctl/Kconfig b/drivers/fwctl/Kconfig index b5583b12a011..d1b1925bdaec 100644 --- a/drivers/fwctl/Kconfig +++ b/drivers/fwctl/Kconfig @@ -9,6 +9,17 @@ menuconfig FWCTL fit neatly into an existing subsystem. if FWCTL +config FWCTL_BNXT + tristate "bnxt control fwctl driver" + depends on BNXT + help + BNXT provides interface for the user process to access the debug and + configuration registers of the Broadcom NIC hardware family. + This will allow configuration and debug tools to work out of the box on + mainstream kernel. + + If you don't know what to do here, say N. + config FWCTL_MLX5 tristate "mlx5 ConnectX control fwctl driver" depends on MLX5_CORE diff --git a/drivers/fwctl/Makefile b/drivers/fwctl/Makefile index c093b5f661d6..692e4b8d7beb 100644 --- a/drivers/fwctl/Makefile +++ b/drivers/fwctl/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_FWCTL) += fwctl.o +obj-$(CONFIG_FWCTL_BNXT) += bnxt/ obj-$(CONFIG_FWCTL_MLX5) += mlx5/ obj-$(CONFIG_FWCTL_PDS) += pds/ diff --git a/drivers/fwctl/bnxt/Makefile b/drivers/fwctl/bnxt/Makefile new file mode 100644 index 000000000000..b47172761f1e --- /dev/null +++ b/drivers/fwctl/bnxt/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_FWCTL_BNXT) += bnxt_fwctl.o + +bnxt_fwctl-y += main.o diff --git a/drivers/fwctl/bnxt/main.c b/drivers/fwctl/bnxt/main.c new file mode 100644 index 000000000000..4d7449b9d686 --- /dev/null +++ b/drivers/fwctl/bnxt/main.c @@ -0,0 +1,278 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2026, Broadcom Corporation + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +struct bnxtctl_uctx { + struct fwctl_uctx uctx; + u32 uctx_caps; +}; + +struct bnxtctl_dev { + struct fwctl_device fwctl; + struct bnxt_aux_priv *aux_priv; +}; + +DEFINE_FREE(bnxtctl, struct bnxtctl_dev *, if (_T) fwctl_put(&_T->fwctl)) + +static int bnxtctl_open_uctx(struct fwctl_uctx *uctx) +{ + struct bnxtctl_uctx *bnxtctl_uctx = + container_of(uctx, struct bnxtctl_uctx, uctx); + + bnxtctl_uctx->uctx_caps = BIT(FWCTL_BNXT_INLINE_COMMANDS) | + BIT(FWCTL_BNXT_QUERY_COMMANDS) | + BIT(FWCTL_BNXT_SEND_COMMANDS); + return 0; +} + +static void bnxtctl_close_uctx(struct fwctl_uctx *uctx) +{ +} + +static void *bnxtctl_info(struct fwctl_uctx *uctx, size_t *length) +{ + struct bnxtctl_uctx *bnxtctl_uctx = + container_of(uctx, struct bnxtctl_uctx, uctx); + struct fwctl_info_bnxt *info; + + info = kzalloc(sizeof(*info), GFP_KERNEL); + if (!info) + return ERR_PTR(-ENOMEM); + + info->uctx_caps = bnxtctl_uctx->uctx_caps; + + *length = sizeof(*info); + return info; +} + +static bool bnxtctl_validate_rpc(struct bnxt_en_dev *edev, + struct bnxt_fw_msg *hwrm_in, + enum fwctl_rpc_scope scope) +{ + struct input *req = (struct input *)hwrm_in->msg; + + guard(mutex)(&edev->en_dev_lock); + if (edev->flags & BNXT_EN_FLAG_ULP_STOPPED) + return false; + + switch (le16_to_cpu(req->req_type)) { + case HWRM_FUNC_RESET: + case HWRM_PORT_CLR_STATS: + case HWRM_FW_RESET: + case HWRM_FW_SYNC: + case HWRM_FW_SET_TIME: + case HWRM_DBG_LOG_BUFFER_FLUSH: + case HWRM_DBG_ERASE_NVM: + case HWRM_DBG_CFG: + case HWRM_NVM_DEFRAG: + case HWRM_NVM_FACTORY_DEFAULTS: + case HWRM_NVM_FLUSH: + case HWRM_NVM_VERIFY_UPDATE: + case HWRM_NVM_ERASE_DIR_ENTRY: + case HWRM_NVM_MOD_DIR_ENTRY: + case HWRM_NVM_FIND_DIR_ENTRY: + return scope >= FWCTL_RPC_CONFIGURATION; + + case HWRM_VER_GET: + case HWRM_ERROR_RECOVERY_QCFG: + case HWRM_FUNC_QCAPS: + case HWRM_FUNC_QCFG: + case HWRM_FUNC_QSTATS: + case HWRM_PORT_PHY_QCFG: + case HWRM_PORT_MAC_QCFG: + case HWRM_PORT_PHY_QCAPS: + case HWRM_PORT_PHY_I2C_READ: + case HWRM_PORT_PHY_MDIO_READ: + case HWRM_QUEUE_PRI2COS_QCFG: + case HWRM_QUEUE_COS2BW_QCFG: + case HWRM_VNIC_RSS_QCFG: + case HWRM_QUEUE_GLOBAL_QCFG: + case HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG: + case HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG: + case HWRM_QUEUE_QCAPS: + case HWRM_QUEUE_ADPTV_QOS_RX_TUNING_QCFG: + case HWRM_QUEUE_ADPTV_QOS_TX_TUNING_QCFG: + case HWRM_TUNNEL_DST_PORT_QUERY: + case HWRM_PORT_TX_FIR_QCFG: + case HWRM_FW_LIVEPATCH_QUERY: + case HWRM_FW_QSTATUS: + case HWRM_FW_HEALTH_CHECK: + case HWRM_FW_GET_TIME: + case HWRM_PORT_EP_TX_QCFG: + case HWRM_PORT_QCFG: + case HWRM_PORT_MAC_QCAPS: + case HWRM_TEMP_MONITOR_QUERY: + case HWRM_REG_POWER_QUERY: + case HWRM_CORE_FREQUENCY_QUERY: + case HWRM_CFA_REDIRECT_QUERY_TUNNEL_TYPE: + case HWRM_CFA_ADV_FLOW_MGNT_QCAPS: + case HWRM_FUNC_RESOURCE_QCAPS: + case HWRM_FUNC_BACKING_STORE_QCAPS: + case HWRM_FUNC_BACKING_STORE_QCFG: + case HWRM_FUNC_QSTATS_EXT: + case HWRM_FUNC_PTP_PIN_QCFG: + case HWRM_FUNC_PTP_EXT_QCFG: + case HWRM_FUNC_BACKING_STORE_QCFG_V2: + case HWRM_FUNC_BACKING_STORE_QCAPS_V2: + case HWRM_FUNC_SYNCE_QCFG: + case HWRM_FUNC_TTX_PACING_RATE_PROF_QUERY: + case HWRM_PORT_PHY_FDRSTAT: + case HWRM_DBG_RING_INFO_GET: + case HWRM_DBG_QCAPS: + case HWRM_DBG_QCFG: + case HWRM_DBG_USEQ_FLUSH: + case HWRM_DBG_USEQ_QCAPS: + case HWRM_DBG_SIM_CABLE_STATE: + case HWRM_DBG_TOKEN_QUERY_AUTH_IDS: + case HWRM_NVM_GET_DEV_INFO: + case HWRM_NVM_GET_DIR_INFO: + case HWRM_SELFTEST_QLIST: + return scope >= FWCTL_RPC_DEBUG_READ_ONLY; + + case HWRM_PORT_PHY_I2C_WRITE: + case HWRM_PORT_PHY_MDIO_WRITE: + return scope >= FWCTL_RPC_DEBUG_WRITE; + + default: + return false; + } +} + +static void *bnxtctl_fw_rpc(struct fwctl_uctx *uctx, + enum fwctl_rpc_scope scope, + void *in, size_t in_len, size_t *out_len) +{ + struct bnxtctl_dev *bnxtctl = + container_of(uctx->fwctl, struct bnxtctl_dev, fwctl); + struct bnxt_aux_priv *bnxt_aux_priv = bnxtctl->aux_priv; + size_t off = offsetof(struct fwctl_rpc_bnxt, reserved1); + struct fwctl_rpc_bnxt *msg = in; + struct bnxt_fw_msg rpc_in = {0}; + int rc, err = 0; + + if (in_len < sizeof(*msg)) + return ERR_PTR(-EINVAL); + + if (memchr_inv((unsigned char *)msg + off, 0, in_len - off)) + return ERR_PTR(-EINVAL); + + if (msg->req_len < sizeof(struct input) || + msg->req_len > HWRM_MAX_REQ_LEN) + return ERR_PTR(-EINVAL); + + rpc_in.msg = memdup_user(u64_to_user_ptr(msg->req), msg->req_len); + if (IS_ERR(rpc_in.msg)) + return rpc_in.msg; + + if (!bnxtctl_validate_rpc(bnxt_aux_priv->edev, &rpc_in, scope)) { + err = -EPERM; + goto free_msg_out; + } + + rpc_in.msg_len = msg->req_len; + rpc_in.resp = kzalloc(*out_len, GFP_KERNEL); + if (!rpc_in.resp) { + err = -ENOMEM; + goto free_msg_out; + } + + rpc_in.resp_max_len = *out_len; + if (!msg->timeout) + rpc_in.timeout = FWCTL_BNXT_HWRM_DFLT_TIMEOUT; + else + rpc_in.timeout = msg->timeout; + + rc = bnxt_send_msg(bnxt_aux_priv->edev, &rpc_in); + if (rc) { + struct output *resp = rpc_in.resp; + + /* Copy the response to user always, as it contains + * detailed status of the command failure + */ + if (!resp->error_code) + /* bnxt_send_msg() returned much before FW + * received the command. + */ + resp->error_code = rc; + } +free_msg_out: + kfree(rpc_in.msg); + + if (err) { + kfree(rpc_in.resp); + return ERR_PTR(err); + } + + return rpc_in.resp; +} + +static const struct fwctl_ops bnxtctl_ops = { + .device_type = FWCTL_DEVICE_TYPE_BNXT, + .uctx_size = sizeof(struct bnxtctl_uctx), + .open_uctx = bnxtctl_open_uctx, + .close_uctx = bnxtctl_close_uctx, + .info = bnxtctl_info, + .fw_rpc = bnxtctl_fw_rpc, +}; + +static int bnxtctl_probe(struct auxiliary_device *adev, + const struct auxiliary_device_id *id) +{ + struct bnxt_aux_priv *aux_priv = + container_of(adev, struct bnxt_aux_priv, aux_dev); + struct bnxtctl_dev *bnxtctl __free(bnxtctl) = + fwctl_alloc_device(&aux_priv->edev->pdev->dev, &bnxtctl_ops, + struct bnxtctl_dev, fwctl); + int rc; + + if (!bnxtctl) + return -ENOMEM; + + bnxtctl->aux_priv = aux_priv; + + rc = fwctl_register(&bnxtctl->fwctl); + if (rc) + return rc; + + auxiliary_set_drvdata(adev, no_free_ptr(bnxtctl)); + return 0; +} + +static void bnxtctl_remove(struct auxiliary_device *adev) +{ + struct bnxtctl_dev *ctldev = auxiliary_get_drvdata(adev); + + fwctl_unregister(&ctldev->fwctl); + fwctl_put(&ctldev->fwctl); +} + +static const struct auxiliary_device_id bnxtctl_id_table[] = { + { .name = "bnxt_en.fwctl", }, + {} +}; +MODULE_DEVICE_TABLE(auxiliary, bnxtctl_id_table); + +static struct auxiliary_driver bnxtctl_driver = { + .name = "bnxt_fwctl", + .probe = bnxtctl_probe, + .remove = bnxtctl_remove, + .id_table = bnxtctl_id_table, +}; + +module_auxiliary_driver(bnxtctl_driver); + +MODULE_IMPORT_NS("FWCTL"); +MODULE_DESCRIPTION("BNXT fwctl driver"); +MODULE_AUTHOR("Pavan Chebbi "); +MODULE_AUTHOR("Andy Gospodarek "); +MODULE_LICENSE("GPL"); diff --git a/include/uapi/fwctl/bnxt.h b/include/uapi/fwctl/bnxt.h new file mode 100644 index 000000000000..bfb27e8f6779 --- /dev/null +++ b/include/uapi/fwctl/bnxt.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * Copyright (c) 2026, Broadcom Inc + */ + +#ifndef _UAPI_FWCTL_BNXT_H_ +#define _UAPI_FWCTL_BNXT_H_ + +#include + +#define FWCTL_BNXT_HWRM_DFLT_TIMEOUT 500 /* ms */ + +enum fwctl_bnxt_commands { + FWCTL_BNXT_INLINE_COMMANDS = 0, + FWCTL_BNXT_QUERY_COMMANDS, + FWCTL_BNXT_SEND_COMMANDS, +}; + +/** + * struct fwctl_info_bnxt - ioctl(FWCTL_INFO) out_device_data + * @uctx_caps: The command capabilities driver accepts. + * + * Return basic information about the FW interface available. + */ +struct fwctl_info_bnxt { + __u32 uctx_caps; +}; + +/** + * struct fwctl_rpc_bnxt - describe the fwctl message for bnxt + * @req: FW (HWRM) command input structure + * @req_len: length of @req + * @timeout: in ms to override the driver's default, 0 otherwise + * @reserved: must be 0 + * @reserved1: must be 0 + */ +struct fwctl_rpc_bnxt { + __aligned_u64 req; + __u32 req_len; + __u32 timeout; + __u32 reserved[2]; + __aligned_u64 reserved1; +}; +#endif diff --git a/include/uapi/fwctl/fwctl.h b/include/uapi/fwctl/fwctl.h index 716ac0eee42d..2d6d4049c205 100644 --- a/include/uapi/fwctl/fwctl.h +++ b/include/uapi/fwctl/fwctl.h @@ -44,6 +44,7 @@ enum fwctl_device_type { FWCTL_DEVICE_TYPE_ERROR = 0, FWCTL_DEVICE_TYPE_MLX5 = 1, FWCTL_DEVICE_TYPE_CXL = 2, + FWCTL_DEVICE_TYPE_BNXT = 3, FWCTL_DEVICE_TYPE_PDS = 4, }; -- 2.39.1