[Infiniband] Move event-queue process from driver to Infiniband core

This commit is contained in:
Michael Brown
2008-04-21 13:23:11 +01:00
parent e55bab3ce3
commit 35a5836677
5 changed files with 353 additions and 261 deletions

View File

@@ -8,6 +8,7 @@
*/
#include <stdint.h>
#include <gpxe/refcnt.h>
#include <gpxe/device.h>
/** Subnet administrator QPN */
@@ -254,6 +255,12 @@ struct ib_device_operations {
struct ib_completion_queue *cq,
ib_completer_t complete_send,
ib_completer_t complete_recv );
/**
* Poll event queue
*
* @v ibdev Infiniband device
*/
void ( * poll_eq ) ( struct ib_device *ibdev );
/**
* Open port
*
@@ -300,6 +307,10 @@ struct ib_device_operations {
/** An Infiniband device */
struct ib_device {
/** Reference counter */
struct refcnt refcnt;
/** List of Infiniband devices */
struct list_head list;
/** Underlying device */
struct device *dev;
/** Infiniband operations */
@@ -337,7 +348,6 @@ extern struct ib_work_queue * ib_find_wq ( struct ib_completion_queue *cq,
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 void free_ibdev ( struct ib_device *ibdev );
extern void ib_link_state_changed ( struct ib_device *ibdev );
/**
@@ -444,6 +454,28 @@ ib_mad ( struct ib_device *ibdev, struct ib_mad_hdr *mad, size_t len ) {
return ibdev->op->mad ( ibdev, mad, len );
}
/**
* Get reference to Infiniband device
*
* @v ibdev Infiniband device
* @ret ibdev Infiniband device
*/
static inline __attribute__ (( always_inline )) struct ib_device *
ibdev_get ( struct ib_device *ibdev ) {
ref_get ( &ibdev->refcnt );
return ibdev;
}
/**
* Drop reference to Infiniband device
*
* @v ibdev Infiniband device
*/
static inline __attribute__ (( always_inline )) void
ibdev_put ( struct ib_device *ibdev ) {
ref_put ( &ibdev->refcnt );
}
/**
* Set Infiniband work queue driver-private data
*