65 lines
2.2 KiB
Diff
65 lines
2.2 KiB
Diff
|
From 23a92cd33a89eaf4c76c0a848ec878035c08cc85 Mon Sep 17 00:00:00 2001
|
||
|
From: Iyappan Subramanian <isubramanian@apm.com>
|
||
|
Date: Thu, 9 Oct 2014 18:32:07 -0700
|
||
|
Subject: [PATCH 03/11] drivers: net: xgene: Add 10GbE ethtool support
|
||
|
Origin: https://git.kernel.org/linus/41aace6e088d198f2441f3d0e579657d6815234c
|
||
|
|
||
|
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
|
||
|
Signed-off-by: Keyur Chudgar <kchudgar@apm.com>
|
||
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||
|
---
|
||
|
.../net/ethernet/apm/xgene/xgene_enet_ethtool.c | 28 +++++++++++++++++-----
|
||
|
1 file changed, 22 insertions(+), 6 deletions(-)
|
||
|
|
||
|
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
|
||
|
index 63f2aa5..c1c997b 100644
|
||
|
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
|
||
|
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
|
||
|
@@ -59,10 +59,22 @@ static int xgene_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd)
|
||
|
struct xgene_enet_pdata *pdata = netdev_priv(ndev);
|
||
|
struct phy_device *phydev = pdata->phy_dev;
|
||
|
|
||
|
- if (phydev == NULL)
|
||
|
- return -ENODEV;
|
||
|
+ if (pdata->phy_mode == PHY_INTERFACE_MODE_RGMII) {
|
||
|
+ if (phydev == NULL)
|
||
|
+ return -ENODEV;
|
||
|
|
||
|
- return phy_ethtool_gset(phydev, cmd);
|
||
|
+ return phy_ethtool_gset(phydev, cmd);
|
||
|
+ }
|
||
|
+
|
||
|
+ cmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE;
|
||
|
+ cmd->advertising = cmd->supported;
|
||
|
+ ethtool_cmd_speed_set(cmd, SPEED_10000);
|
||
|
+ cmd->duplex = DUPLEX_FULL;
|
||
|
+ cmd->port = PORT_FIBRE;
|
||
|
+ cmd->transceiver = XCVR_EXTERNAL;
|
||
|
+ cmd->autoneg = AUTONEG_DISABLE;
|
||
|
+
|
||
|
+ return 0;
|
||
|
}
|
||
|
|
||
|
static int xgene_set_settings(struct net_device *ndev, struct ethtool_cmd *cmd)
|
||
|
@@ -70,10 +82,14 @@ static int xgene_set_settings(struct net_device *ndev, struct ethtool_cmd *cmd)
|
||
|
struct xgene_enet_pdata *pdata = netdev_priv(ndev);
|
||
|
struct phy_device *phydev = pdata->phy_dev;
|
||
|
|
||
|
- if (phydev == NULL)
|
||
|
- return -ENODEV;
|
||
|
+ if (pdata->phy_mode == PHY_INTERFACE_MODE_RGMII) {
|
||
|
+ if (phydev == NULL)
|
||
|
+ return -ENODEV;
|
||
|
+
|
||
|
+ return phy_ethtool_sset(phydev, cmd);
|
||
|
+ }
|
||
|
|
||
|
- return phy_ethtool_sset(phydev, cmd);
|
||
|
+ return -EINVAL;
|
||
|
}
|
||
|
|
||
|
static void xgene_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
|
||
|
--
|
||
|
2.1.0
|
||
|
|