diff options
Diffstat (limited to 'include/linux/dmaengine.h')
| -rw-r--r-- | include/linux/dmaengine.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 1956c8d46d32..ffefba81c818 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -23,9 +23,6 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
| 25 | #include <linux/uio.h> | 25 | #include <linux/uio.h> |
| 26 | #include <linux/kref.h> | ||
| 27 | #include <linux/completion.h> | ||
| 28 | #include <linux/rcupdate.h> | ||
| 29 | #include <linux/dma-mapping.h> | 26 | #include <linux/dma-mapping.h> |
| 30 | 27 | ||
| 31 | /** | 28 | /** |
| @@ -81,12 +78,18 @@ enum dma_transaction_type { | |||
| 81 | * dependency chains | 78 | * dependency chains |
| 82 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | 79 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) |
| 83 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) | 80 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) |
| 81 | * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single | ||
| 82 | * (if not set, do the source dma-unmapping as page) | ||
| 83 | * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single | ||
| 84 | * (if not set, do the destination dma-unmapping as page) | ||
| 84 | */ | 85 | */ |
| 85 | enum dma_ctrl_flags { | 86 | enum dma_ctrl_flags { |
| 86 | DMA_PREP_INTERRUPT = (1 << 0), | 87 | DMA_PREP_INTERRUPT = (1 << 0), |
| 87 | DMA_CTRL_ACK = (1 << 1), | 88 | DMA_CTRL_ACK = (1 << 1), |
| 88 | DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), | 89 | DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), |
| 89 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), | 90 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), |
| 91 | DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), | ||
| 92 | DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), | ||
| 90 | }; | 93 | }; |
| 91 | 94 | ||
| 92 | /** | 95 | /** |
| @@ -205,6 +208,7 @@ struct dma_async_tx_descriptor { | |||
| 205 | /** | 208 | /** |
| 206 | * struct dma_device - info on the entity supplying DMA services | 209 | * struct dma_device - info on the entity supplying DMA services |
| 207 | * @chancnt: how many DMA channels are supported | 210 | * @chancnt: how many DMA channels are supported |
| 211 | * @privatecnt: how many DMA channels are requested by dma_request_channel | ||
| 208 | * @channels: the list of struct dma_chan | 212 | * @channels: the list of struct dma_chan |
| 209 | * @global_node: list_head for global dma_device_list | 213 | * @global_node: list_head for global dma_device_list |
| 210 | * @cap_mask: one or more dma_capability flags | 214 | * @cap_mask: one or more dma_capability flags |
| @@ -227,6 +231,7 @@ struct dma_async_tx_descriptor { | |||
| 227 | struct dma_device { | 231 | struct dma_device { |
| 228 | 232 | ||
| 229 | unsigned int chancnt; | 233 | unsigned int chancnt; |
| 234 | unsigned int privatecnt; | ||
| 230 | struct list_head channels; | 235 | struct list_head channels; |
| 231 | struct list_head global_node; | 236 | struct list_head global_node; |
| 232 | dma_cap_mask_t cap_mask; | 237 | dma_cap_mask_t cap_mask; |
| @@ -291,6 +296,24 @@ static inline void net_dmaengine_put(void) | |||
| 291 | } | 296 | } |
| 292 | #endif | 297 | #endif |
| 293 | 298 | ||
| 299 | #ifdef CONFIG_ASYNC_TX_DMA | ||
| 300 | #define async_dmaengine_get() dmaengine_get() | ||
| 301 | #define async_dmaengine_put() dmaengine_put() | ||
| 302 | #define async_dma_find_channel(type) dma_find_channel(type) | ||
| 303 | #else | ||
| 304 | static inline void async_dmaengine_get(void) | ||
| 305 | { | ||
| 306 | } | ||
| 307 | static inline void async_dmaengine_put(void) | ||
| 308 | { | ||
| 309 | } | ||
| 310 | static inline struct dma_chan * | ||
| 311 | async_dma_find_channel(enum dma_transaction_type type) | ||
| 312 | { | ||
| 313 | return NULL; | ||
| 314 | } | ||
| 315 | #endif | ||
| 316 | |||
| 294 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, | 317 | dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, |
| 295 | void *dest, void *src, size_t len); | 318 | void *dest, void *src, size_t len); |
| 296 | dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, | 319 | dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, |
| @@ -337,6 +360,13 @@ __dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) | |||
| 337 | set_bit(tx_type, dstp->bits); | 360 | set_bit(tx_type, dstp->bits); |
| 338 | } | 361 | } |
| 339 | 362 | ||
| 363 | #define dma_cap_clear(tx, mask) __dma_cap_clear((tx), &(mask)) | ||
| 364 | static inline void | ||
| 365 | __dma_cap_clear(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp) | ||
| 366 | { | ||
| 367 | clear_bit(tx_type, dstp->bits); | ||
| 368 | } | ||
| 369 | |||
| 340 | #define dma_cap_zero(mask) __dma_cap_zero(&(mask)) | 370 | #define dma_cap_zero(mask) __dma_cap_zero(&(mask)) |
| 341 | static inline void __dma_cap_zero(dma_cap_mask_t *dstp) | 371 | static inline void __dma_cap_zero(dma_cap_mask_t *dstp) |
| 342 | { | 372 | { |
