aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dmaengine.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-22 11:59:49 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-22 11:59:49 -0500
commit2702e0a46c2d28da92b32c9b068ee1291fc0de35 (patch)
treec1e9868a4b91beeebd5f4e820588bc2ae8371911 /include/linux/dmaengine.h
parent42bb8cc5e81028e217105299001070d57eb84ad7 (diff)
parentadfafefd104d840ee4461965f22624d77532675b (diff)
Merge branch 'linus' into timers/hpet
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r--include/linux/dmaengine.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 64dea2ab326c..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/**
@@ -270,8 +272,30 @@ struct dma_device {
270 272
271/* --- public DMA engine API --- */ 273/* --- public DMA engine API --- */
272 274
275#ifdef CONFIG_DMA_ENGINE
273void dmaengine_get(void); 276void dmaengine_get(void);
274void dmaengine_put(void); 277void dmaengine_put(void);
278#else
279static inline void dmaengine_get(void)
280{
281}
282static inline void dmaengine_put(void)
283{
284}
285#endif
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
275dma_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,
276 void *dest, void *src, size_t len); 300 void *dest, void *src, size_t len);
277dma_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,
@@ -287,6 +311,11 @@ static inline void async_tx_ack(struct dma_async_tx_descriptor *tx)
287 tx->flags |= DMA_CTRL_ACK; 311 tx->flags |= DMA_CTRL_ACK;
288} 312}
289 313
314static inline void async_tx_clear_ack(struct dma_async_tx_descriptor *tx)
315{
316 tx->flags &= ~DMA_CTRL_ACK;
317}
318
290static 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)
291{ 320{
292 return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK; 321 return (tx->flags & DMA_CTRL_ACK) == DMA_CTRL_ACK;
@@ -390,11 +419,16 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
390enum 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);
391#ifdef CONFIG_DMA_ENGINE 420#ifdef CONFIG_DMA_ENGINE
392enum 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);
393#else 423#else
394static 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)
395{ 425{
396 return DMA_SUCCESS; 426 return DMA_SUCCESS;
397} 427}
428static inline void dma_issue_pending_all(void)
429{
430 do { } while (0);
431}
398#endif 432#endif
399 433
400/* --- DMA device --- */ 434/* --- DMA device --- */
@@ -403,7 +437,6 @@ int dma_async_device_register(struct dma_device *device);
403void dma_async_device_unregister(struct dma_device *device); 437void dma_async_device_unregister(struct dma_device *device);
404void dma_run_dependencies(struct dma_async_tx_descriptor *tx); 438void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
405struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); 439struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
406void dma_issue_pending_all(void);
407#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)
408struct 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);
409void dma_release_channel(struct dma_chan *chan); 442void dma_release_channel(struct dma_chan *chan);