diff options
Diffstat (limited to 'src/include/gpxe/ib_packet.h')
-rw-r--r-- | src/include/gpxe/ib_packet.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/include/gpxe/ib_packet.h b/src/include/gpxe/ib_packet.h index f9ef2f6e..5374802c 100644 --- a/src/include/gpxe/ib_packet.h +++ b/src/include/gpxe/ib_packet.h @@ -7,6 +7,11 @@ * */ +struct ib_device; +struct ib_queue_pair; +struct ib_address_vector; +struct io_buffer; + /** Half of an Infiniband Global Identifier */ struct ib_gid_half { uint8_t bytes[8]; @@ -53,6 +58,9 @@ enum ib_lnh { /** Default Infiniband LID */ #define IB_LID_NONE 0xffff +/** Test for multicast LID */ +#define IB_LID_MULTICAST( lid ) ( ( (lid) >= 0xc000 ) && ( (lid) <= 0xfffe ) ) + /** An Infiniband Global Route Header */ struct ib_global_route_header { /** IP version, traffic class, and flow label @@ -76,7 +84,6 @@ struct ib_global_route_header { #define IB_GRH_IPVER_IPv6 0x06 #define IB_GRH_NXTHDR_IBA 0x1b -#define IB_GRH_HOPLMT_MAX 0xff /** An Infiniband Base Transport Header */ struct ib_base_transport_header { @@ -111,4 +118,30 @@ struct ib_datagram_extended_transport_header { uint32_t src_qp; } __attribute__ (( packed )); +/** All known IB header formats */ +union ib_headers { + struct ib_local_route_header lrh; + struct { + struct ib_local_route_header lrh; + struct ib_global_route_header grh; + struct ib_base_transport_header bth; + struct ib_datagram_extended_transport_header deth; + } __attribute__ (( packed )) lrh__grh__bth__deth; + struct { + struct ib_local_route_header lrh; + struct ib_base_transport_header bth; + struct ib_datagram_extended_transport_header deth; + } __attribute__ (( packed )) lrh__bth__deth; +} __attribute__ (( packed )); + +/** Maximum size required for IB headers */ +#define IB_MAX_HEADER_SIZE sizeof ( union ib_headers ) + +extern int ib_push ( struct ib_device *ibdev, struct io_buffer *iobuf, + struct ib_queue_pair *qp, size_t payload_len, + const struct ib_address_vector *av ); +extern int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf, + struct ib_queue_pair **qp, size_t *payload_len, + struct ib_address_vector *av ); + #endif /* _GPXE_IB_PACKET_H */ |