kernels/linux-2.4.0/drivers/acorn/net/etherh.c
/*
 * Write a block of data out to the 8390
 */
Write a block of data out to the 8390
Write a block of data out to the 8390
static void
etherh_block_output (struct net_device *dev, int count, const unsigned char *buf, int start_page)
{
	unsigned int addr, dma_addr;
	unsigned long dma_start;
	if (ei_status.dmaing) {
		printk ("%s: DMAing conflict in etherh_block_input: "
			" DMAstat %d irqlock %d\n", dev->name,
			ei_status.dmaing, ei_status.irqlock);
		return;
	}
	ei_status.dmaing |= 1;
	addr = dev->base_addr;
	dma_addr = dev->mem_start;
	count = (count + 1) & ~1;
	outb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD);
	outb (0x42, addr + EN0_RCNTLO);
	outb (0x00, addr + EN0_RCNTHI);
	outb (0x42, addr + EN0_RSARLO);
	outb (0x00, addr + EN0_RSARHI);
	outb (E8390_RREAD | E8390_START, addr + E8390_CMD);
	udelay (1);
	outb (ENISR_RDC, addr + EN0_ISR);
	outb (count, addr + EN0_RCNTLO);
	outb (count >> 8, addr + EN0_RCNTHI);
	outb (0, addr + EN0_RSARLO);
	outb (start_page, addr + EN0_RSARHI);
	outb (E8390_RWRITE | E8390_START, addr + E8390_CMD);
	if (ei_status.word16)
		outsw (dma_addr, buf, count >> 1);
	else
		outsb (dma_addr, buf, count);
	dma_start = jiffies;
	while ((inb (addr + EN0_ISR) & ENISR_RDC) == 0)
		if (jiffies - dma_start > 2*HZ/100) { 
			printk ("%s: timeout waiting for TX RDC\n", dev->name);
			etherh_reset (dev);
			NS8390_init (dev, 1);
			break;
		}
	outb (ENISR_RDC, addr + EN0_ISR);
	ei_status.dmaing &= ~1;
}
static void etherh_block_output ( struct net_device * dev , int count , const unsigned char * buf , int start_page ) { unsigned int addr , dma_addr ; unsigned long dma_start ; if ( ei_status . dmaing ) { printk ( " " " \n " , dev -> name , ei_status . dmaing , ei_status . irqlock ) ; return ; } ei_status . dmaing |= 1 ; addr = dev -> base_addr ; dma_addr = dev -> mem_start ; count = ( count + 1 ) & ~ 1 ; outb ( E8390_NODMA | E8390_PAGE0 | E8390_START , addr + E8390_CMD ) ; outb ( 0x42 , addr + EN0_RCNTLO ) ; outb ( 0x00 , addr + EN0_RCNTHI ) ; outb ( 0x42 , addr + EN0_RSARLO ) ; outb ( 0x00 , addr + EN0_RSARHI ) ; outb ( E8390_RREAD | E8390_START , addr + E8390_CMD ) ; udelay ( 1 ) ; outb ( ENISR_RDC , addr + EN0_ISR ) ; outb ( count , addr + EN0_RCNTLO ) ; outb ( count >> 8 , addr + EN0_RCNTHI ) ; outb ( 0 , addr + EN0_RSARLO ) ; outb ( start_page , addr + EN0_RSARHI ) ; outb ( E8390_RWRITE | E8390_START , addr + E8390_CMD ) ; if ( ei_status . word16 ) outsw ( dma_addr , buf , count >> 1 ) ; else outsb ( dma_addr , buf , count ) ; dma_start = jiffies ; while ( ( inb ( addr + EN0_ISR ) & ENISR_RDC ) == 0 ) if ( jiffies - dma_start > 2 * HZ / 100 ) { printk ( " \n " , dev -> name ) ; etherh_reset ( dev ) ; NS8390_init ( dev , 1 ) ; break ; } outb ( ENISR_RDC , addr + EN0_ISR ) ; ei_status . dmaing &= ~ 1 ; }
Write a block of data out to the 8390
Write a block of data out to the 8390
/* 20ms */