1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
From f3300099b6638df5829e75b1fbfbb6e7ebc8b2b9 Mon Sep 17 00:00:00 2001
From: Johnathan Mantey <johnathanx.mantey@intel.com>
Date: Thu, 1 Aug 2019 11:29:41 -0700
Subject: [PATCH] Report link statistics for the NCSI channel
The ftgmac driver does not report the link statistics for the NCSI
channel used for the shared NICs attached to the BMC. Report a fixed
value for the NSCI interface.
Change-Id: Idb65ca1ce07f06a883417ee44df30ea2c8483107
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
---
drivers/net/ethernet/faraday/ftgmac100.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 9b7af94a40bb..4cd679233795 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1216,10 +1216,30 @@ static int ftgmac100_set_pauseparam(struct net_device *netdev,
return 0;
}
+int ftgmac100_ethtool_get_link_ksettings(struct net_device *netdev,
+ struct ethtool_link_ksettings *cmd)
+{
+ struct phy_device *phydev = netdev->phydev;
+ struct ftgmac100 *priv = netdev_priv(netdev);
+ int retval = 0;
+
+ if (phydev) {
+ phy_ethtool_ksettings_get(phydev, cmd);
+ } else if (priv->use_ncsi) {
+ cmd->base.speed = SPEED_100;
+ cmd->base.duplex = DUPLEX_FULL;
+ cmd->base.autoneg = 0;
+ } else {
+ retval = -ENODEV;
+ }
+
+ return retval;
+}
+
static const struct ethtool_ops ftgmac100_ethtool_ops = {
.get_drvinfo = ftgmac100_get_drvinfo,
.get_link = ethtool_op_get_link,
- .get_link_ksettings = phy_ethtool_get_link_ksettings,
+ .get_link_ksettings = ftgmac100_ethtool_get_link_ksettings,
.set_link_ksettings = phy_ethtool_set_link_ksettings,
.nway_reset = phy_ethtool_nway_reset,
.get_ringparam = ftgmac100_get_ringparam,
--
2.7.4
|