diff options
author | Ido Schimmel <idosch@mellanox.com> | 2017-03-24 08:02:48 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-24 13:53:28 -0700 |
commit | 5ec2ee7dd26452c2852b395b323b0260c27c2e25 (patch) | |
tree | 594a99c71a77dfb61796f9ec3ef12744756dd024 /drivers/net/ethernet/mellanox/mlxsw/port.h | |
parent | 8494ab06e06a8ef60db9ad678eb4bcd8def4c85b (diff) | |
download | linux-stable-5ec2ee7dd26452c2852b395b323b0260c27c2e25.tar.gz linux-stable-5ec2ee7dd26452c2852b395b323b0260c27c2e25.tar.bz2 linux-stable-5ec2ee7dd26452c2852b395b323b0260c27c2e25.zip |
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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/port.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/port.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/port.h b/drivers/net/ethernet/mellanox/mlxsw/port.h index 3d42146473b3..c580abba8d34 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/port.h +++ b/drivers/net/ethernet/mellanox/mlxsw/port.h @@ -49,20 +49,12 @@ #define MLXSW_PORT_MID 0xd000 -#define MLXSW_PORT_MAX_PHY_PORTS 0x40 -#define MLXSW_PORT_MAX_PORTS (MLXSW_PORT_MAX_PHY_PORTS + 1) - #define MLXSW_PORT_MAX_IB_PHY_PORTS 36 #define MLXSW_PORT_MAX_IB_PORTS (MLXSW_PORT_MAX_IB_PHY_PORTS + 1) -#define MLXSW_PORT_DEVID_BITS_OFFSET 10 -#define MLXSW_PORT_PHY_BITS_OFFSET 4 -#define MLXSW_PORT_PHY_BITS_MASK (MLXSW_PORT_MAX_PHY_PORTS - 1) - #define MLXSW_PORT_CPU_PORT 0x0 -#define MLXSW_PORT_ROUTER_PORT (MLXSW_PORT_MAX_PHY_PORTS + 2) -#define MLXSW_PORT_DONT_CARE (MLXSW_PORT_MAX_PORTS) +#define MLXSW_PORT_DONT_CARE 0xFF #define MLXSW_PORT_MODULE_MAX_WIDTH 4 |