summaryrefslogtreecommitdiffstats
path: root/debian/grub-extras/disabled/gpxe/src/include/gpxe/ipoib.h
blob: f8231db0818dc8891fcc646120b178a8b98e8307 (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
#ifndef _GPXE_IPOIB_H
#define _GPXE_IPOIB_H

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

FILE_LICENCE ( GPL2_OR_LATER );

#include <gpxe/infiniband.h>

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

/** An IPoIB MAC address */
struct ipoib_mac {
	/** Queue pair number
	 *
	 * MSB must be zero; QPNs are only 24-bit.
	 */
	uint32_t qpn;
	/** Port GID */
	struct 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 */
	union {
		/** Reserved, must be zero */
		uint16_t reserved;
		/** Peer addresses
		 *
		 * We use these fields internally to represent the
		 * peer addresses using a lookup key.  There simply
		 * isn't enough room in the IPoIB header to store
		 * literal source or destination MAC addresses.
		 */
		struct {
			/** Destination address key */
			uint8_t dest;
			/** Source address key */
			uint8_t src;
		} __attribute__ (( packed )) peer;
	} __attribute__ (( packed )) u;
} __attribute__ (( packed ));

extern const char * ipoib_ntoa ( const void *ll_addr );
extern void ipoib_link_state_changed ( struct ib_device *ibdev );
extern int ipoib_probe ( struct ib_device *ibdev );
extern void ipoib_remove ( struct ib_device *ibdev );
extern struct net_device * alloc_ipoibdev ( size_t priv_size );

#endif /* _GPXE_IPOIB_H */