diff options
author | Michael Brown <mcb30@ipxe.org> | 2010-09-15 19:25:05 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2010-09-15 19:25:05 +0100 |
commit | 52e54a8c69351ee1455f8fbf2a9cd5d27d42f7ab (patch) | |
tree | d8b88315c25088f824ee97b0b0faf4945311445a /src/include/ipxe/ib_packet.h | |
parent | 3ea3c846d8cb5d7f1814eab6a3dac149b4f7fe8b (diff) | |
download | ipxe-52e54a8c69351ee1455f8fbf2a9cd5d27d42f7ab.tar.gz |
[infiniband] Match GID/GUID terminology as used in the IBA
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/ib_packet.h')
-rw-r--r-- | src/include/ipxe/ib_packet.h | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/src/include/ipxe/ib_packet.h b/src/include/ipxe/ib_packet.h index 09042957b..4bd335764 100644 --- a/src/include/ipxe/ib_packet.h +++ b/src/include/ipxe/ib_packet.h @@ -14,25 +14,38 @@ struct ib_queue_pair; struct ib_address_vector; struct io_buffer; -/** Half of an Infiniband Global Identifier */ -struct ib_gid_half { - union { - uint8_t bytes[8]; - uint16_t words[4]; - uint32_t dwords[2]; - } u; +/** An Infiniband Globally Unique Identifier */ +union ib_guid { + uint8_t bytes[8]; + uint16_t words[4]; + uint32_t dwords[2]; }; +/** Infiniband Globally Unique Identifier debug message format */ +#define IB_GUID_FMT "%08x:%08x" + +/** Infiniband Globally Unique Identifier debug message arguments */ +#define IB_GUID_ARGS( guid ) \ + ntohl ( (guid)->dwords[0] ), ntohl ( (guid)->dwords[1] ) + /** An Infiniband Global Identifier */ -struct ib_gid { - union { - uint8_t bytes[16]; - uint16_t words[8]; - uint32_t dwords[4]; - struct ib_gid_half half[2]; - } u; +union ib_gid { + uint8_t bytes[16]; + uint16_t words[8]; + uint32_t dwords[4]; + struct { + union ib_guid prefix; + union ib_guid guid; + } s; }; +/** Infiniband Global Identifier debug message format */ +#define IB_GID_FMT IB_GUID_FMT ":" IB_GUID_FMT + +/** Infiniband Global Identifier debug message arguments */ +#define IB_GID_ARGS( gid ) \ + IB_GUID_ARGS ( &(gid)->s.prefix ), IB_GUID_ARGS ( &(gid)->s.guid ) + /** An Infiniband Local Route Header */ struct ib_local_route_header { /** Virtual lane and link version */ @@ -83,9 +96,9 @@ struct ib_global_route_header { /** Hop limit */ uint8_t hoplmt; /** Source GID */ - struct ib_gid sgid; + union ib_gid sgid; /** Destiniation GID */ - struct ib_gid dgid; + union ib_gid dgid; } __attribute__ (( packed )); #define IB_GRH_IPVER_IPv6 0x06 |