mlxsw: core: Create a generic function to register / unregister traps
authorNogah Frankel <nogahf@mellanox.com>
Fri, 25 Nov 2016 09:33:30 +0000 (10:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Nov 2016 02:22:14 +0000 (21:22 -0500)
commit0791051c43ef994149c6d8b3ee7dc8d7e81a16a6
treef9ef6011d77ff8f3676c9775ed20d3baba9a020b
parentee4a60d898826d34b804a357847c7910aba80b96
mlxsw: core: Create a generic function to register / unregister traps

We have 2 types of HW traps to handle, rx traps and events.
The registration workflow for both is very similar. So it only make
sense to create one function to handle both.

This patch creates a struct to hold the data for both cases. It also
creates a registration and an un-registration functions that get this
generic struct as input.

Signed-off-by: Nogah Frankel <nogahf@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