mlxsw: Query maximum number of ports from firmware
authorIdo Schimmel <idosch@mellanox.com>
Fri, 24 Mar 2017 07:02:48 +0000 (08:02 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Mar 2017 20:53:28 +0000 (13:53 -0700)
commit5ec2ee7dd26452c2852b395b323b0260c27c2e25
tree594a99c71a77dfb61796f9ec3ef12744756dd024
parent8494ab06e06a8ef60db9ad678eb4bcd8def4c85b
mlxsw: Query maximum number of ports from firmware

We currently hard code the maximum number of ports in the driver, but
this may change in future devices, so query it from the firmware
instead.

Fallback to a maximum of 64 ports in case this number can't be queried.
This should only happen in SwitchX-2 for which this number is correct.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/port.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
drivers/net/ethernet/mellanox/mlxsw/switchx2.c