aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat/dma.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2010-03-26 19:50:49 -0400
committerDan Williams <dan.j.williams@intel.com>2010-03-26 19:50:49 -0400
commit0793448187643b50af89d36b08470baf45a3cab4 (patch)
treeb3313ff58d47e26a8cf707d196177effa1aadfbe /drivers/dma/ioat/dma.h
parentc3635c78e500a52c9fcd55de381a72928d9e054d (diff)
DMAENGINE: generic channel status v2
Convert the device_is_tx_complete() operation on the DMA engine to a generic device_tx_status()operation which can return three states, DMA_TX_RUNNING, DMA_TX_COMPLETE, DMA_TX_PAUSED. [dan.j.williams@intel.com: update for timberdale] Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Maciej Sosnowski <maciej.sosnowski@intel.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Li Yang <leoli@freescale.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Cc: Magnus Damm <damm@opensource.se> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Joe Perches <joe@perches.com> Cc: Roland Dreier <rdreier@cisco.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/ioat/dma.h')
-rw-r--r--drivers/dma/ioat/dma.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index 86b97ac8774e..23399672239e 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -142,15 +142,14 @@ static inline struct ioat_dma_chan *to_ioat_chan(struct dma_chan *c)
142} 142}
143 143
144/** 144/**
145 * ioat_is_complete - poll the status of an ioat transaction 145 * ioat_tx_status - poll the status of an ioat transaction
146 * @c: channel handle 146 * @c: channel handle
147 * @cookie: transaction identifier 147 * @cookie: transaction identifier
148 * @done: if set, updated with last completed transaction 148 * @txstate: if set, updated with the transaction state
149 * @used: if set, updated with last used transaction
150 */ 149 */
151static inline enum dma_status 150static inline enum dma_status
152ioat_is_complete(struct dma_chan *c, dma_cookie_t cookie, 151ioat_tx_status(struct dma_chan *c, dma_cookie_t cookie,
153 dma_cookie_t *done, dma_cookie_t *used) 152 struct dma_tx_state *txstate)
154{ 153{
155 struct ioat_chan_common *chan = to_chan_common(c); 154 struct ioat_chan_common *chan = to_chan_common(c);
156 dma_cookie_t last_used; 155 dma_cookie_t last_used;
@@ -159,10 +158,11 @@ ioat_is_complete(struct dma_chan *c, dma_cookie_t cookie,
159 last_used = c->cookie; 158 last_used = c->cookie;
160 last_complete = chan->completed_cookie; 159 last_complete = chan->completed_cookie;
161 160
162 if (done) 161 if (txstate) {
163 *done = last_complete; 162 txstate->last = last_complete;
164 if (used) 163 txstate->used = last_used;
165 *used = last_used; 164 txstate->residue = 0;
165 }
166 166
167 return dma_async_is_complete(cookie, last_complete, last_used); 167 return dma_async_is_complete(cookie, last_complete, last_used);
168} 168}
@@ -338,8 +338,8 @@ struct dca_provider * __devinit ioat_dca_init(struct pci_dev *pdev,
338unsigned long ioat_get_current_completion(struct ioat_chan_common *chan); 338unsigned long ioat_get_current_completion(struct ioat_chan_common *chan);
339void ioat_init_channel(struct ioatdma_device *device, 339void ioat_init_channel(struct ioatdma_device *device,
340 struct ioat_chan_common *chan, int idx); 340 struct ioat_chan_common *chan, int idx);
341enum dma_status ioat_is_dma_complete(struct dma_chan *c, dma_cookie_t cookie, 341enum dma_status ioat_dma_tx_status(struct dma_chan *c, dma_cookie_t cookie,
342 dma_cookie_t *done, dma_cookie_t *used); 342 struct dma_tx_state *txstate);
343void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags, 343void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags,
344 size_t len, struct ioat_dma_descriptor *hw); 344 size_t len, struct ioat_dma_descriptor *hw);
345bool ioat_cleanup_preamble(struct ioat_chan_common *chan, 345bool ioat_cleanup_preamble(struct ioat_chan_common *chan,