[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1480066427-3961-7-git-send-email-jiri@resnulli.us>
Date:   Fri, 25 Nov 2016 10:33:34 +0100
From:   Jiri Pirko <jiri@...nulli.us>
To:     netdev@...r.kernel.org
Cc:     davem@...emloft.net, nogahf@...lanox.com, idosch@...lanox.com,
        eladr@...lanox.com, yotamg@...lanox.com, arkadis@...lanox.com,
        ogerlitz@...lanox.com
Subject: [patch net-next 06/19] mlxsw: core: Introduce generic macro for event
From: Nogah Frankel <nogahf@...lanox.com>
Create a macro for creating the generic listener struct for events,
similar to the one for rx traps.
Signed-off-by: Nogah Frankel <nogahf@...lanox.com>
Signed-off-by: Jiri Pirko <jiri@...lanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/core.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.h b/drivers/net/ethernet/mellanox/mlxsw/core.h
index 5f6fed1..852218e 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);
-- 
2.7.4
Powered by blists - more mailing lists
 
