summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/ib_cm.h
diff options
context:
space:
mode:
authorMichael Brown2009-08-06 02:18:38 +0200
committerMichael Brown2009-08-09 00:56:28 +0200
commit34bfc04e4c2ea74a025994fc37c83d640942a651 (patch)
tree959f4815000618ff158ffccf14fcb21c89c70d16 /src/include/gpxe/ib_cm.h
parent[infiniband] Update subnet management agent to use a management interface (diff)
downloadipxe-34bfc04e4c2ea74a025994fc37c83d640942a651.tar.gz
ipxe-34bfc04e4c2ea74a025994fc37c83d640942a651.tar.xz
ipxe-34bfc04e4c2ea74a025994fc37c83d640942a651.zip
[infiniband] Update all other MAD users to use a management interface
Diffstat (limited to 'src/include/gpxe/ib_cm.h')
-rw-r--r--src/include/gpxe/ib_cm.h60
1 files changed, 54 insertions, 6 deletions
diff --git a/src/include/gpxe/ib_cm.h b/src/include/gpxe/ib_cm.h
index a4446224..07f5b716 100644
--- a/src/include/gpxe/ib_cm.h
+++ b/src/include/gpxe/ib_cm.h
@@ -10,12 +10,60 @@
FILE_LICENCE ( GPL2_OR_LATER );
#include <gpxe/infiniband.h>
+#include <gpxe/retry.h>
-extern int ib_cm_connect ( struct ib_queue_pair *qp, struct ib_gid *dgid,
- struct ib_gid_half *service_id,
- void *private_data, size_t private_data_len,
- void ( * notify ) ( struct ib_queue_pair *qp,
- int rc, void *private_data,
- size_t private_data_len ) );
+struct ib_mad_transaction;
+struct ib_connection;
+
+/** Infiniband connection operations */
+struct ib_connection_operations {
+ /** Handle change of connection status
+ *
+ * @v ibdev Infiniband device
+ * @v qp Queue pair
+ * @v conn Connection
+ * @v rc Connection status code
+ * @v private_data Private data, if available
+ * @v private_data_len Length of private data
+ */
+ void ( * changed ) ( struct ib_device *ibdev, struct ib_queue_pair *qp,
+ struct ib_connection *conn, int rc,
+ void *private_data, size_t private_data_len );
+};
+
+/** An Infiniband connection */
+struct ib_connection {
+ /** Infiniband device */
+ struct ib_device *ibdev;
+ /** Queue pair */
+ struct ib_queue_pair *qp;
+ /** Local communication ID */
+ uint32_t local_id;
+ /** Remote communication ID */
+ uint32_t remote_id;
+ /** Target service ID */
+ struct ib_gid_half service_id;
+ /** Connection operations */
+ struct ib_connection_operations *op;
+
+ /** Path to target */
+ struct ib_path *path;
+ /** Connection request management transaction */
+ struct ib_mad_transaction *madx;
+
+ /** Length of connection request private data */
+ size_t private_data_len;
+ /** Connection request private data */
+ uint8_t private_data[0];
+};
+
+extern struct ib_connection *
+ib_create_conn ( struct ib_device *ibdev, struct ib_queue_pair *qp,
+ struct ib_gid *dgid, struct ib_gid_half *service_id,
+ void *req_private_data, size_t req_private_data_len,
+ struct ib_connection_operations *op );
+extern void ib_destroy_conn ( struct ib_device *ibdev,
+ struct ib_queue_pair *qp,
+ struct ib_connection *conn );
#endif /* _GPXE_IB_CM_H */