From 53a7dd26cd0aff8409e16c6cc1c7423d4a551f4b Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 2 Jan 2009 21:04:31 +0000 Subject: [infiniband] Call ib_open() only when opening the IPoIB net device Defer the call to ib_open() until we want to actually open the device, rather than when the device is registered. --- src/include/gpxe/infiniband.h | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'src/include') diff --git a/src/include/gpxe/infiniband.h b/src/include/gpxe/infiniband.h index 1bb824019..196b59506 100644 --- a/src/include/gpxe/infiniband.h +++ b/src/include/gpxe/infiniband.h @@ -306,6 +306,8 @@ struct ib_device { struct ib_device_operations *op; /** Port number */ unsigned int port; + /** Port open request counter */ + unsigned int open_count; /** Port state */ uint8_t port_state; @@ -364,6 +366,8 @@ extern void ib_complete_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *av, struct io_buffer *iobuf, int rc ); +extern int ib_open ( struct ib_device *ibdev ); +extern void ib_close ( struct ib_device *ibdev ); extern int ib_mcast_attach ( struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_gid *gid ); extern void ib_mcast_detach ( struct ib_device *ibdev, @@ -389,27 +393,6 @@ ib_poll_cq ( struct ib_device *ibdev, struct ib_completion_queue *cq ) { ibdev->op->poll_cq ( ibdev, cq ); } -/** - * Open port - * - * @v ibdev Infiniband device - * @ret rc Return status code - */ -static inline __always_inline int -ib_open ( struct ib_device *ibdev ) { - return ibdev->op->open ( ibdev ); -} - -/** - * Close port - * - * @v ibdev Infiniband device - */ -static inline __always_inline void -ib_close ( struct ib_device *ibdev ) { - ibdev->op->close ( ibdev ); -} - /** * Check link state * -- cgit v1.2.3-55-g7522