diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2010-03-26 19:50:49 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-03-26 19:50:49 -0400 |
commit | 0793448187643b50af89d36b08470baf45a3cab4 (patch) | |
tree | b3313ff58d47e26a8cf707d196177effa1aadfbe /drivers/dma/ioat/dma.h | |
parent | c3635c78e500a52c9fcd55de381a72928d9e054d (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.h | 22 |
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 | */ |
151 | static inline enum dma_status | 150 | static inline enum dma_status |
152 | ioat_is_complete(struct dma_chan *c, dma_cookie_t cookie, | 151 | ioat_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, | |||
338 | unsigned long ioat_get_current_completion(struct ioat_chan_common *chan); | 338 | unsigned long ioat_get_current_completion(struct ioat_chan_common *chan); |
339 | void ioat_init_channel(struct ioatdma_device *device, | 339 | void ioat_init_channel(struct ioatdma_device *device, |
340 | struct ioat_chan_common *chan, int idx); | 340 | struct ioat_chan_common *chan, int idx); |
341 | enum dma_status ioat_is_dma_complete(struct dma_chan *c, dma_cookie_t cookie, | 341 | enum 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); |
343 | void ioat_dma_unmap(struct ioat_chan_common *chan, enum dma_ctrl_flags flags, | 343 | void 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); |
345 | bool ioat_cleanup_preamble(struct ioat_chan_common *chan, | 345 | bool ioat_cleanup_preamble(struct ioat_chan_common *chan, |