projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2332d8c
)
mlxsw: core: Introduce generic macro for event
author
Nogah Frankel
<
[email protected]
>
Fri, 25 Nov 2016 09:33:34 +0000
(10:33 +0100)
committer
David S. Miller
<
[email protected]
>
Sat, 26 Nov 2016 02:22:14 +0000
(21:22 -0500)
Create a macro for creating the generic listener struct for events,
similar to the one for rx traps.
Signed-off-by: Nogah Frankel <
[email protected]
>
Signed-off-by: Jiri Pirko <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/mellanox/mlxsw/core.h
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/mellanox/mlxsw/core.h
b/drivers/net/ethernet/mellanox/mlxsw/core.h
index 5f6fed12ba2770c28d3b48b1b5a744f793eff888..852218e44b23edb456c80a1922b90d335eeb4275 100644
(file)
--- 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);