aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNogah Frankel <nogahf@mellanox.com>2016-11-25 10:33:34 +0100
committerDavid S. Miller <davem@davemloft.net>2016-11-25 21:22:14 -0500
commitfb9012d93f3d8abc316ec06105a7e781c37e2696 (patch)
treeff892a73af336c23702beba516174501d06889cc /drivers
parentmlxsw: switchx2: Use generic listener struct for rx traps (diff)
downloadlinux-dev-fb9012d93f3d8abc316ec06105a7e781c37e2696.tar.xz
linux-dev-fb9012d93f3d8abc316ec06105a7e781c37e2696.zip
mlxsw: core: Introduce generic macro for event
Create a macro for creating the generic listener struct for events, similar to the one for rx traps. 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/core.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h
index 5f6fed12ba27..852218e44b23 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.h
@@ -115,6 +115,18 @@ struct mlxsw_listener {
.is_event = false, \
}
+#define MLXSW_EVENTL(_func, _trap_id) \
+ { \
+ .trap_id = MLXSW_TRAP_ID_##_trap_id, \
+ .u.event_listener = \
+ { \
+ .func = _func, \
+ .trap_id = MLXSW_TRAP_ID_##_trap_id, \
+ }, \
+ .action = MLXSW_REG_HPKT_ACTION_TRAP_TO_CPU, \
+ .is_event = true, \
+ }
+
int mlxsw_core_rx_listener_register(struct mlxsw_core *mlxsw_core,
const struct mlxsw_rx_listener *rxl,
void *priv);