xrp_host_impl.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (c) 2016 - 2018 Cadence Design Systems Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining
  5. * a copy of this software and associated documentation files (the
  6. * "Software"), to deal in the Software without restriction, including
  7. * without limitation the rights to use, copy, modify, merge, publish,
  8. * distribute, sublicense, and/or sell copies of the Software, and to
  9. * permit persons to whom the Software is furnished to do so, subject to
  10. * the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included
  13. * in all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  19. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  20. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  21. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. #ifndef _XRP_LINUX_NATIVE_H
  24. #define _XRP_LINUX_NATIVE_H
  25. #include <xrp_api.h>
  26. #include "xrp_thread_impl.h"
  27. #include "xrp_queue_impl.h"
  28. struct xrp_device_impl {
  29. int fd;
  30. };
  31. struct xrp_buffer_impl {
  32. };
  33. struct xrp_queue_impl {
  34. struct xrp_request_queue queue;
  35. };
  36. void xrp_impl_release_device(struct xrp_device *device);
  37. void xrp_impl_create_device_buffer(struct xrp_device *device,
  38. struct xrp_buffer *buffer,
  39. size_t size,
  40. enum xrp_status *status);
  41. void xrp_impl_release_device_buffer(struct xrp_buffer *buffer);
  42. void xrp_impl_create_queue(struct xrp_queue *queue,
  43. enum xrp_status *status);
  44. void xrp_impl_release_queue(struct xrp_queue *queue);
  45. void xrp_impl_create_report(struct xrp_device *device,
  46. struct xrp_report *report,
  47. size_t size,
  48. enum xrp_status *status);
  49. void xrp_impl_release_report(struct xrp_device *device,
  50. struct xrp_report *report,enum xrp_status *status);
  51. int xrp_impl_add_report_item(struct xrp_report *report,
  52. int (*cb)(void*context,void*data),
  53. void* context,
  54. size_t data_size);
  55. int xrp_impl_add_report_item_with_id(struct xrp_report *report,
  56. int (*cb)(void*context,void*data),
  57. int report_id,
  58. void* context,
  59. size_t data_size);
  60. void xrp_impl_remove_report_item(struct xrp_report *report,int report_id);
  61. void xrp_impl_import_dma_buf(struct xrp_device *device, int fd,enum xrp_access_flags,uint64_t *phy_addr,
  62. uint64_t *user_addr,size_t* size,enum xrp_status *status);
  63. void xrp_impl_release_dma_buf(struct xrp_device *device, int fd,enum xrp_status *status);
  64. #endif