Lines Matching defs:dmanr

167 static inline void enable_dma(unsigned int dmanr)
169 if (dmanr <= 3)
170 dma_outb(dmanr, DMA1_MASK_REG);
172 dma_outb(dmanr & 3, DMA2_MASK_REG);
175 static inline void disable_dma(unsigned int dmanr)
177 if (dmanr <= 3)
178 dma_outb(dmanr | 4, DMA1_MASK_REG);
180 dma_outb((dmanr & 3) | 4, DMA2_MASK_REG);
190 static inline void clear_dma_ff(unsigned int dmanr)
192 if (dmanr <= 3)
199 static inline void set_dma_mode(unsigned int dmanr, char mode)
201 if (dmanr <= 3)
202 dma_outb(mode | dmanr, DMA1_MODE_REG);
204 dma_outb(mode | (dmanr & 3), DMA2_MODE_REG);
212 static inline void set_dma_page(unsigned int dmanr, char pagenr)
214 switch (dmanr) {
243 static inline void set_dma_addr(unsigned int dmanr, unsigned int a)
245 set_dma_page(dmanr, a>>16);
246 if (dmanr <= 3) {
247 dma_outb(a & 0xff, ((dmanr & 3) << 1) + IO_DMA1_BASE);
248 dma_outb((a >> 8) & 0xff, ((dmanr & 3) << 1) + IO_DMA1_BASE);
250 dma_outb((a >> 1) & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE);
251 dma_outb((a >> 9) & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE);
264 static inline void set_dma_count(unsigned int dmanr, unsigned int count)
267 if (dmanr <= 3) {
268 dma_outb(count & 0xff, ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE);
270 ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE);
273 ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE);
275 ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE);
288 static inline int get_dma_residue(unsigned int dmanr)
294 io_port = (dmanr <= 3) ? ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE
295 : ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE;
300 return (dmanr <= 3) ? count : (count << 1);
306 extern int request_dma(unsigned int dmanr, const char *device_id);
307 extern void free_dma(unsigned int dmanr);