mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

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>
33 lines
860 B
C
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;
|
|
}
|