diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 11:16:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 11:16:03 -0400 |
commit | 724bdd097e4d47b6ad963db5d92258ab5c485e05 (patch) | |
tree | f9d2de5f826780aa04532a89c3b67a01ae413f7d /drivers/net/mlx4/mlx4.h | |
parent | dc8dcad83b53e3aebc52889e81772c00a1490408 (diff) | |
parent | 56f2fdaade2a6b91ccd785de938b91172d5c94f2 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
IB/ehca: Reject dynamic memory add/remove when ehca adapter is present
IB/ehca: Fix reported max number of QPs and CQs in systems with >1 adapter
IPoIB: Set netdev offload features properly for child (VLAN) interfaces
IPoIB: Clean up ethtool support
mlx4_core: Add Ethernet PCI device IDs
mlx4_en: Add driver for Mellanox ConnectX 10GbE NIC
mlx4_core: Multiple port type support
mlx4_core: Ethernet MAC/VLAN management
mlx4_core: Get ethernet MTU and default address from firmware
mlx4_core: Support multiple pre-reserved QP regions
Update NetEffect maintainer emails to Intel emails
RDMA/cxgb3: Remove cmid reference on tid allocation failures
IB/mad: Use krealloc() to resize snoop table
IPoIB: Always initialize poll_timer to avoid crash on unload
IB/ehca: Don't allow creating UC QP with SRQ
mlx4_core: Add QP range reservation support
RDMA/ucma: Test ucma_alloc_multicast() return against NULL, not with IS_ERR()
Diffstat (limited to 'drivers/net/mlx4/mlx4.h')
-rw-r--r-- | drivers/net/mlx4/mlx4.h | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index 5337e3ac3e78..fa431fad0eec 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h | |||
@@ -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; |
@@ -251,6 +252,38 @@ struct mlx4_catas_err { | |||
251 | struct list_head list; | 252 | struct list_head list; |
252 | }; | 253 | }; |
253 | 254 | ||
255 | #define MLX4_MAX_MAC_NUM 128 | ||
256 | #define MLX4_MAC_TABLE_SIZE (MLX4_MAX_MAC_NUM << 3) | ||
257 | |||
258 | struct 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 | |||
269 | struct 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 | |||
277 | struct 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 | |||
254 | struct mlx4_priv { | 287 | struct mlx4_priv { |
255 | struct mlx4_dev dev; | 288 | struct mlx4_dev dev; |
256 | 289 | ||
@@ -279,6 +312,8 @@ struct mlx4_priv { | |||
279 | 312 | ||
280 | struct mlx4_uar driver_uar; | 313 | struct mlx4_uar driver_uar; |
281 | void __iomem *kar; | 314 | void __iomem *kar; |
315 | struct mlx4_port_info port[MLX4_MAX_PORTS + 1]; | ||
316 | struct mutex port_mutex; | ||
282 | }; | 317 | }; |
283 | 318 | ||
284 | static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev) | 319 | static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev) |
@@ -288,7 +323,10 @@ static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev) | |||
288 | 323 | ||
289 | u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap); | 324 | u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap); |
290 | void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj); | 325 | void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj); |
291 | int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask, u32 reserved); | 326 | u32 mlx4_bitmap_alloc_range(struct mlx4_bitmap *bitmap, int cnt, int align); |
327 | void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt); | ||
328 | int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask, | ||
329 | u32 reserved_bot, u32 resetrved_top); | ||
292 | void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap); | 330 | void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap); |
293 | 331 | ||
294 | int mlx4_reset(struct mlx4_dev *dev); | 332 | int mlx4_reset(struct mlx4_dev *dev); |
@@ -346,4 +384,9 @@ void mlx4_srq_event(struct mlx4_dev *dev, u32 srqn, int event_type); | |||
346 | 384 | ||
347 | void mlx4_handle_catas_err(struct mlx4_dev *dev); | 385 | void mlx4_handle_catas_err(struct mlx4_dev *dev); |
348 | 386 | ||
387 | void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table); | ||
388 | void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table); | ||
389 | |||
390 | int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port); | ||
391 | |||
349 | #endif /* MLX4_H */ | 392 | #endif /* MLX4_H */ |