mlxsw: spectrum: Prevent force of 56G
authorAmit Cohen <amitc@mellanox.com>
Wed, 29 May 2019 07:59:45 +0000 (10:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jun 2019 06:17:24 +0000 (08:17 +0200)
commit7219a58c57de1b5046154c2267ac70f9fcdee6f8
tree7d48313cf9d22dc2db72009d06ef6e65d14b7c19
parent1d28cf14a89c400fa55f6f9a9a4ca3bc34094b34
mlxsw: spectrum: Prevent force of 56G

[ Upstream commit 275e928f19117d22f6d26dee94548baf4041b773 ]

Force of 56G is not supported by hardware in Ethernet devices. This
configuration fails with a bad parameter error from firmware.

Add check of this case. Instead of trying to set 56G with autoneg off,
return a meaningful error.

Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
Signed-off-by: Amit Cohen <amitc@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c