iPXE
ipoib.h
Go to the documentation of this file.
00001 #ifndef _IPXE_IPOIB_H
00002 #define _IPXE_IPOIB_H
00003 
00004 /** @file
00005  *
00006  * IP over Infiniband
00007  */
00008 
00009 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00010 
00011 #include <ipxe/if_arp.h>
00012 #include <ipxe/infiniband.h>
00013 
00014 /** IPoIB MAC address length */
00015 #define IPOIB_ALEN 20
00016 
00017 /** An IPoIB MAC address */
00018 struct ipoib_mac {
00019         /** Queue pair number
00020          *
00021          * MSB indicates support for IPoIB "connected mode".  Lower 24
00022          * bits are the QPN.
00023          */
00024         uint32_t flags__qpn;
00025         /** Port GID */
00026         union ib_gid gid;
00027 } __attribute__ (( packed ));
00028 
00029 /** IPoIB link-layer header length */
00030 #define IPOIB_HLEN 4
00031 
00032 /** IPoIB link-layer header */
00033 struct ipoib_hdr {
00034         /** Network-layer protocol */
00035         uint16_t proto;
00036         /** Reserved, must be zero */
00037         uint16_t reserved;
00038 } __attribute__ (( packed ));
00039 
00040 /** GUID mask used for constructing eIPoIB Local Ethernet MAC address (LEMAC) */
00041 #define IPOIB_GUID_MASK 0xe7
00042 
00043 /** eIPoIB Remote Ethernet MAC address
00044  *
00045  * An eIPoIB REMAC address is an Ethernet-like (6 byte) link-layer
00046  * pseudo-address used to look up a full IPoIB link-layer address.
00047  */
00048 struct ipoib_remac {
00049         /** Remote QPN
00050          *
00051          * Must be ORed with EIPOIB_QPN_LA so that eIPoIB REMAC
00052          * addresses are considered as locally-assigned Ethernet MAC
00053          * addreses.
00054          */
00055         uint32_t qpn;
00056         /** Remote LID */
00057         uint16_t lid;
00058 } __attribute__ (( packed ));
00059 
00060 /** eIPoIB REMAC locally-assigned address indicator */
00061 #define EIPOIB_QPN_LA 0x02000000UL
00062 
00063 extern const char * ipoib_ntoa ( const void *ll_addr );
00064 extern struct net_device * alloc_ipoibdev ( size_t priv_size );
00065 extern struct net_device * ipoib_netdev ( struct ib_device *ibdev );
00066 
00067 #endif /* _IPXE_IPOIB_H */