iPXE
ib_cm.h
Go to the documentation of this file.
00001 #ifndef _IPXE_IB_CM_H
00002 #define _IPXE_IB_CM_H
00003 
00004 /** @file
00005  *
00006  * Infiniband communication management
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <ipxe/infiniband.h>
00013 #include <ipxe/retry.h>
00014 
00015 struct ib_mad_transaction;
00016 struct ib_connection;
00017 
00018 /** Infiniband connection operations */
00019 struct ib_connection_operations {
00020         /** Handle change of connection status
00021          *
00022          * @v ibdev             Infiniband device
00023          * @v qp                Queue pair
00024          * @v conn              Connection
00025          * @v rc                Connection status code
00026          * @v private_data      Private data, if available
00027          * @v private_data_len  Length of private data
00028          */
00029         void ( * changed ) ( struct ib_device *ibdev, struct ib_queue_pair *qp,
00030                              struct ib_connection *conn, int rc,
00031                              void *private_data, size_t private_data_len );
00032 };
00033 
00034 /** An Infiniband connection */
00035 struct ib_connection {
00036         /** Infiniband device */
00037         struct ib_device *ibdev;
00038         /** Queue pair */
00039         struct ib_queue_pair *qp;
00040         /** Local communication ID */
00041         uint32_t local_id;
00042         /** Remote communication ID */
00043         uint32_t remote_id;
00044         /** Target service ID */
00045         union ib_guid service_id;
00046         /** Connection operations */
00047         struct ib_connection_operations *op;
00048 
00049         /** List of connections */
00050         struct list_head list;
00051 
00052         /** Path to target */
00053         struct ib_path *path;
00054         /** Connection request management transaction */
00055         struct ib_mad_transaction *madx;
00056 
00057         /** Length of connection request private data */
00058         size_t private_data_len;
00059         /** Connection request private data */
00060         uint8_t private_data[0];
00061 };
00062 
00063 extern struct ib_connection *
00064 ib_create_conn ( struct ib_device *ibdev, struct ib_queue_pair *qp,
00065                  union ib_gid *dgid, union ib_guid *service_id,
00066                  void *req_private_data, size_t req_private_data_len,
00067                  struct ib_connection_operations *op );
00068 extern void ib_destroy_conn ( struct ib_device *ibdev,
00069                               struct ib_queue_pair *qp,
00070                               struct ib_connection *conn );
00071 
00072 #endif /* _IPXE_IB_CM_H */