scif_rma_list.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Intel MIC Platform Software Stack (MPSS)
  3. *
  4. * Copyright(c) 2015 Intel Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License, version 2, as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * Intel SCIF driver.
  16. *
  17. */
  18. #ifndef SCIF_RMA_LIST_H
  19. #define SCIF_RMA_LIST_H
  20. /*
  21. * struct scif_rma_req - Self Registration list RMA Request query
  22. *
  23. * @out_window - Returns the window if found
  24. * @offset: Starting offset
  25. * @nr_bytes: number of bytes
  26. * @prot: protection requested i.e. read or write or both
  27. * @type: Specify single, partial or multiple windows
  28. * @head: Head of list on which to search
  29. * @va_for_temp: VA for searching temporary cached windows
  30. */
  31. struct scif_rma_req {
  32. struct scif_window **out_window;
  33. union {
  34. s64 offset;
  35. unsigned long va_for_temp;
  36. };
  37. size_t nr_bytes;
  38. int prot;
  39. enum scif_window_type type;
  40. struct list_head *head;
  41. };
  42. /* Insert */
  43. void scif_insert_window(struct scif_window *window, struct list_head *head);
  44. void scif_insert_tcw(struct scif_window *window,
  45. struct list_head *head);
  46. /* Query */
  47. int scif_query_window(struct scif_rma_req *request);
  48. int scif_query_tcw(struct scif_endpt *ep, struct scif_rma_req *request);
  49. /* Called from close to unregister all self windows */
  50. int scif_unregister_all_windows(scif_epd_t epd);
  51. void scif_unmap_all_windows(scif_epd_t epd);
  52. /* Traverse list and unregister */
  53. int scif_rma_list_unregister(struct scif_window *window, s64 offset,
  54. int nr_pages);
  55. #endif /* SCIF_RMA_LIST_H */