diff options
author | Alexander Guller <alexg@mellanox.com> | 2011-10-09 05:29:42 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-09 23:42:58 -0400 |
commit | f0ec7177e239ed94a398a6c70b38530ff1393cb7 (patch) | |
tree | b648eb9833cfa7a6bf83437f36000d1269208501 /drivers/net/ethernet/mellanox/mlx4/en_port.c | |
parent | 4234144f5ca69a0a13d5adae6c94b6937c52541f (diff) |
mlx4_en: Adding 40gb speed report for ethtool
Query port will now identify a 40G Ethernet speed.
Signed-off-by: Alexander Guller <alexg@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_port.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_port.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_port.c b/drivers/net/ethernet/mellanox/mlx4/en_port.c index 8824309bb625..9d275558094a 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_port.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_port.c @@ -167,11 +167,21 @@ int mlx4_en_QUERY_PORT(struct mlx4_en_dev *mdev, u8 port) /* This command is always accessed from Ethtool context * already synchronized, no need in locking */ state->link_state = !!(qport_context->link_up & MLX4_EN_LINK_UP_MASK); - if ((qport_context->link_speed & MLX4_EN_SPEED_MASK) == - MLX4_EN_1G_SPEED) + switch (qport_context->link_speed & MLX4_EN_SPEED_MASK) { + case MLX4_EN_1G_SPEED: state->link_speed = 1000; - else + break; + case MLX4_EN_10G_SPEED_XAUI: + case MLX4_EN_10G_SPEED_XFI: state->link_speed = 10000; + break; + case MLX4_EN_40G_SPEED: + state->link_speed = 40000; + break; + default: + state->link_speed = -1; + break; + } state->transciver = qport_context->transceiver; out: |