6 * Infiniband General Management Agent
10 FILE_LICENCE ( GPL2_OR_LATER );
12 #include <gpxe/list.h>
13 #include <gpxe/retry.h>
14 #include <gpxe/tables.h>
17 struct ib_completion_queue;
21 /** A MAD attribute handler */
22 struct ib_mad_handler {
23 /** Management class */
26 uint8_t class_version;
29 /** Response method, or zero */
31 /** Attribute (in network byte order) */
35 * @v ibdev Infiniband device
37 * @ret rc Return status code
39 * The handler should modify the MAD as applicable. If the
40 * handler returns with a non-zero value in the MAD's @c
41 * method field, it will be sent as a response.
43 int ( * handle ) ( struct ib_device *ibdev, union ib_mad *mad );
46 /** MAD attribute handlers */
47 #define IB_MAD_HANDLERS __table ( struct ib_mad_handler, "ib_mad_handlers" )
49 /** Declare a MAD attribute handler */
50 #define __ib_mad_handler __table_entry ( IB_MAD_HANDLERS, 01 )
52 /** An Infiniband General Management Agent */
54 /** Infiniband device */
55 struct ib_device *ibdev;
56 /** Completion queue */
57 struct ib_completion_queue *cq;
59 struct ib_queue_pair *qp;
61 /** List of outstanding MAD requests */
62 struct list_head requests;
65 extern int ib_gma_request ( struct ib_gma *gma, union ib_mad *mad,
66 struct ib_address_vector *av );
67 extern int ib_create_gma ( struct ib_gma *gma, struct ib_device *ibdev,
69 extern void ib_destroy_gma ( struct ib_gma *gma );
71 #endif /* _GPXE_IB_GMA_H */