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.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #include <gpxe/infiniband.h>
  13. struct ib_gma;
  14. /** A GMA attribute handler */
  15. struct ib_gma_handler {
  16. /** Management class */
  17. uint8_t mgmt_class;
  18. /** Management class don't-care bits */
  19. uint8_t mgmt_class_ignore;
  20. /** Class version */
  21. uint8_t class_version;
  22. /** Method */
  23. uint8_t method;
  24. /** Attribute (in network byte order) */
  25. uint16_t attr_id;
  26. /** Handle attribute
  27. *
  28. * @v gma General management agent
  29. * @v mad MAD
  30. * @ret response MAD response, or NULL to send no response
  31. */
  32. union ib_mad * ( * handle ) ( struct ib_gma *gma, union ib_mad *mad );
  33. };
  34. /** GMA attribute handlers */
  35. #define IB_GMA_HANDLERS __table ( struct ib_gma_handler, "ib_gma_handlers" )
  36. /** Declare a GMA attribute handler */
  37. #define __ib_gma_handler __table_entry ( IB_GMA_HANDLERS, 01 )
  38. /** An Infiniband General Management Agent */
  39. struct ib_gma {
  40. /** Infiniband device */
  41. struct ib_device *ibdev;
  42. /** Completion queue */
  43. struct ib_completion_queue *cq;
  44. /** Queue pair */
  45. struct ib_queue_pair *qp;
  46. /** List of outstanding MAD requests */
  47. struct list_head requests;
  48. };
  49. extern int ib_gma_request ( struct ib_gma *gma, union ib_mad *mad,
  50. struct ib_address_vector *av, int retry );
  51. extern struct ib_gma * ib_create_gma ( struct ib_device *ibdev,
  52. enum ib_queue_pair_type type );
  53. extern void ib_destroy_gma ( struct ib_gma *gma );
  54. #endif /* _GPXE_IB_GMA_H */