Skip to content

Commit

Permalink
drivers: net: xgene: Add 10GbE ethtool support
Browse files Browse the repository at this point in the history
Signed-off-by: Iyappan Subramanian <[email protected]>
Signed-off-by: Keyur Chudgar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
isubrama authored and davem330 committed Oct 10, 2014
1 parent 0148d38 commit 41aace6
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,37 @@ 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)
{
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)
Expand Down

0 comments on commit 41aace6

Please sign in to comment.