Skip to content

Commit c30a3f5

Browse files
Erni Sri Satya VennelaPaolo Abeni
authored andcommitted
net: mana: Add get_link and get_link_ksettings in ethtool
Add support for the ethtool get_link and get_link_ksettings operations. Display standard port information using ethtool. Before the change: $ethtool enP30832s1 > No data available After the change: $ethtool enP30832s1 > Settings for enP30832s1: Supported ports: [ ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: Unknown! Duplex: Full Auto-negotiation: off Port: Other PHYAD: 0 Transceiver: internal Link detected: yes Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/1727674934-12130-1-git-send-email-ernis@linux.microsoft.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent e26a0c5 commit c30a3f5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/net/ethernet/microsoft/mana/mana_ethtool.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,15 @@ static int mana_set_ringparam(struct net_device *ndev,
443443
return err;
444444
}
445445

446+
static int mana_get_link_ksettings(struct net_device *ndev,
447+
struct ethtool_link_ksettings *cmd)
448+
{
449+
cmd->base.duplex = DUPLEX_FULL;
450+
cmd->base.port = PORT_OTHER;
451+
452+
return 0;
453+
}
454+
446455
const struct ethtool_ops mana_ethtool_ops = {
447456
.get_ethtool_stats = mana_get_ethtool_stats,
448457
.get_sset_count = mana_get_sset_count,
@@ -456,4 +465,6 @@ const struct ethtool_ops mana_ethtool_ops = {
456465
.set_channels = mana_set_channels,
457466
.get_ringparam = mana_get_ringparam,
458467
.set_ringparam = mana_set_ringparam,
468+
.get_link_ksettings = mana_get_link_ksettings,
469+
.get_link = ethtool_op_get_link,
459470
};

0 commit comments

Comments
 (0)