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_gma.h 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _GPXE_IB_GMA_H
  2. #define _GPXE_IB_GMA_H
  3. /** @file
  4. *
  5. * Infiniband General Management Agent
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER );
  9. #include <gpxe/list.h>
  10. #include <gpxe/retry.h>
  11. #include <gpxe/tables.h>
  12. struct ib_device;
  13. struct ib_completion_queue;
  14. struct ib_queue_pair;
  15. union ib_mad;
  16. struct ib_gma;
  17. enum ib_queue_pair_type;
  18. /** A GMA attribute handler */
  19. struct ib_gma_handler {
  20. /** Management class */
  21. uint8_t mgmt_class;
  22. /** Management class don't-care bits */
  23. uint8_t mgmt_class_ignore;
  24. /** Class version */
  25. uint8_t class_version;
  26. /** Method */
  27. uint8_t method;
  28. /** Response method, or zero */
  29. uint8_t resp_method;
  30. /** Attribute (in network byte order) */
  31. uint16_t attr_id;
  32. /** Handle attribute
  33. *
  34. * @v gma General management agent
  35. * @v mad MAD
  36. * @ret rc Return status code
  37. *
  38. * The handler should modify the MAD as applicable. If the
  39. * handler returns with a non-zero value in the MAD's @c
  40. * method field, it will be sent as a response.
  41. */
  42. int ( * handle ) ( struct ib_gma *gma, union ib_mad *mad );
  43. };
  44. /** GMA attribute handlers */
  45. #define IB_GMA_HANDLERS __table ( struct ib_gma_handler, "ib_gma_handlers" )
  46. /** Declare a GMA attribute handler */
  47. #define __ib_gma_handler __table_entry ( IB_GMA_HANDLERS, 01 )
  48. /** An Infiniband General Management Agent */
  49. struct ib_gma {
  50. /** Infiniband device */
  51. struct ib_device *ibdev;
  52. /** Completion queue */
  53. struct ib_completion_queue *cq;
  54. /** Queue pair */
  55. struct ib_queue_pair *qp;
  56. /** List of outstanding MAD requests */
  57. struct list_head requests;
  58. };
  59. extern int ib_gma_request ( struct ib_gma *gma, union ib_mad *mad,
  60. struct ib_address_vector *av, int retry );
  61. extern int ib_create_gma ( struct ib_gma *gma, struct ib_device *ibdev,
  62. enum ib_queue_pair_type type );
  63. extern void ib_destroy_gma ( struct ib_gma *gma );
  64. #endif /* _GPXE_IB_GMA_H */