Rename gpxe to .
[grub-extras.git] / src / include / gpxe / ib_srp.h
blobcf705b30e64a45b9e2814bf5bcdd8c436776a70e
1 #ifndef _GPXE_IB_SRP_H
2 #define _GPXE_IB_SRP_H
4 /** @file
6 * SCSI RDMA Protocol over Infiniband
8 */
10 FILE_LICENCE ( BSD2 );
12 #include <stdint.h>
13 #include <gpxe/infiniband.h>
14 #include <gpxe/srp.h>
16 /** SRP initiator port identifier for Infiniband */
17 struct ib_srp_initiator_port_id {
18 /** Identifier extension */
19 struct ib_gid_half id_ext;
20 /** IB channel adapter GUID */
21 struct ib_gid_half hca_guid;
22 } __attribute__ (( packed ));
24 /** SRP target port identifier for Infiniband */
25 struct ib_srp_target_port_id {
26 /** Identifier extension */
27 struct ib_gid_half id_ext;
28 /** I/O controller GUID */
29 struct ib_gid_half ioc_guid;
30 } __attribute__ (( packed ));
32 /**
33 * Get Infiniband-specific initiator port ID
35 * @v port_ids SRP port IDs
36 * @ret initiator_port_id Infiniband-specific initiator port ID
38 static inline __always_inline struct ib_srp_initiator_port_id *
39 ib_srp_initiator_port_id ( struct srp_port_ids *port_ids ) {
40 return ( ( struct ib_srp_initiator_port_id * ) &port_ids->initiator );
43 /**
44 * Get Infiniband-specific target port ID
46 * @v port_ids SRP port IDs
47 * @ret target_port_id Infiniband-specific target port ID
49 static inline __always_inline struct ib_srp_target_port_id *
50 ib_srp_target_port_id ( struct srp_port_ids *port_ids ) {
51 return ( ( struct ib_srp_target_port_id * ) &port_ids->target );
54 /** Infiniband-specific SRP parameters */
55 struct ib_srp_parameters {
56 /** Source GID */
57 struct ib_gid sgid;
58 /** Destination GID */
59 struct ib_gid dgid;
60 /** Service ID */
61 struct ib_gid_half service_id;
62 /** Partition key */
63 uint16_t pkey;
66 /**
67 * Get Infiniband-specific transport parameters
69 * @v srp SRP device
70 * @ret ib_params Infiniband-specific transport parameters
72 static inline __always_inline struct ib_srp_parameters *
73 ib_srp_params ( struct srp_device *srp ) {
74 return srp_transport_priv ( srp );
77 extern struct srp_transport_type ib_srp_transport;
79 #endif /* _GPXE_IB_SRP_H */