diff --git a/drivers/net/ethernet/nvidia/nvethernet/Makefile b/drivers/net/ethernet/nvidia/nvethernet/Makefile index 15a204b0..44e9cc71 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/Makefile +++ b/drivers/net/ethernet/nvidia/nvethernet/Makefile @@ -18,6 +18,7 @@ obj-$(CONFIG_NVETHERNET) += nvethernet.o nvethernet-objs:= ether_linux.o \ osd.o \ + ethtool.o \ $(OSI)/osi_core.o \ $(OSI)/osi_common.o \ $(OSI)/osi_dma.o \ diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index 591ff2c4..10d2b224 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -2036,6 +2036,8 @@ static int ether_probe(struct platform_device *pdev) } ndev->netdev_ops = ðer_netdev_ops; + ether_set_ethtool_ops(ndev); + ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX; if (pdata->hw_feat.sa_vlan_ins) { ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX; diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h index 6fc826e6..7819f992 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h @@ -132,4 +132,5 @@ struct ether_priv_data { int rx_irqs[ETHER_MAX_IRQS]; }; +void ether_set_ethtool_ops(struct net_device *ndev); #endif /* ETHER_LINUX_H */ diff --git a/drivers/net/ethernet/nvidia/nvethernet/ethtool.c b/drivers/net/ethernet/nvidia/nvethernet/ethtool.c new file mode 100644 index 00000000..de4e35b0 --- /dev/null +++ b/drivers/net/ethernet/nvidia/nvethernet/ethtool.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "ether_linux.h" + +static const struct ethtool_ops ether_ethtool_ops = { + .get_link = ethtool_op_get_link, + .get_link_ksettings = phy_ethtool_get_link_ksettings, + .set_link_ksettings = phy_ethtool_set_link_ksettings, +}; + +/** + * ether_set_ethtool_ops - Set ethtool operations + * @ndev: network device instance + * + * Algorithm: Sets ethtool operations in network + * device structure. + * + * Dependencies: Network device needs to created. + * Protection: None. + * Return: None. + */ +void ether_set_ethtool_ops(struct net_device *ndev) +{ + ndev->ethtool_ops = ðer_ethtool_ops; +}