kernels/linux-2.4.0/drivers/acorn/net/etherh.c
/*
 * Read a block of data from the 8390
 */
Read a block of data from the 8390
Read a block of data from the 8390
static void
etherh_block_input (struct net_device *dev, int count, struct sk_buff *skb, int ring_offset)
{
	unsigned int addr, dma_addr;
	unsigned char *buf;
	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;
	buf = skb->data;
	outb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD);
	outb (count, addr + EN0_RCNTLO);
	outb (count >> 8, addr + EN0_RCNTHI);
	outb (ring_offset, addr + EN0_RSARLO);
	outb (ring_offset >> 8, addr + EN0_RSARHI);
	outb (E8390_RREAD | E8390_START, addr + E8390_CMD);
	if (ei_status.word16) {
		insw (dma_addr, buf, count >> 1);
		if (count & 1)
			buf[count - 1] = inb (dma_addr);
	} else
		insb (dma_addr, buf, count);
	outb (ENISR_RDC, addr + EN0_ISR);
	ei_status.dmaing &= ~1;
}
static void etherh_block_input ( struct net_device * dev , int count , struct sk_buff * skb , int ring_offset ) { unsigned int addr , dma_addr ; unsigned char * buf ; 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 ; buf = skb -> data ; outb ( E8390_NODMA | E8390_PAGE0 | E8390_START , addr + E8390_CMD ) ; outb ( count , addr + EN0_RCNTLO ) ; outb ( count >> 8 , addr + EN0_RCNTHI ) ; outb ( ring_offset , addr + EN0_RSARLO ) ; outb ( ring_offset >> 8 , addr + EN0_RSARHI ) ; outb ( E8390_RREAD | E8390_START , addr + E8390_CMD ) ; if ( ei_status . word16 ) { insw ( dma_addr , buf , count >> 1 ) ; if ( count & 1 ) buf [ count - 1 ] = inb ( dma_addr ) ; } else insb ( dma_addr , buf , count ) ; outb ( ENISR_RDC , addr + EN0_ISR ) ; ei_status . dmaing &= ~ 1 ; }
Read a block of data from the 8390
Read a block of data from the 8390