diff options
Diffstat (limited to 'drivers/usb/mon/mon_dma.c')
-rw-r--r-- | drivers/usb/mon/mon_dma.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/drivers/usb/mon/mon_dma.c b/drivers/usb/mon/mon_dma.c index ddcfc01e77a0..140cc80bd2b1 100644 --- a/drivers/usb/mon/mon_dma.c +++ b/drivers/usb/mon/mon_dma.c | |||
@@ -48,6 +48,36 @@ char mon_dmapeek(unsigned char *dst, dma_addr_t dma_addr, int len) | |||
48 | local_irq_restore(flags); | 48 | local_irq_restore(flags); |
49 | return 0; | 49 | return 0; |
50 | } | 50 | } |
51 | |||
52 | void mon_dmapeek_vec(const struct mon_reader_bin *rp, | ||
53 | unsigned int offset, dma_addr_t dma_addr, unsigned int length) | ||
54 | { | ||
55 | unsigned long flags; | ||
56 | unsigned int step_len; | ||
57 | struct page *pg; | ||
58 | unsigned char *map; | ||
59 | unsigned long page_off, page_len; | ||
60 | |||
61 | local_irq_save(flags); | ||
62 | while (length) { | ||
63 | /* compute number of bytes we are going to copy in this page */ | ||
64 | step_len = length; | ||
65 | page_off = dma_addr & (PAGE_SIZE-1); | ||
66 | page_len = PAGE_SIZE - page_off; | ||
67 | if (page_len < step_len) | ||
68 | step_len = page_len; | ||
69 | |||
70 | /* copy data and advance pointers */ | ||
71 | pg = phys_to_page(dma_addr); | ||
72 | map = kmap_atomic(pg, KM_IRQ0); | ||
73 | offset = mon_copy_to_buff(rp, offset, map + page_off, step_len); | ||
74 | kunmap_atomic(map, KM_IRQ0); | ||
75 | dma_addr += step_len; | ||
76 | length -= step_len; | ||
77 | } | ||
78 | local_irq_restore(flags); | ||
79 | } | ||
80 | |||
51 | #endif /* __i386__ */ | 81 | #endif /* __i386__ */ |
52 | 82 | ||
53 | #ifndef MON_HAS_UNMAP | 83 | #ifndef MON_HAS_UNMAP |
@@ -55,4 +85,11 @@ char mon_dmapeek(unsigned char *dst, dma_addr_t dma_addr, int len) | |||
55 | { | 85 | { |
56 | return 'D'; | 86 | return 'D'; |
57 | } | 87 | } |
58 | #endif | 88 | |
89 | void mon_dmapeek_vec(const struct mon_reader_bin *rp, | ||
90 | unsigned int offset, dma_addr_t dma_addr, unsigned int length) | ||
91 | { | ||
92 | ; | ||
93 | } | ||
94 | |||
95 | #endif /* MON_HAS_UNMAP */ | ||