aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dmaengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r--include/linux/dmaengine.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index c73f1e2b59b7..f0413845f20e 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -121,6 +121,7 @@ struct dma_chan_percpu {
121 * @local: per-cpu pointer to a struct dma_chan_percpu 121 * @local: per-cpu pointer to a struct dma_chan_percpu
122 * @client-count: how many clients are using this channel 122 * @client-count: how many clients are using this channel
123 * @table_count: number of appearances in the mem-to-mem allocation table 123 * @table_count: number of appearances in the mem-to-mem allocation table
124 * @private: private data for certain client-channel associations
124 */ 125 */
125struct dma_chan { 126struct dma_chan {
126 struct dma_device *device; 127 struct dma_device *device;
@@ -134,6 +135,7 @@ struct dma_chan {
134 struct dma_chan_percpu *local; 135 struct dma_chan_percpu *local;
135 int client_count; 136 int client_count;
136 int table_count; 137 int table_count;
138 void *private;
137}; 139};
138 140
139/** 141/**
@@ -282,6 +284,18 @@ static inline void dmaengine_put(void)
282} 284}
283#endif 285#endif
284 286
287#ifdef CONFIG_NET_DMA
288#define net_dmaengine_get() dmaengine_get()
289#define net_dmaengine_put() dmaengine_put()
290#else
291static inline void net_dmaengine_get(void)
292{
293}
294static inline void net_dmaengine_put(void)
295{
296}
297#endif
298
285dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan, 299dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
286 void *dest, void *src, size_t len); 300 void *dest, void *src, size_t len);
287dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, 301dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
@@ -297,6 +311,11 @@ static inline void async_tx_ack(struct dma_async_tx_descriptor *tx)
297 tx->flags |= DMA_CTRL_ACK; 311 tx->flags |= DMA_CTRL_ACK;
298} 312}
299 313
314static inline void async_tx_clear_ack(struct dma_async_tx_descriptor *tx)
315{
316 tx->flags &= ~DMA_CTRL_ACK;
317}
318
300static inline bool async_tx_test_ack(struct dma_async_tx_descriptor *tx) 319static inline bool async_tx_test_ack(struct dma_async_tx_descriptor *tx)
301{ 320{
302 return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK; 321 return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK;
@@ -400,11 +419,16 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
400enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); 419enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
401#ifdef CONFIG_DMA_ENGINE 420#ifdef CONFIG_DMA_ENGINE
402enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); 421enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
422void dma_issue_pending_all(void);
403#else 423#else
404static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) 424static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
405{ 425{
406 return DMA_SUCCESS; 426 return DMA_SUCCESS;
407} 427}
428static inline void dma_issue_pending_all(void)
429{
430 do { } while (0);
431}
408#endif 432#endif
409 433
410/* --- DMA device --- */ 434/* --- DMA device --- */
@@ -413,7 +437,6 @@ int dma_async_device_register(struct dma_device *device);
413void dma_async_device_unregister(struct dma_device *device); 437void dma_async_device_unregister(struct dma_device *device);
414void dma_run_dependencies(struct dma_async_tx_descriptor *tx); 438void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
415struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); 439struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
416void dma_issue_pending_all(void);
417#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) 440#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
418struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param); 441struct dma_chan *__dma_request_channel(dma_cap_mask_t *mask, dma_filter_fn fn, void *fn_param);
419void dma_release_channel(struct dma_chan *chan); 442void dma_release_channel(struct dma_chan *chan);