aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/mlx4.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mlx4/mlx4.h')
-rw-r--r--drivers/net/mlx4/mlx4.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 9e2f44c31810..23309f381ee3 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -252,6 +252,35 @@ struct mlx4_catas_err {
252 struct list_head list; 252 struct list_head list;
253}; 253};
254 254
255#define MLX4_MAX_MAC_NUM 128
256#define MLX4_MAC_TABLE_SIZE (MLX4_MAX_MAC_NUM << 3)
257
258struct mlx4_mac_table {
259 __be64 entries[MLX4_MAX_MAC_NUM];
260 int refs[MLX4_MAX_MAC_NUM];
261 struct mutex mutex;
262 int total;
263 int max;
264};
265
266#define MLX4_MAX_VLAN_NUM 128
267#define MLX4_VLAN_TABLE_SIZE (MLX4_MAX_VLAN_NUM << 2)
268
269struct mlx4_vlan_table {
270 __be32 entries[MLX4_MAX_VLAN_NUM];
271 int refs[MLX4_MAX_VLAN_NUM];
272 struct mutex mutex;
273 int total;
274 int max;
275};
276
277struct mlx4_port_info {
278 struct mlx4_dev *dev;
279 int port;
280 struct mlx4_mac_table mac_table;
281 struct mlx4_vlan_table vlan_table;
282};
283
255struct mlx4_priv { 284struct mlx4_priv {
256 struct mlx4_dev dev; 285 struct mlx4_dev dev;
257 286
@@ -280,6 +309,7 @@ struct mlx4_priv {
280 309
281 struct mlx4_uar driver_uar; 310 struct mlx4_uar driver_uar;
282 void __iomem *kar; 311 void __iomem *kar;
312 struct mlx4_port_info port[MLX4_MAX_PORTS + 1];
283}; 313};
284 314
285static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev) 315static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev)
@@ -350,4 +380,7 @@ void mlx4_srq_event(struct mlx4_dev *dev, u32 srqn, int event_type);
350 380
351void mlx4_handle_catas_err(struct mlx4_dev *dev); 381void mlx4_handle_catas_err(struct mlx4_dev *dev);
352 382
383void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table);
384void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table);
385
353#endif /* MLX4_H */ 386#endif /* MLX4_H */