mlxsw: Simplify traps creation
authorIdo Schimmel <idosch@mellanox.com>
Thu, 15 Oct 2015 15:43:27 +0000 (17:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Oct 2015 06:27:55 +0000 (23:27 -0700)
commitf24af330159aa1afbc6670e5786856a2a99d112c
tree8e62a8779a3b5e8868745b8c9f82071a7d076628
parentebb7963f9b14bbaa07b6074579225d6338318ecb
mlxsw: Simplify traps creation

The Host Trap Group Table (HTGT) register configures trap groups, which
are populated with trap IDs using the Host PacKet Trap (HPKT) register.
However, a trap ID can only be present inside one trap group (the last
configured).

Instead of passing both the trap group and ID for the function that
packs HPKT, pass only the trap ID and derive from it the trap group.

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/reg.h
drivers/net/ethernet/mellanox/mlxsw/switchx2.c