summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/ib_srp.h
blob: 4b6df8d3b4a760ece2d51986af32d923b7b56c2b (plain) (blame)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef _IPXE_IB_SRP_H
#define _IPXE_IB_SRP_H

/** @file
 *
 * SCSI RDMA Protocol over Infiniband
 *
 */

FILE_LICENCE ( BSD2 );

#include <stdint.h>
#include <ipxe/acpi.h>
#include <ipxe/interface.h>
#include <ipxe/infiniband.h>
#include <ipxe/srp.h>

/** SRP initiator port identifier for Infiniband */
union ib_srp_initiator_port_id {
	/** SRP version of port identifier */
	union srp_port_id srp;
	/** Infiniband version of port identifier */
	struct {
		/** Identifier extension */
		union ib_guid id_ext;
		/** IB channel adapter GUID */
		union ib_guid hca_guid;
	} __attribute__ (( packed )) ib;
};

/** SRP target port identifier for Infiniband */
union ib_srp_target_port_id {
	/** SRP version of port identifier */
	union srp_port_id srp;
	/** Infiniband version of port identifier */
	struct {
		/** Identifier extension */
		union ib_guid id_ext;
		/** I/O controller GUID */
		union ib_guid ioc_guid;
	} __attribute__ (( packed )) ib;
};

/**
 * sBFT Infiniband subtable
 */
struct sbft_ib_subtable {
	/** Source GID */
	union ib_gid sgid;
	/** Destination GID */
	union ib_gid dgid;
	/** Service ID */
	union ib_guid service_id;
	/** Partition key */
	uint16_t pkey;
	/** Reserved */
	uint8_t reserved[6];
} __attribute__ (( packed ));

/**
 * An Infiniband SRP sBFT created by iPXE
 */
struct ipxe_ib_sbft {
	/** The table header */
	struct sbft_table table;
	/** The SCSI subtable */
	struct sbft_scsi_subtable scsi;
	/** The SRP subtable */
	struct sbft_srp_subtable srp;
	/** The Infiniband subtable */
	struct sbft_ib_subtable ib;
};

/** An Infiniband SRP device */
struct ib_srp_device {
	/** Reference count */
	struct refcnt refcnt;

	/** SRP transport interface */
	struct interface srp;
	/** CMRC interface */
	struct interface cmrc;

	/** Infiniband device */
	struct ib_device *ibdev;

	/** ACPI descriptor */
	struct acpi_descriptor desc;
	/** Boot firmware table parameters */
	struct ipxe_ib_sbft sbft;
};

#endif /* _IPXE_IB_SRP_H */