aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat/dma.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-09-08 15:00:55 -0400
committerDan Williams <dan.j.williams@intel.com>2009-09-08 20:30:23 -0400
commit6df9183a153291a2585a8dfe67597fc18c201147 (patch)
tree5e5f3b3da9308e20f2dda71c85242460bb7cacfa /drivers/dma/ioat/dma.h
parent38e12f64a165e83617c21dae3c15972fd8d639f5 (diff)
ioat: add some dev_dbg() calls
Provide some output for debugging the driver. Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.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.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index fa15e77652a0..9f9edc2cd079 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -173,6 +173,7 @@ ioat_is_complete(struct dma_chan *c, dma_cookie_t cookie,
173 * or attached to a transaction list (async_tx.tx_list) 173 * or attached to a transaction list (async_tx.tx_list)
174 * @tx_cnt: number of descriptors required to complete the transaction 174 * @tx_cnt: number of descriptors required to complete the transaction
175 * @txd: the generic software descriptor for all engines 175 * @txd: the generic software descriptor for all engines
176 * @id: identifier for debug
176 */ 177 */
177struct ioat_desc_sw { 178struct ioat_desc_sw {
178 struct ioat_dma_descriptor *hw; 179 struct ioat_dma_descriptor *hw;
@@ -180,8 +181,35 @@ struct ioat_desc_sw {
180 int tx_cnt; 181 int tx_cnt;
181 size_t len; 182 size_t len;
182 struct dma_async_tx_descriptor txd; 183 struct dma_async_tx_descriptor txd;
184 #ifdef DEBUG
185 int id;
186 #endif
183}; 187};
184 188
189#ifdef DEBUG
190#define set_desc_id(desc, i) ((desc)->id = (i))
191#define desc_id(desc) ((desc)->id)
192#else
193#define set_desc_id(desc, i)
194#define desc_id(desc) (0)
195#endif
196
197static inline void
198__dump_desc_dbg(struct ioat_chan_common *chan, struct ioat_dma_descriptor *hw,
199 struct dma_async_tx_descriptor *tx, int id)
200{
201 struct device *dev = to_dev(chan);
202
203 dev_dbg(dev, "desc[%d]: (%#llx->%#llx) cookie: %d flags: %#x"
204 " ctl: %#x (op: %d int_en: %d compl: %d)\n", id,
205 (unsigned long long) tx->phys,
206 (unsigned long long) hw->next, tx->cookie, tx->flags,
207 hw->ctl, hw->ctl_f.op, hw->ctl_f.int_en, hw->ctl_f.compl_write);
208}
209
210#define dump_desc_dbg(c, d) \
211 ({ if (d) __dump_desc_dbg(&c->base, d->hw, &d->txd, desc_id(d)); 0; })
212
185static inline void ioat_set_tcp_copy_break(unsigned long copybreak) 213static inline void ioat_set_tcp_copy_break(unsigned long copybreak)
186{ 214{
187 #ifdef CONFIG_NET_DMA 215 #ifdef CONFIG_NET_DMA