swiotlb-xen.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef __LINUX_SWIOTLB_XEN_H
  2. #define __LINUX_SWIOTLB_XEN_H
  3. #include <linux/swiotlb.h>
  4. extern void xen_swiotlb_init(int verbose);
  5. extern void
  6. *xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
  7. dma_addr_t *dma_handle, gfp_t flags,
  8. struct dma_attrs *attrs);
  9. extern void
  10. xen_swiotlb_free_coherent(struct device *hwdev, size_t size,
  11. void *vaddr, dma_addr_t dma_handle,
  12. struct dma_attrs *attrs);
  13. extern dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
  14. unsigned long offset, size_t size,
  15. enum dma_data_direction dir,
  16. struct dma_attrs *attrs);
  17. extern void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr,
  18. size_t size, enum dma_data_direction dir,
  19. struct dma_attrs *attrs);
  20. /*
  21. extern int
  22. xen_swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents,
  23. enum dma_data_direction dir);
  24. extern void
  25. xen_swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents,
  26. enum dma_data_direction dir);
  27. */
  28. extern int
  29. xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
  30. int nelems, enum dma_data_direction dir,
  31. struct dma_attrs *attrs);
  32. extern void
  33. xen_swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
  34. int nelems, enum dma_data_direction dir,
  35. struct dma_attrs *attrs);
  36. extern void
  37. xen_swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
  38. size_t size, enum dma_data_direction dir);
  39. extern void
  40. xen_swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
  41. int nelems, enum dma_data_direction dir);
  42. extern void
  43. xen_swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr,
  44. size_t size, enum dma_data_direction dir);
  45. extern void
  46. xen_swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
  47. int nelems, enum dma_data_direction dir);
  48. extern int
  49. xen_swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
  50. extern int
  51. xen_swiotlb_dma_supported(struct device *hwdev, u64 mask);
  52. #endif /* __LINUX_SWIOTLB_XEN_H */