kernels/linux-2.4.0/drivers/acorn/net/etherh.c
/*
 * Read a header from the 8390
 */
Read a header from the 8390
Read a header from the 8390
static void
etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
{
	unsigned int addr, dma_addr;
	if (ei_status.dmaing) {
		printk ("%s: DMAing conflict in etherh_get_header: "
			" 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;
	outb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD);
	outb (sizeof (*hdr), addr + EN0_RCNTLO);
	outb (0, addr + EN0_RCNTHI);
	outb (0, addr + EN0_RSARLO);
	outb (ring_page, addr + EN0_RSARHI);
	outb (E8390_RREAD | E8390_START, addr + E8390_CMD);
	if (ei_status.word16)
		insw (dma_addr, hdr, sizeof (*hdr) >> 1);
	else
		insb (dma_addr, hdr, sizeof (*hdr));
	outb (ENISR_RDC, addr + EN0_ISR);
	ei_status.dmaing &= ~1;
}
static void etherh_get_header ( struct net_device * dev , struct e8390_pkt_hdr * hdr , int ring_page ) { unsigned int addr , dma_addr ; 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 ; outb ( E8390_NODMA | E8390_PAGE0 | E8390_START , addr + E8390_CMD ) ; outb ( sizeof ( * hdr ) , addr + EN0_RCNTLO ) ; outb ( 0 , addr + EN0_RCNTHI ) ; outb ( 0 , addr + EN0_RSARLO ) ; outb ( ring_page , addr + EN0_RSARHI ) ; outb ( E8390_RREAD | E8390_START , addr + E8390_CMD ) ; if ( ei_status . word16 ) insw ( dma_addr , hdr , sizeof ( * hdr ) >> 1 ) ; else insb ( dma_addr , hdr , sizeof ( * hdr ) ) ; outb ( ENISR_RDC , addr + EN0_ISR ) ; ei_status . dmaing &= ~ 1 ; }
Read a header from the 8390
Read a header from the 8390