Commit 5e6a024bebea5bad6b787cf2c0ee28116b4147f0

Authored by Iyappan Subramanian
Committed by David S. Miller
1 parent 32f784b50e

drivers: net: xgene: Add SGMII based 1GbE ethtool support

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>

Showing 1 changed file with 17 additions and 8 deletions Side-by-side Diff

drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
... ... @@ -64,15 +64,24 @@
64 64 return -ENODEV;
65 65  
66 66 return phy_ethtool_gset(phydev, cmd);
  67 + } else if (pdata->phy_mode == PHY_INTERFACE_MODE_SGMII) {
  68 + cmd->supported = SUPPORTED_1000baseT_Full |
  69 + SUPPORTED_Autoneg | SUPPORTED_MII;
  70 + cmd->advertising = cmd->supported;
  71 + ethtool_cmd_speed_set(cmd, SPEED_1000);
  72 + cmd->duplex = DUPLEX_FULL;
  73 + cmd->port = PORT_MII;
  74 + cmd->transceiver = XCVR_INTERNAL;
  75 + cmd->autoneg = AUTONEG_ENABLE;
  76 + } else {
  77 + cmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE;
  78 + cmd->advertising = cmd->supported;
  79 + ethtool_cmd_speed_set(cmd, SPEED_10000);
  80 + cmd->duplex = DUPLEX_FULL;
  81 + cmd->port = PORT_FIBRE;
  82 + cmd->transceiver = XCVR_INTERNAL;
  83 + cmd->autoneg = AUTONEG_DISABLE;
67 84 }
68   -
69   - cmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE;
70   - cmd->advertising = cmd->supported;
71   - ethtool_cmd_speed_set(cmd, SPEED_10000);
72   - cmd->duplex = DUPLEX_FULL;
73   - cmd->port = PORT_FIBRE;
74   - cmd->transceiver = XCVR_EXTERNAL;
75   - cmd->autoneg = AUTONEG_DISABLE;
76 85  
77 86 return 0;
78 87 }