00001 #ifndef _GPXE_IB_SRP_H 00002 #define _GPXE_IB_SRP_H 00003 00004 /** @file 00005 * 00006 * SCSI RDMA Protocol over Infiniband 00007 * 00008 */ 00009 00010 FILE_LICENCE ( BSD2 ); 00011 00012 #include <stdint.h> 00013 #include <gpxe/infiniband.h> 00014 #include <gpxe/srp.h> 00015 00016 /** SRP initiator port identifier for Infiniband */ 00017 struct ib_srp_initiator_port_id { 00018 /** Identifier extension */ 00019 struct ib_gid_half id_ext; 00020 /** IB channel adapter GUID */ 00021 struct ib_gid_half hca_guid; 00022 } __attribute__ (( packed )); 00023 00024 /** SRP target port identifier for Infiniband */ 00025 struct ib_srp_target_port_id { 00026 /** Identifier extension */ 00027 struct ib_gid_half id_ext; 00028 /** I/O controller GUID */ 00029 struct ib_gid_half ioc_guid; 00030 } __attribute__ (( packed )); 00031 00032 /** 00033 * Get Infiniband-specific initiator port ID 00034 * 00035 * @v port_ids SRP port IDs 00036 * @ret initiator_port_id Infiniband-specific initiator port ID 00037 */ 00038 static inline __always_inline struct ib_srp_initiator_port_id * 00039 ib_srp_initiator_port_id ( struct srp_port_ids *port_ids ) { 00040 return ( ( struct ib_srp_initiator_port_id * ) &port_ids->initiator ); 00041 } 00042 00043 /** 00044 * Get Infiniband-specific target port ID 00045 * 00046 * @v port_ids SRP port IDs 00047 * @ret target_port_id Infiniband-specific target port ID 00048 */ 00049 static inline __always_inline struct ib_srp_target_port_id * 00050 ib_srp_target_port_id ( struct srp_port_ids *port_ids ) { 00051 return ( ( struct ib_srp_target_port_id * ) &port_ids->target ); 00052 } 00053 00054 /** Infiniband-specific SRP parameters */ 00055 struct ib_srp_parameters { 00056 /** Source GID */ 00057 struct ib_gid sgid; 00058 /** Destination GID */ 00059 struct ib_gid dgid; 00060 /** Service ID */ 00061 struct ib_gid_half service_id; 00062 /** Partition key */ 00063 uint16_t pkey; 00064 }; 00065 00066 /** 00067 * Get Infiniband-specific transport parameters 00068 * 00069 * @v srp SRP device 00070 * @ret ib_params Infiniband-specific transport parameters 00071 */ 00072 static inline __always_inline struct ib_srp_parameters * 00073 ib_srp_params ( struct srp_device *srp ) { 00074 return srp_transport_priv ( srp ); 00075 } 00076 00077 extern struct srp_transport_type ib_srp_transport; 00078 00079 #endif /* _GPXE_IB_SRP_H */
1.5.7.1