kernels/linux-2.4.0/drivers/block/xd.c
/* xd_setup_dma: set up the DMA controller for a data transfer */
set up the DMA controller for a data transfer
set up the DMA controller for a data transfer
static u_char xd_setup_dma (u_char mode,u_char *buffer,u_int count)
{
	unsigned long f;
	if (nodma)
		return (PIO_MODE);
	if (((unsigned long) buffer & 0xFFFF0000) != (((unsigned long) buffer + count) & 0xFFFF0000)) {
#ifdef DEBUG_OTHER
		printk("xd_setup_dma: using PIO, transfer overlaps 64k boundary\n");
#endif 
		return (PIO_MODE);
	}
	f=claim_dma_lock();
	disable_dma(xd_dma);
	clear_dma_ff(xd_dma);
	set_dma_mode(xd_dma,mode);
	set_dma_addr(xd_dma, (unsigned long) buffer);
	set_dma_count(xd_dma,count);
	release_dma_lock(f);
	return (DMA_MODE);			
}
static u_char xd_setup_dma ( u_char mode , u_char * buffer , u_int count ) { unsigned long f ; if ( nodma ) return ( PIO_MODE ) ; if ( ( ( unsigned long ) buffer & 0xFFFF0000 ) != ( ( ( unsigned long ) buffer + count ) & 0xFFFF0000 ) ) { #ifdef DEBUG_OTHER printk ( " \n " ) ; #endif return ( PIO_MODE ) ; } f = claim_dma_lock ( ) ; disable_dma ( xd_dma ) ; clear_dma_ff ( xd_dma ) ; set_dma_mode ( xd_dma , mode ) ; set_dma_addr ( xd_dma , ( unsigned long ) buffer ) ; set_dma_count ( xd_dma , count ) ; release_dma_lock ( f ) ; return ( DMA_MODE ) ; }
xd_setup_dma: set up the DMA controller for a data transfer
xd_setup_dma : set up the DMA controller for a data transfer
/* DEBUG_OTHER */ /* use DMA and INT */