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>
15 #include <gpxe/infiniband.h>
19 /** A GMA attribute handler */
20 struct ib_gma_handler {
21 /** Management class */
23 /** Management class don't-care bits */
24 uint8_t mgmt_class_ignore;
26 uint8_t class_version;
29 /** Response method, or zero */
31 /** Attribute (in network byte order) */
35 * @v gma General management agent
38 * The handler should modify the MAD as applicable. If the
39 * handler returns with a non-zero value in the MAD's @c
40 * method field, it will be sent as a response.
42 void ( * handle ) ( struct ib_gma *gma, union ib_mad *mad );
45 /** GMA attribute handlers */
46 #define IB_GMA_HANDLERS __table ( struct ib_gma_handler, "ib_gma_handlers" )
48 /** Declare a GMA attribute handler */
49 #define __ib_gma_handler __table_entry ( IB_GMA_HANDLERS, 01 )
51 /** An Infiniband General Management Agent */
53 /** Infiniband device */
54 struct ib_device *ibdev;
55 /** Completion queue */
56 struct ib_completion_queue *cq;
58 struct ib_queue_pair *qp;
60 /** List of outstanding MAD requests */
61 struct list_head requests;
64 extern int ib_gma_request ( struct ib_gma *gma, union ib_mad *mad,
65 struct ib_address_vector *av, int retry );
66 extern struct ib_gma * ib_create_gma ( struct ib_device *ibdev,
67 enum ib_queue_pair_type type );
68 extern void ib_destroy_gma ( struct ib_gma *gma );
70 #endif /* _GPXE_IB_GMA_H */