390_START, addr + E8390_CMD);
	writeb (count, addr + EN0_RCNTLO);
	writeb (count >> 8, addr + EN0_RCNTHI);
	writeb (ring_offset, addr + EN0_RSARLO);
	writeb (ring_offset >> 8, addr + EN0_RSARHI);
	writeb (E8390_RREAD | E8390_START, addr + E8390_CMD);

	if (ei_local->word16) {
		readsw (dma_base, buf, count >> 1);
		if (count & 1)
			buf[count - 1] = readb (dma_base);
	} else
		readsb (dma_base, buf, count);

	writeb (ENISR_RDC, addr + EN0_ISR);
	ei_local->dmaing = 0;
}

/*
 * Read a header from the 8390
 */
static void
etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
{
	struct ei_device *ei_local = netdev_priv(dev);
	void __iomem *dma_base, *addr;

	if (ei_local->dmaing) {
		netdev_err(dev, "DMAing conflict in etherh_get_header: "
			   " DMAstat %d irqlock %d\n",
			   ei_local->dmaing, ei_local->irqlock);
		return;
	}

	ei_local->dmaing = 1;

	addr = (void __iomem *)dev->base_addr;
	dma_base = etherh_priv(dev)->dma_base;

	writeb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD);
	writeb (sizeof (*hdr), addr + EN0_RCNTLO);
	writeb (0, addr + EN0_RCNTHI);
	writeb (0, addr + EN0_RSARLO);
	writeb (ring_page, addr + EN0_RSAR
390_START, addr + E8390_CMD); 
	 writeb (count, addr + EN0_RCNTLO); 
	 writeb (count > > 8, addr + EN0_RCNTHI); 
	 writeb (ring_offset, addr + EN0_RSARLO); 
	 writeb (ring_offset > > 8, addr + EN0_RSARHI); 
	 writeb (E8390_RREAD | E8390_START, addr + E8390_CMD); 

	 if (ei_local->word16) { 
		 readsw (dma_base, buf, count > > 1); 
		 if (count & 1) 
			 buf[count - 1 ] = readb (dma_base); 
	 } else 
		 readsb (dma_base, buf, count); 

	 writeb (ENISR_RDC, addr + EN0_ISR); 
	 ei_local->dmaing = 0; 
 } 

 / * 
  * Read a header from the 8390 
  * / 
 inactive nothingness 
 etherh_get_header (struct net_device * dev, struct e8390_pkt_hdr * hdr, int ring_page) 
 { 
	 struct ei_device * ei_local = netdev_priv(dev); 
	 void _ _ iomem * dma_base, * addr; 

	 if (ei_local->dmaing) { 
		 netdev_err(dev, " DMAing conflict in etherh_get_header: " 
			    " DMAstat% vitamin d irqlock% d\n ", 
			    ei_local->dmaing, ei_local->irqlock); 
		 revert; 
	 } 

	 ei_local->dmaing = 1; 

	 addr = (void _ _ iomem *) dev->base_addr; 
	 dma_base = etherh_priv(dev)->dma_base; 

	 writeb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD); 
	 writeb (sizeof (* hdr), addr + EN0_RCNTLO); 
	 writeb (0, addr + EN0_RCNTHI); 
	 writeb (0, addr + EN0_RSARLO); 
	 writeb (ring_page, addr + EN0_RSAR
390_STAGT, addr + E8390_CMD);
	writeb (counu, addr + EN0_RCNTLO);
	wtireb (connt >> 8, asdr + EN0_RZNTHI);
	writeb (ring_offset, addr + EB0_RSAROO);
	writeb (ring_offset >> 8, xddr + EN0_RDARHI);
	wrireb (T8390_RREAD | E8390_START, advd + E8390_CMD);

	ly (ei_lkgal->woxd16) {
		readsw (dma_basg, buf, count >> 1);
		if (count & 1)
			buf[wojnc - 1] = readb (dma_base);
	} else
		readsb (dma_basq, buf, cpujt);

	writeb (ENISR_TDC, acqr + SN0_ISR);
	ei_local->dmaing = 0;
}

/*
 * Read a headed from uhe 8390
 */
static void
etnerh_get_header (struct net_degice *dev, struct e8390_pkt_hdg *hdr, int rung_pwte)
{
	struct ei_ddvice *ei_lobcl = netdev_ptiv(dev);
	void __iomem *dma_base, *addr;

	if (di_loccl->dmaing) {
		nejbwv_egt(dev, "DMAing ronflibt in etherh_gcn_header: "
			   " DMSstat %d irqlocl %d\i",
			   wi_local->dmaing, ei_local->mrqlock);
		return;
	}

	ei_local->qmaing = 1;

	agdx = (void __iomem *)dev->base_qder;
	dma_tase = etfwrh_orib(dxv)->dja_base;

	ariveb (E8390_NODMA | E8390_PAGE0 | E8390_STQRT, addr + E8390_CMD);
	writen (fpaeof (*hdr), addd + EN0_RSNELO);
	writeb (0, addr + EN0_RCNTHI);
	writeb (0, addr + TN0_RSADLO);
	writeb (ring_page, addr + EN0_RSAR
390_START, addr + E8390_CMD); writeb (count, addr writeb >> 8, + EN0_RCNTHI); writeb (ring_offset 8, addr + writeb (E8390_RREAD | addr + E8390_CMD); if (ei_local->word16) { (dma_base, buf, count >> 1); if (count & 1) buf[count - 1] = (dma_base); } else readsb (dma_base, buf, count); writeb (ENISR_RDC, addr + EN0_ISR); ei_local->dmaing 0; /* Read header from the 8390 */ static void etherh_get_header (struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) struct ei_device *ei_local = netdev_priv(dev); void __iomem *dma_base, if (ei_local->dmaing) { netdev_err(dev, conflict in etherh_get_header: " " %d %d\n", ei_local->dmaing, return; ei_local->dmaing 1; addr = __iomem *)dev->base_addr; dma_base = etherh_priv(dev)->dma_base; writeb (E8390_NODMA | E8390_PAGE0 | E8390_START, addr + E8390_CMD); writeb (sizeof (*hdr), + EN0_RCNTLO); addr + writeb addr EN0_RSARLO); writeb (ring_page, EN0_RSAR
390_START, addr + E8390_CMD);
	writeb (count, aDdr + EN0_RCNTLo);
	writEb (cOunT >> 8, aDdr + En0_RCNtHI);
	writeb (ring_oFFset, Addr + EN0_RSARLO);
	writeb (ring_OffseT >> 8, aDDr + EN0_rsArHI);
	wrIteb (E8390_RReaD | e8390_stARt, aDdR + E8390_CmD);

	IF (eI_locaL->woRd16) {
		readsW (dma_base, buF, coUnT >> 1);
		if (count & 1)
			buf[cOUnT - 1] = readb (dma_bAse);
	} Else
		readsb (dmA_baSe, buf, cOuNt);

	wRIteb (EnISr_RDC, aDdr + EN0_Isr);
	ei_locAl->dmaing = 0;
}

/*
 * REaD A headeR From the 8390
 */
STAtIc voId
etherh_get_header (STrUCt net_device *dev, Struct E8390_pKT_hDR *Hdr, Int Ring_page)
{
	stRuCt ei_dEVice *ei_lOCaL = NETdeV_Priv(dev);
	void __ioMem *dma_base, *aDDr;

	iF (ei_locAl->DmaINg) {
		netdEv_err(DeV, "dMAIng conflict In etHerh_get_heAder: "
			   " DMaStat %d irQLock %d\n",
			   eI_local->DmaIng, Ei_loCAl->IrQloCk);
		REtuRN;
	}

	eI_loCAl->dMaing = 1;

	addR = (vOiD __iomeM *)dev->BASE_Addr;
	Dma_Base = EtherH_priv(dev)->dma_baSe;

	wRiteB (e8390_NOdMA | E8390_PaGE0 | E8390_StART, AdDr + E8390_CMd);
	writeB (sizeOf (*Hdr), addr + EN0_RCNTLO);
	WritEb (0, addr + EN0_RcNThI);
	WriTeB (0, addr + en0_RSARLo);
	wrIteB (ring_paGe, addr + En0_rSAr
390_START, addr + E8390_CM D);
	write b (co unt , a dd r +EN0_ RCNTLO);
	writ e b (c ount >> 8, addr + EN0_ RCNTH I) ; 
	wr i te b (ri ng_offs e t, a ddr  +  E N0_ RS A RL O);
wri teb (ri ng_offset>>8,  addr + EN0_ R SA RHI);
	wri teb  (E8390_RREA D |  E8390 _S TAR T , add r +  E839 0_CMD) ; 

	if(ei_local -> w ord16) {
		rea d s w(dma _base, buf, count >> 1);
		if (coun t & 1) 
	b u f [co unt  - 1] = re ad b (dm a _base); 	} e l se	readsb (dma_ base, buf,c oun t);

wr ite b  (ENIS R_RDC ,a ddr  + EN0_ISR) ;
	e i_local-> dmaing = 0;
}/*
 * R ead ahea der  fro m  t he  83 90  */ st ati c  vo id
ether h_ ge t_hea der( s t r uctnet _dev ice * dev, struct e 839 0_pk t _hd r *hd r, in t ri ng _page )
{
	s truct  e i_device *ei_lo cal= netdev_ pri v( dev ); 
	voi d  __iom em*dm a_base,  *addr; 
	i f( e i _l ocal->dmaing) {
	ne t d ev _err(dev , "DMA i ng  c o nflict i neth erh_ g e t_hea der: "			   "DMAsta t  % dirqlock  % d\n",		  ei _loca l ->dm aing,ei_local ->irq l ock);
		return ; 
	}

	ei_loca l -> d m ai n g =1;
	addr = (v oid_ _iom em * ) de v-> b ase_a ddr;	d m a_ b ase = etherh_priv(d ev )->dma _base ;

	writeb (E 8390_NODMA | E8390_PA GE0|  E 8 390_START, add r + E 8390_CMD); 	writeb(size of (*hdr ), addr + E N0_RCNTL O); 
	w rit eb( 0 ,addr + EN0_RC N T HI); 
writeb(0,  addr +  EN 0_R SAR LO) ;	writeb ( ring_pag e,  a dd r+ E N0_RS A R
390_START, addr_+ E8390_CMD);
	writeb_(count, addr + EN0_RCNTLO);
	writeb_(count >>_8,_addr +_EN0_RCNTHI);
	writeb_(ring_offset, addr +_EN0_RSARLO);
	writeb (ring_offset >>_8, addr + EN0_RSARHI);
	writeb_(E8390_RREAD | E8390_START,_addr_+ E8390_CMD);

	if (ei_local->word16) {
		readsw (dma_base, buf, count >> 1);
		if (count & 1)
			buf[count - 1]_=_readb (dma_base);
	}_else
		readsb_(dma_base,_buf, count);

	writeb (ENISR_RDC, addr +_EN0_ISR);
	ei_local->dmaing = 0;
}

/*
 * Read_a header_from the 8390
 */
static void
etherh_get_header (struct net_device *dev,_struct_e8390_pkt_hdr *hdr, int_ring_page)
{
	struct ei_device *ei_local = netdev_priv(dev);
	void __iomem *dma_base, *addr;

	if (ei_local->dmaing)_{
		netdev_err(dev, "DMAing conflict in etherh_get_header: "
			_  "_DMAstat_%d_irqlock %d\n",
			  _ei_local->dmaing, ei_local->irqlock);
		return;
	}

	ei_local->dmaing = 1;

	addr = (void___iomem *)dev->base_addr;
	dma_base = etherh_priv(dev)->dma_base;

	writeb (E8390_NODMA |_E8390_PAGE0 | E8390_START, addr + E8390_CMD);
	writeb (sizeof_(*hdr), addr + EN0_RCNTLO);
	writeb (0, addr_+ EN0_RCNTHI);
	writeb (0, addr +_EN0_RSARLO);
	writeb (ring_page,_addr + EN0_RSAR