drivers: net: xgene: Add SGMII based 1GbE ethtool support
authorIyappan Subramanian <isubramanian@apm.com>
Tue, 14 Oct 2014 00:05:35 +0000 (17:05 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Oct 2014 20:09:22 +0000 (16:09 -0400)
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>
drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c

index c1c997b923426229696ad473e846a7bfd5ff409f..416d6ebfc2ceb2395895fc69a4bfaed1cf610b68 100644 (file)
@@ -64,16 +64,25 @@ static int xgene_get_settings(struct net_device *ndev, struct ethtool_cmd *cmd)
                        return -ENODEV;
 
                return phy_ethtool_gset(phydev, cmd);
+       } else if (pdata->phy_mode == PHY_INTERFACE_MODE_SGMII) {
+               cmd->supported = SUPPORTED_1000baseT_Full |
+                                SUPPORTED_Autoneg | SUPPORTED_MII;
+               cmd->advertising = cmd->supported;
+               ethtool_cmd_speed_set(cmd, SPEED_1000);
+               cmd->duplex = DUPLEX_FULL;
+               cmd->port = PORT_MII;
+               cmd->transceiver = XCVR_INTERNAL;
+               cmd->autoneg = AUTONEG_ENABLE;
+       } else {
+               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_INTERNAL;
+               cmd->autoneg = AUTONEG_DISABLE;
        }
 
-       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;
 }