summaryrefslogtreecommitdiffstats
path: root/src/net/infiniband.c
diff options
context:
space:
mode:
authorMichael Brown2007-09-17 06:04:58 +0200
committerMichael Brown2007-09-17 06:04:58 +0200
commit4e78a53cf26b85736123eee29d23d637b4a3883f (patch)
tree319b933d03e9095460ff53ee22e5619f93f81a70 /src/net/infiniband.c
parentRead port GID directly using MAD IFC. (diff)
downloadipxe-4e78a53cf26b85736123eee29d23d637b4a3883f.tar.gz
ipxe-4e78a53cf26b85736123eee29d23d637b4a3883f.tar.xz
ipxe-4e78a53cf26b85736123eee29d23d637b4a3883f.zip
IPoIB code separated out to ipoib.c.
Diffstat (limited to 'src/net/infiniband.c')
-rw-r--r--src/net/infiniband.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/net/infiniband.c b/src/net/infiniband.c
index a9ca0e31..7a68b7d4 100644
--- a/src/net/infiniband.c
+++ b/src/net/infiniband.c
@@ -153,8 +153,6 @@ void ib_destroy_qp ( struct ib_device *ibdev,
free ( qp );
}
-
-
/**
* Find work queue belonging to completion queue
*
@@ -174,7 +172,35 @@ struct ib_work_queue * ib_find_wq ( struct ib_completion_queue *cq,
return NULL;
}
+/**
+ * Allocate Infiniband device
+ *
+ * @v priv_size Size of private data area
+ * @ret ibdev Infiniband device, or NULL
+ */
+struct ib_device * alloc_ibdev ( size_t priv_size ) {
+ struct ib_device *ibdev;
+ size_t total_len;
+
+ total_len = ( sizeof ( *ibdev ) + priv_size );
+ ibdev = zalloc ( total_len );
+ if ( ibdev ) {
+ ibdev->dev_priv = ( ( ( void * ) ibdev ) + sizeof ( *ibdev ) );
+ }
+ return ibdev;
+}
+/**
+ * Free Infiniband device
+ *
+ * @v ibdev Infiniband device
+ */
+void free_ibdev ( struct ib_device *ibdev ) {
+ free ( ibdev );
+}
+
+
+#if 0
/** Infiniband broadcast MAC address */
static uint8_t ib_broadcast[IB_ALEN] = { 0xff, };
@@ -259,3 +285,5 @@ struct ll_protocol infiniband_protocol __ll_protocol = {
.rx = ib_rx,
.ntoa = ib_ntoa,
};
+
+#endif