提交 fb9012d9 编写于 作者: N Nogah Frankel 提交者: David S. Miller

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: NNogah Frankel <nogahf@mellanox.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2332d8c7
...@@ -115,6 +115,18 @@ struct mlxsw_listener { ...@@ -115,6 +115,18 @@ struct mlxsw_listener {
.is_event = false, \ .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, int mlxsw_core_rx_listener_register(struct mlxsw_core *mlxsw_core,
const struct mlxsw_rx_listener *rxl, const struct mlxsw_rx_listener *rxl,
void *priv); void *priv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册