Commit dcbe14b9 authored by Kleber Sacilotto de Souza's avatar Kleber Sacilotto de Souza Committed by David S. Miller

ehea: fix wrongly reported speed and port

Currently EHEA reports to ethtool as supporting 10M, 100M, 1G and
10G and connected to FIBRE independent of the hardware configuration.
However, when connected to FIBRE the only supported speed is 10G
full-duplex, and the other speeds and modes are only supported
when connected to twisted pair.
Signed-off-by: default avatarKleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: default avatarBreno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b9f47a3a
...@@ -55,15 +55,20 @@ static int ehea_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -55,15 +55,20 @@ static int ehea_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
cmd->duplex = -1; cmd->duplex = -1;
} }
cmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_1000baseT_Full if (cmd->speed == SPEED_10000) {
| SUPPORTED_100baseT_Full | SUPPORTED_100baseT_Half cmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
| SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Half cmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_FIBRE);
| SUPPORTED_Autoneg | SUPPORTED_FIBRE);
cmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_Autoneg
| ADVERTISED_FIBRE);
cmd->port = PORT_FIBRE; cmd->port = PORT_FIBRE;
} else {
cmd->supported = (SUPPORTED_1000baseT_Full | SUPPORTED_100baseT_Full
| SUPPORTED_100baseT_Half | SUPPORTED_10baseT_Full
| SUPPORTED_10baseT_Half | SUPPORTED_Autoneg
| SUPPORTED_TP);
cmd->advertising = (ADVERTISED_1000baseT_Full | ADVERTISED_Autoneg
| ADVERTISED_TP);
cmd->port = PORT_TP;
}
cmd->autoneg = port->autoneg == 1 ? AUTONEG_ENABLE : AUTONEG_DISABLE; cmd->autoneg = port->autoneg == 1 ? AUTONEG_ENABLE : AUTONEG_DISABLE;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment