diff options
| author | Michael Brown | 2007-09-12 23:17:43 +0200 |
|---|---|---|
| committer | Michael Brown | 2007-09-12 23:17:43 +0200 |
| commit | 7b6d11e7136cee21cc9a76614174abac999f6173 (patch) | |
| tree | f87381e9857a46b5a96b32d63695fa5b71192fba /src/include | |
| parent | Merge branch 'master' into 3leaf-rewrite (diff) | |
| download | ipxe-7b6d11e7136cee21cc9a76614174abac999f6173.tar.gz ipxe-7b6d11e7136cee21cc9a76614174abac999f6173.tar.xz ipxe-7b6d11e7136cee21cc9a76614174abac999f6173.zip | |
Started IB driver rewrite
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/gpxe/errfile.h | 1 | ||||
| -rw-r--r-- | src/include/gpxe/infiniband.h | 52 | ||||
| -rw-r--r-- | src/include/gpxe/netdevice.h | 4 |
3 files changed, 55 insertions, 2 deletions
diff --git a/src/include/gpxe/errfile.h b/src/include/gpxe/errfile.h index 4f9e7bc65..3413f9cf4 100644 --- a/src/include/gpxe/errfile.h +++ b/src/include/gpxe/errfile.h @@ -123,6 +123,7 @@ #define ERRFILE_dhcp ( ERRFILE_NET | 0x00100000 ) #define ERRFILE_dns ( ERRFILE_NET | 0x00110000 ) #define ERRFILE_tftp ( ERRFILE_NET | 0x00120000 ) +#define ERRFILE_infiniband ( ERRFILE_NET | 0x00130000 ) #define ERRFILE_image ( ERRFILE_IMAGE | 0x00000000 ) #define ERRFILE_elf ( ERRFILE_IMAGE | 0x00010000 ) diff --git a/src/include/gpxe/infiniband.h b/src/include/gpxe/infiniband.h new file mode 100644 index 000000000..126113a74 --- /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 */ diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h index d82c6d8f4..2cbd0efb1 100644 --- a/src/include/gpxe/netdevice.h +++ b/src/include/gpxe/netdevice.h @@ -19,10 +19,10 @@ struct ll_protocol; struct device; /** Maximum length of a link-layer address */ -#define MAX_LL_ADDR_LEN 6 +#define MAX_LL_ADDR_LEN 20 /** Maximum length of a link-layer header */ -#define MAX_LL_HEADER_LEN 16 +#define MAX_LL_HEADER_LEN 32 /** Maximum length of a network-layer address */ #define MAX_NET_ADDR_LEN 4 |
