[infiniband] Add last_opened_ibdev(), analogous to last_opened_netdev()

The minimal-surprise behaviour, when no explicit SRP initiator device
is specified, will probably be to use the most recently opened
Infiniband device.  This matches our behaviour with using the most
recently opened net device for PXE, iSCSI, AoE, NBI, etc.
This commit is contained in:
Michael Brown
2009-08-10 11:47:11 +01:00
parent 419243e7f1
commit 8de49af0d2
3 changed files with 27 additions and 1 deletions

View File

@@ -368,6 +368,8 @@ struct ib_device {
struct refcnt refcnt;
/** List of Infiniband devices */
struct list_head list;
/** List of open Infiniband devices */
struct list_head open_list;
/** Underlying device */
struct device *dev;
/** List of completion queues */
@@ -473,6 +475,7 @@ extern struct ib_device * alloc_ibdev ( size_t priv_size );
extern int register_ibdev ( struct ib_device *ibdev );
extern void unregister_ibdev ( struct ib_device *ibdev );
extern struct ib_device * find_ibdev ( struct ib_gid *gid );
extern struct ib_device * last_opened_ibdev ( void );
extern void ib_link_state_changed ( struct ib_device *ibdev );
extern void ib_poll_eq ( struct ib_device *ibdev );
extern struct list_head ib_devices;