1#ifndef _GPXE_IPOIB_H
2#define _GPXE_IPOIB_H
3
4/** @file
5 *
6 * IP over Infiniband
7 */
8
9FILE_LICENCE ( GPL2_OR_LATER );
10
11#include <gpxe/infiniband.h>
12
13/** IPoIB MAC address length */
14#define IPOIB_ALEN 20
15
16/** An IPoIB MAC address */
17struct ipoib_mac {
18	/** Queue pair number
19	 *
20	 * MSB indicates support for IPoIB "connected mode".  Lower 24
21	 * bits are the QPN.
22	 */
23	uint32_t flags__qpn;
24	/** Port GID */
25	struct ib_gid gid;
26} __attribute__ (( packed ));
27
28/** IPoIB link-layer header length */
29#define IPOIB_HLEN 4
30
31/** IPoIB link-layer header */
32struct ipoib_hdr {
33	/** Network-layer protocol */
34	uint16_t proto;
35	/** Reserved, must be zero */
36	union {
37		/** Reserved, must be zero */
38		uint16_t reserved;
39		/** Peer addresses
40		 *
41		 * We use these fields internally to represent the
42		 * peer addresses using a lookup key.  There simply
43		 * isn't enough room in the IPoIB header to store
44		 * literal source or destination MAC addresses.
45		 */
46		struct {
47			/** Destination address key */
48			uint8_t dest;
49			/** Source address key */
50			uint8_t src;
51		} __attribute__ (( packed )) peer;
52	} __attribute__ (( packed )) u;
53} __attribute__ (( packed ));
54
55extern const char * ipoib_ntoa ( const void *ll_addr );
56extern void ipoib_link_state_changed ( struct ib_device *ibdev );
57extern int ipoib_probe ( struct ib_device *ibdev );
58extern void ipoib_remove ( struct ib_device *ibdev );
59extern struct net_device * alloc_ipoibdev ( size_t priv_size );
60
61#endif /* _GPXE_IPOIB_H */
62