summaryrefslogtreecommitdiffstats
path: root/qemu/roms/ipxe/src/include/ipxe/ipoib.h
blob: 68ff8df49791a132b938ac25958a9781e0f72238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef _IPXE_IPOIB_H
#define _IPXE_IPOIB_H

/** @file
 *
 * IP over Infiniband
 */

FILE_LICENCE ( GPL2_OR_LATER );

#include <ipxe/if_arp.h>
#include <ipxe/infiniband.h>

/** IPoIB MAC address length */
#define IPOIB_ALEN 20

/** An IPoIB MAC address */
struct ipoib_mac {
	/** Queue pair number
	 *
	 * MSB indicates support for IPoIB "connected mode".  Lower 24
	 * bits are the QPN.
	 */
	uint32_t flags__qpn;
	/** Port GID */
	union ib_gid gid;
} __attribute__ (( packed ));

/** IPoIB link-layer header length */
#define IPOIB_HLEN 4

/** IPoIB link-layer header */
struct ipoib_hdr {
	/** Network-layer protocol */
	uint16_t proto;
	/** Reserved, must be zero */
	uint16_t reserved;
} __attribute__ (( packed ));

/** GUID mask used for constructing eIPoIB Local Ethernet MAC address (LEMAC) */
#define IPOIB_GUID_MASK 0xe7

/** eIPoIB Remote Ethernet MAC address
 *
 * An eIPoIB REMAC address is an Ethernet-like (6 byte) link-layer
 * pseudo-address used to look up a full IPoIB link-layer address.
 */
struct ipoib_remac {
	/** Remote QPN
	 *
	 * Must be ORed with EIPOIB_QPN_LA so that eIPoIB REMAC
	 * addresses are considered as locally-assigned Ethernet MAC
	 * addreses.
	 */
	uint32_t qpn;
	/** Remote LID */
	uint16_t lid;
} __attribute__ (( packed ));

/** eIPoIB REMAC locally-assigned address indicator */
#define EIPOIB_QPN_LA 0x02000000UL

extern const char * ipoib_ntoa ( const void *ll_addr );
extern struct net_device * alloc_ipoibdev ( size_t priv_size );

#endif /* _IPXE_IPOIB_H */