summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/infiniband.h
diff options
context:
space:
mode:
authorMichael Brown2007-09-12 23:17:43 +0200
committerMichael Brown2007-09-12 23:17:43 +0200
commit7b6d11e7136cee21cc9a76614174abac999f6173 (patch)
treef87381e9857a46b5a96b32d63695fa5b71192fba /src/include/gpxe/infiniband.h
parentMerge branch 'master' into 3leaf-rewrite (diff)
downloadipxe-7b6d11e7136cee21cc9a76614174abac999f6173.tar.gz
ipxe-7b6d11e7136cee21cc9a76614174abac999f6173.tar.xz
ipxe-7b6d11e7136cee21cc9a76614174abac999f6173.zip
Started IB driver rewrite
Diffstat (limited to 'src/include/gpxe/infiniband.h')
-rw-r--r--src/include/gpxe/infiniband.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/include/gpxe/infiniband.h b/src/include/gpxe/infiniband.h
new file mode 100644
index 00000000..126113a7
--- /dev/null
+++ b/src/include/gpxe/infiniband.h
@@ -0,0 +1,52 @@
+#ifndef _GPXE_INFINIBAND_H
+#define _GPXE_INFINIBAND_H
+
+/** @file
+ *
+ * Infiniband protocol
+ *
+ */
+
+#include <stdint.h>
+#include <gpxe/netdevice.h>
+
+/** Infiniband hardware address length */
+#define IB_ALEN 20
+#define IB_HLEN 24
+
+/** An Infiniband header
+ *
+ * This data structure doesn't represent the on-wire format, but does
+ * contain all the information required by the driver to construct the
+ * packet.
+ */
+struct ibhdr {
+ /** Peer address */
+ uint8_t peer[IB_ALEN];
+ /** Network-layer protocol */
+ uint16_t proto;
+ /** Reserved, must be zero */
+ uint16_t reserved;
+} __attribute__ (( packed ));
+
+extern struct ll_protocol infiniband_protocol;
+
+extern const char * ib_ntoa ( const void *ll_addr );
+
+/**
+ * Allocate Infiniband device
+ *
+ * @v priv_size Size of driver private data
+ * @ret netdev Network device, or NULL
+ */
+static inline struct net_device * alloc_ibdev ( size_t priv_size ) {
+ struct net_device *netdev;
+
+ netdev = alloc_netdev ( priv_size );
+ if ( netdev ) {
+ netdev->ll_protocol = &infiniband_protocol;
+ }
+ return netdev;
+}
+
+#endif /* _GPXE_INFINIBAND_H */