linux/drivers/net/ethernet/broadcom/bnge/bnge_ethtool.c
Vikas Gupta 13a68c1ed7 bng_en: Add a network device
Add a network device with netdev features enabled.
Some features are enabled based on the capabilities
advertised by the firmware. Add the skeleton of minimal
netdev operations. Additionally, initialize the parameters
for rings (TX/RX/Completion).

Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Reviewed-by: Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Reviewed-by: Rajashekar Hudumula <rajashekar.hudumula@broadcom.com>
Link: https://patch.msgid.link/20250701143511.280702-11-vikas.gupta@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-07-07 18:54:01 -07:00

33 lines
860 B
C

// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2025 Broadcom.
#include <linux/unaligned.h>
#include <linux/pci.h>
#include <linux/types.h>
#include <net/devlink.h>
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
#include <linux/ethtool_netlink.h>
#include "bnge.h"
#include "bnge_ethtool.h"
static void bnge_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
struct bnge_net *bn = netdev_priv(dev);
struct bnge_dev *bd = bn->bd;
strscpy(info->driver, DRV_NAME, sizeof(info->driver));
strscpy(info->fw_version, bd->fw_ver_str, sizeof(info->fw_version));
strscpy(info->bus_info, pci_name(bd->pdev), sizeof(info->bus_info));
}
static const struct ethtool_ops bnge_ethtool_ops = {
.get_drvinfo = bnge_get_drvinfo,
};
void bnge_set_ethtool_ops(struct net_device *dev)
{
dev->ethtool_ops = &bnge_ethtool_ops;
}