aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dmaengine.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-01-06 13:38:14 -0500
committerDan Williams <dan.j.williams@intel.com>2009-01-06 13:38:14 -0500
commitbec085134e446577a983f17f57d642a88d1af53b (patch)
tree7d29afc53fedc72349ee78112fb71f68ff48ce24 /include/linux/dmaengine.h
parent6f49a57aa5a0c6d4e4e27c85f7af6c83325a12d1 (diff)
dmaengine: centralize channel allocation, introduce dma_find_channel
Allowing multiple clients to each define their own channel allocation scheme quickly leads to a pathological situation. For memory-to-memory offload all clients can share a central allocator. This simply moves the existing async_tx allocator to dmaengine with minimal fixups: * async_tx.c:get_chan_ref_by_cap --> dmaengine.c:nth_chan * async_tx.c:async_tx_rebalance --> dmaengine.c:dma_channel_rebalance * split out common code from async_tx.c:__async_tx_find_channel --> dma_find_channel Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r--include/linux/dmaengine.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index d18d37d1015d..b466f02e2433 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -182,6 +182,7 @@ struct dma_chan_percpu {
182 * @device_node: used to add this to the device chan list 182 * @device_node: used to add this to the device chan list
183 * @local: per-cpu pointer to a struct dma_chan_percpu 183 * @local: per-cpu pointer to a struct dma_chan_percpu
184 * @client-count: how many clients are using this channel 184 * @client-count: how many clients are using this channel
185 * @table_count: number of appearances in the mem-to-mem allocation table
185 */ 186 */
186struct dma_chan { 187struct dma_chan {
187 struct dma_device *device; 188 struct dma_device *device;
@@ -198,6 +199,7 @@ struct dma_chan {
198 struct list_head device_node; 199 struct list_head device_node;
199 struct dma_chan_percpu *local; 200 struct dma_chan_percpu *local;
200 int client_count; 201 int client_count;
202 int table_count;
201}; 203};
202 204
203#define to_dma_chan(p) container_of(p, struct dma_chan, dev) 205#define to_dma_chan(p) container_of(p, struct dma_chan, dev)
@@ -468,6 +470,7 @@ static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descript
468int dma_async_device_register(struct dma_device *device); 470int dma_async_device_register(struct dma_device *device);
469void dma_async_device_unregister(struct dma_device *device); 471void dma_async_device_unregister(struct dma_device *device);
470void dma_run_dependencies(struct dma_async_tx_descriptor *tx); 472void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
473struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
471 474
472/* --- Helper iov-locking functions --- */ 475/* --- Helper iov-locking functions --- */
473 476