netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: tn40xx: add initial ethtool_ops support
@ 2024-06-28 13:41 FUJITA Tomonori
  2024-06-28 14:14 ` Andrew Lunn
  2024-07-01 10:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 6+ messages in thread
From: FUJITA Tomonori @ 2024-06-28 13:41 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, kuba, pabeni, andrew, linux

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>
---
 drivers/net/ethernet/tehuti/tn40.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

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);

base-commit: 94833addfaba89d12e5dbd82e350a692c00648ab
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-03 12:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-28 13:41 [PATCH net-next] net: tn40xx: add initial ethtool_ops support FUJITA Tomonori
2024-06-28 14:14 ` Andrew Lunn
2024-06-28 14:29   ` FUJITA Tomonori
2024-06-28 15:45   ` Russell King (Oracle)
2024-07-03 12:57     ` FUJITA Tomonori
2024-07-01 10:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).