You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ib_srp.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef _GPXE_IB_SRP_H
  2. #define _GPXE_IB_SRP_H
  3. /** @file
  4. *
  5. * SCSI RDMA Protocol over Infiniband
  6. *
  7. */
  8. FILE_LICENCE ( BSD2 );
  9. #include <stdint.h>
  10. #include <gpxe/infiniband.h>
  11. #include <gpxe/srp.h>
  12. /** SRP initiator port identifier for Infiniband */
  13. struct ib_srp_initiator_port_id {
  14. /** Identifier extension */
  15. struct ib_gid_half id_ext;
  16. /** IB channel adapter GUID */
  17. struct ib_gid_half hca_guid;
  18. } __attribute__ (( packed ));
  19. /** SRP target port identifier for Infiniband */
  20. struct ib_srp_target_port_id {
  21. /** Identifier extension */
  22. struct ib_gid_half id_ext;
  23. /** I/O controller GUID */
  24. struct ib_gid_half ioc_guid;
  25. } __attribute__ (( packed ));
  26. /**
  27. * Get Infiniband-specific initiator port ID
  28. *
  29. * @v port_ids SRP port IDs
  30. * @ret initiator_port_id Infiniband-specific initiator port ID
  31. */
  32. static inline __always_inline struct ib_srp_initiator_port_id *
  33. ib_srp_initiator_port_id ( struct srp_port_ids *port_ids ) {
  34. return ( ( struct ib_srp_initiator_port_id * ) &port_ids->initiator );
  35. }
  36. /**
  37. * Get Infiniband-specific target port ID
  38. *
  39. * @v port_ids SRP port IDs
  40. * @ret target_port_id Infiniband-specific target port ID
  41. */
  42. static inline __always_inline struct ib_srp_target_port_id *
  43. ib_srp_target_port_id ( struct srp_port_ids *port_ids ) {
  44. return ( ( struct ib_srp_target_port_id * ) &port_ids->target );
  45. }
  46. /** Infiniband-specific SRP parameters */
  47. struct ib_srp_parameters {
  48. /** Source GID */
  49. struct ib_gid sgid;
  50. /** Destination GID */
  51. struct ib_gid dgid;
  52. /** Service ID */
  53. struct ib_gid_half service_id;
  54. /** Partition key */
  55. uint16_t pkey;
  56. };
  57. /**
  58. * Get Infiniband-specific transport parameters
  59. *
  60. * @v srp SRP device
  61. * @ret ib_params Infiniband-specific transport parameters
  62. */
  63. static inline __always_inline struct ib_srp_parameters *
  64. ib_srp_params ( struct srp_device *srp ) {
  65. return srp_transport_priv ( srp );
  66. }
  67. extern struct srp_transport_type ib_srp_transport;
  68. #endif /* _GPXE_IB_SRP_H */