diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2024-06-28 22:41:16 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-07-01 11:00:39 +0100 |
commit | 7433d034ac3c2ea745ee345228122dbfbeca5b20 (patch) | |
tree | f964ee21da8e7df3a06762d3f93ded83ed193046 | |
parent | 1c5fc27bc48a7f33302536c42184e5208ee66783 (diff) |
net: tn40xx: add initial ethtool_ops support
Call phylink_ethtool_ksettings_get() for get_link_ksettings method and
ethtool_op_get_link() for get_link method.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/tehuti/tn40.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/tehuti/tn40.c b/drivers/net/ethernet/tehuti/tn40.c index 11db9fde11fe..565b72537efa 100644 --- a/drivers/net/ethernet/tehuti/tn40.c +++ b/drivers/net/ethernet/tehuti/tn40.c @@ -1571,6 +1571,19 @@ static const struct net_device_ops tn40_netdev_ops = { .ndo_vlan_rx_kill_vid = tn40_vlan_rx_kill_vid, }; +static int tn40_ethtool_get_link_ksettings(struct net_device *ndev, + struct ethtool_link_ksettings *cmd) +{ + struct tn40_priv *priv = netdev_priv(ndev); + + return phylink_ethtool_ksettings_get(priv->phylink, cmd); +} + +static const struct ethtool_ops tn40_ethtool_ops = { + .get_link = ethtool_op_get_link, + .get_link_ksettings = tn40_ethtool_get_link_ksettings, +}; + static int tn40_priv_init(struct tn40_priv *priv) { int ret; @@ -1599,6 +1612,7 @@ static struct net_device *tn40_netdev_alloc(struct pci_dev *pdev) if (!ndev) return NULL; ndev->netdev_ops = &tn40_netdev_ops; + ndev->ethtool_ops = &tn40_ethtool_ops; ndev->tx_queue_len = TN40_NDEV_TXQ_LEN; ndev->mem_start = pci_resource_start(pdev, 0); ndev->mem_end = pci_resource_end(pdev, 0); |