mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 10:02:42 +03:00
[Infiniband] Move event-queue process from driver to Infiniband core
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user