aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/mlx4.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-28 11:26:12 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-28 11:26:12 -0400
commit7a9787e1eba95a166265e6a260cf30af04ef0a99 (patch)
treee730a4565e0318140d2fbd2f0415d18a339d7336 /drivers/net/mlx4/mlx4.h
parent41b9eb264c8407655db57b60b4457fe1b2ec9977 (diff)
parent0173a3265b228da319ceb9c1ec6a5682fd1b2d92 (diff)
Merge commit 'v2.6.28-rc2' into x86/pci-ioapic-boot-irq-quirks
Diffstat (limited to 'drivers/net/mlx4/mlx4.h')
-rw-r--r--drivers/net/mlx4/mlx4.h48
1 files changed, 46 insertions, 2 deletions
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index a4023c2dd050..fa431fad0eec 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -2,7 +2,7 @@
2 * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. 2 * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved.
3 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. 3 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
4 * Copyright (c) 2005, 2006, 2007 Cisco Systems. All rights reserved. 4 * Copyright (c) 2005, 2006, 2007 Cisco Systems. All rights reserved.
5 * Copyright (c) 2005 Mellanox Technologies. All rights reserved. 5 * Copyright (c) 2005, 2006, 2007, 2008 Mellanox Technologies. All rights reserved.
6 * Copyright (c) 2004 Voltaire, Inc. All rights reserved. 6 * Copyright (c) 2004 Voltaire, Inc. All rights reserved.
7 * 7 *
8 * This software is available to you under a choice of one of two 8 * This software is available to you under a choice of one of two
@@ -111,6 +111,7 @@ struct mlx4_bitmap {
111 u32 last; 111 u32 last;
112 u32 top; 112 u32 top;
113 u32 max; 113 u32 max;
114 u32 reserved_top;
114 u32 mask; 115 u32 mask;
115 spinlock_t lock; 116 spinlock_t lock;
116 unsigned long *table; 117 unsigned long *table;
@@ -118,6 +119,7 @@ struct mlx4_bitmap {
118 119
119struct mlx4_buddy { 120struct mlx4_buddy {
120 unsigned long **bits; 121 unsigned long **bits;
122 unsigned int *num_free;
121 int max_order; 123 int max_order;
122 spinlock_t lock; 124 spinlock_t lock;
123}; 125};
@@ -250,6 +252,38 @@ struct mlx4_catas_err {
250 struct list_head list; 252 struct list_head list;
251}; 253};
252 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 char dev_name[16];
281 struct device_attribute port_attr;
282 enum mlx4_port_type tmp_type;
283 struct mlx4_mac_table mac_table;
284 struct mlx4_vlan_table vlan_table;
285};
286
253struct mlx4_priv { 287struct mlx4_priv {
254 struct mlx4_dev dev; 288 struct mlx4_dev dev;
255 289
@@ -278,6 +312,8 @@ struct mlx4_priv {
278 312
279 struct mlx4_uar driver_uar; 313 struct mlx4_uar driver_uar;
280 void __iomem *kar; 314 void __iomem *kar;
315 struct mlx4_port_info port[MLX4_MAX_PORTS + 1];
316 struct mutex port_mutex;
281}; 317};
282 318
283static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev) 319static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev)
@@ -287,7 +323,10 @@ static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev)
287 323
288u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap); 324u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap);
289void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj); 325void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj);
290int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask, u32 reserved); 326u32 mlx4_bitmap_alloc_range(struct mlx4_bitmap *bitmap, int cnt, int align);
327void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt);
328int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask,
329 u32 reserved_bot, u32 resetrved_top);
291void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap); 330void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap);
292 331
293int mlx4_reset(struct mlx4_dev *dev); 332int mlx4_reset(struct mlx4_dev *dev);
@@ -345,4 +384,9 @@ void mlx4_srq_event(struct mlx4_dev *dev, u32 srqn, int event_type);
345 384
346void mlx4_handle_catas_err(struct mlx4_dev *dev); 385void mlx4_handle_catas_err(struct mlx4_dev *dev);
347 386
387void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table);
388void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table);
389
390int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port);
391
348#endif /* MLX4_H */ 392#endif /* MLX4_H */