Add the basic ethtool ops get_drvinfo and get_link for ngbe and txgbe. Ngbe implements get_link_ksettings, nway_reset and set_link_ksettings for free using phylib code. The code related to the physical interface is not yet fully implemented in txgbe using phylink code. So do not implement get_link_ksettings, nway_reset and set_link_ksettings in txgbe. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230214091527.69943-1-mengyuanlou@net-swift.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
18 lines
552 B
C
18 lines
552 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright (c) 2015 - 2023 Beijing WangXun Technology Co., Ltd. */
|
|
|
|
#include <linux/pci.h>
|
|
#include <linux/phy.h>
|
|
|
|
#include "wx_type.h"
|
|
#include "wx_ethtool.h"
|
|
|
|
void wx_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *info)
|
|
{
|
|
struct wx *wx = netdev_priv(netdev);
|
|
|
|
strscpy(info->driver, wx->driver_name, sizeof(info->driver));
|
|
strscpy(info->fw_version, wx->eeprom_id, sizeof(info->fw_version));
|
|
strscpy(info->bus_info, pci_name(wx->pdev), sizeof(info->bus_info));
|
|
}
|
|
EXPORT_SYMBOL(wx_get_drvinfo);
|