aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/dma/ioat/dma.c14
-rw-r--r--drivers/dma/ioat/dma.h16
2 files changed, 16 insertions, 14 deletions
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index 648797e83295..16c080786a65 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -38,28 +38,14 @@
38#include "registers.h" 38#include "registers.h"
39#include "hw.h" 39#include "hw.h"
40 40
41#define to_ioat_chan(chan) container_of(chan, struct ioat_dma_chan, common)
42#define to_ioatdma_device(dev) container_of(dev, struct ioatdma_device, common)
43#define to_ioat_desc(lh) container_of(lh, struct ioat_desc_sw, node)
44#define tx_to_ioat_desc(tx) container_of(tx, struct ioat_desc_sw, async_tx)
45
46#define chan_num(ch) ((int)((ch)->reg_base - (ch)->device->reg_base) / 0x80)
47static int ioat_pending_level = 4; 41static int ioat_pending_level = 4;
48module_param(ioat_pending_level, int, 0644); 42module_param(ioat_pending_level, int, 0644);
49MODULE_PARM_DESC(ioat_pending_level, 43MODULE_PARM_DESC(ioat_pending_level,
50 "high-water mark for pushing ioat descriptors (default: 4)"); 44 "high-water mark for pushing ioat descriptors (default: 4)");
51 45
52#define RESET_DELAY msecs_to_jiffies(100)
53#define WATCHDOG_DELAY round_jiffies(msecs_to_jiffies(2000))
54static void ioat_dma_chan_reset_part2(struct work_struct *work); 46static void ioat_dma_chan_reset_part2(struct work_struct *work);
55static void ioat_dma_chan_watchdog(struct work_struct *work); 47static void ioat_dma_chan_watchdog(struct work_struct *work);
56 48
57/*
58 * workaround for IOAT ver.3.0 null descriptor issue
59 * (channel returns error when size is 0)
60 */
61#define NULL_DESC_BUFFER_SIZE 1
62
63/* internal functions */ 49/* internal functions */
64static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan); 50static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan);
65static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan); 51static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan);
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index e80e787fe64f..ccb400f5e279 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -43,6 +43,22 @@ enum ioat_interrupt {
43#define IOAT_DMA_DCA_ANY_CPU ~0 43#define IOAT_DMA_DCA_ANY_CPU ~0
44#define IOAT_WATCHDOG_PERIOD (2 * HZ) 44#define IOAT_WATCHDOG_PERIOD (2 * HZ)
45 45
46#define to_ioat_chan(chan) container_of(chan, struct ioat_dma_chan, common)
47#define to_ioatdma_device(dev) container_of(dev, struct ioatdma_device, common)
48#define to_ioat_desc(lh) container_of(lh, struct ioat_desc_sw, node)
49#define tx_to_ioat_desc(tx) container_of(tx, struct ioat_desc_sw, async_tx)
50
51#define chan_num(ch) ((int)((ch)->reg_base - (ch)->device->reg_base) / 0x80)
52
53#define RESET_DELAY msecs_to_jiffies(100)
54#define WATCHDOG_DELAY round_jiffies(msecs_to_jiffies(2000))
55
56/*
57 * workaround for IOAT ver.3.0 null descriptor issue
58 * (channel returns error when size is 0)
59 */
60#define NULL_DESC_BUFFER_SIZE 1
61
46 62
47/** 63/**
48 * struct ioatdma_device - internal representation of a IOAT device 64 * struct ioatdma_device - internal representation of a IOAT device