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_pathrec.h 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef _GPXE_IB_PATHREC_H
  2. #define _GPXE_IB_PATHREC_H
  3. /** @file
  4. *
  5. * Infiniband path records
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER );
  9. #include <gpxe/infiniband.h>
  10. struct ib_mad_transaction;
  11. struct ib_path;
  12. /** Infiniband path operations */
  13. struct ib_path_operations {
  14. /** Handle path transaction completion
  15. *
  16. * @v ibdev Infiniband device
  17. * @v path Path
  18. * @v rc Status code
  19. * @v av Address vector, or NULL on error
  20. */
  21. void ( * complete ) ( struct ib_device *ibdev,
  22. struct ib_path *path, int rc,
  23. struct ib_address_vector *av );
  24. };
  25. /** An Infiniband path */
  26. struct ib_path {
  27. /** Infiniband device */
  28. struct ib_device *ibdev;
  29. /** Address vector */
  30. struct ib_address_vector av;
  31. /** Management transaction */
  32. struct ib_mad_transaction *madx;
  33. /** Path operations */
  34. struct ib_path_operations *op;
  35. /** Owner private data */
  36. void *owner_priv;
  37. };
  38. /**
  39. * Set Infiniband path owner-private data
  40. *
  41. * @v path Path
  42. * @v priv Private data
  43. */
  44. static inline __always_inline void
  45. ib_path_set_ownerdata ( struct ib_path *path, void *priv ) {
  46. path->owner_priv = priv;
  47. }
  48. /**
  49. * Get Infiniband path owner-private data
  50. *
  51. * @v path Path
  52. * @ret priv Private data
  53. */
  54. static inline __always_inline void *
  55. ib_path_get_ownerdata ( struct ib_path *path ) {
  56. return path->owner_priv;
  57. }
  58. extern struct ib_path *
  59. ib_create_path ( struct ib_device *ibdev, struct ib_address_vector *av,
  60. struct ib_path_operations *op );
  61. extern void ib_destroy_path ( struct ib_device *ibdev,
  62. struct ib_path *path );
  63. extern int ib_resolve_path ( struct ib_device *ibdev,
  64. struct ib_address_vector *av );
  65. #endif /* _GPXE_IB_PATHREC_H */