diff options
Diffstat (limited to 'include/linux/swiotlb.h')
| -rw-r--r-- | include/linux/swiotlb.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index febedcf67c7e..8c0e349f4a6c 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
| @@ -23,6 +23,29 @@ extern int swiotlb_force; | |||
| 23 | #define IO_TLB_SHIFT 11 | 23 | #define IO_TLB_SHIFT 11 |
| 24 | 24 | ||
| 25 | extern void swiotlb_init(int verbose); | 25 | extern void swiotlb_init(int verbose); |
| 26 | extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Enumeration for sync targets | ||
| 30 | */ | ||
| 31 | enum dma_sync_target { | ||
| 32 | SYNC_FOR_CPU = 0, | ||
| 33 | SYNC_FOR_DEVICE = 1, | ||
| 34 | }; | ||
| 35 | extern void *swiotlb_tbl_map_single(struct device *hwdev, dma_addr_t tbl_dma_addr, | ||
| 36 | phys_addr_t phys, size_t size, | ||
| 37 | enum dma_data_direction dir); | ||
| 38 | |||
| 39 | extern void swiotlb_tbl_unmap_single(struct device *hwdev, char *dma_addr, | ||
| 40 | size_t size, enum dma_data_direction dir); | ||
| 41 | |||
| 42 | extern void swiotlb_tbl_sync_single(struct device *hwdev, char *dma_addr, | ||
| 43 | size_t size, enum dma_data_direction dir, | ||
| 44 | enum dma_sync_target target); | ||
| 45 | |||
| 46 | /* Accessory functions. */ | ||
| 47 | extern void swiotlb_bounce(phys_addr_t phys, char *dma_addr, size_t size, | ||
| 48 | enum dma_data_direction dir); | ||
| 26 | 49 | ||
| 27 | extern void | 50 | extern void |
| 28 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 51 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
| @@ -42,11 +65,11 @@ extern void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, | |||
| 42 | 65 | ||
| 43 | extern int | 66 | extern int |
| 44 | swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, | 67 | swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
| 45 | int direction); | 68 | enum dma_data_direction dir); |
| 46 | 69 | ||
| 47 | extern void | 70 | extern void |
| 48 | swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, | 71 | swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, int nents, |
| 49 | int direction); | 72 | enum dma_data_direction dir); |
| 50 | 73 | ||
| 51 | extern int | 74 | extern int |
| 52 | swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, | 75 | swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, |
| @@ -73,16 +96,6 @@ extern void | |||
| 73 | swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, | 96 | swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, |
| 74 | int nelems, enum dma_data_direction dir); | 97 | int nelems, enum dma_data_direction dir); |
| 75 | 98 | ||
| 76 | extern void | ||
| 77 | swiotlb_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dev_addr, | ||
| 78 | unsigned long offset, size_t size, | ||
| 79 | enum dma_data_direction dir); | ||
| 80 | |||
| 81 | extern void | ||
| 82 | swiotlb_sync_single_range_for_device(struct device *hwdev, dma_addr_t dev_addr, | ||
| 83 | unsigned long offset, size_t size, | ||
| 84 | enum dma_data_direction dir); | ||
| 85 | |||
| 86 | extern int | 99 | extern int |
| 87 | swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); | 100 | swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); |
| 88 | 101 | ||
