diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2010-08-26 14:18:43 (GMT) |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-10-25 17:20:39 (GMT) |
commit | 33c87f0af60146b375220809c1cb745ac1a86edf (patch) | |
tree | f22e0a1f8fbe6b05f2f15c517d3b8e9b77581662 /include/linux/mlx4 | |
parent | 2420b60b1dc4ed98cb1788e928bc57ff2efa1a8d (diff) | |
download | linux-fsl-qoriq-33c87f0af60146b375220809c1cb745ac1a86edf.tar.xz |
mlx4_core: Allow protocol drivers to find corresponding interfaces
Add a mechanism for mlx4 protocol drivers to get a pointer to other
drivers's device objects. For this, an exported function,
mlx4_get_protocol_dev() is added, which allows a driver to get some
other driver's device based on the protocol that the driver
implements. Two protocols are added: MLX4_PROTOCOL_IB and
MLX4_PROTOCOL_EN.
This will be used in mlx4 IBoE support so that mlx4_ib can find the
corresponding mlx4_en netdev.
Signed-off-by: Eli Cohen <eli@mellanox.co.il>
[ Clean up and rename a few things. - Roland ]
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include/linux/mlx4')
-rw-r--r-- | include/linux/mlx4/driver.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index 53c5fdb..f407cd4 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h @@ -44,15 +44,24 @@ enum mlx4_dev_event { MLX4_DEV_EVENT_PORT_REINIT, }; +enum mlx4_protocol { + MLX4_PROTOCOL_IB, + MLX4_PROTOCOL_EN, +}; + struct mlx4_interface { void * (*add) (struct mlx4_dev *dev); void (*remove)(struct mlx4_dev *dev, void *context); void (*event) (struct mlx4_dev *dev, void *context, enum mlx4_dev_event event, int port); + void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port); struct list_head list; + enum mlx4_protocol protocol; }; int mlx4_register_interface(struct mlx4_interface *intf); void mlx4_unregister_interface(struct mlx4_interface *intf); +void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port); + #endif /* MLX4_DRIVER_H */ |