Date: Wed, 12 May 1999 09:55:25 +0200 (CEST)
From: "Christian T. Steigies" <steigies@physik.uni-kiel.de>
X-Sender: cts@ap031.experimentalphysik.uni-kiel.de
To: Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
Subject: apne patch
Return-Receipt-To: steigies@physik.uni-kiel.de

Moin Roman,
ich denke, dies ist der komplette apne patch, der apne und ariadne2
gleichzeitig als Modul funktionieren laesst. Ist jedenfalls der diff
zwischen Jes' source tree und meinem aktuellen. Und damit habe ich das debian
image gebaut.

Ciao,
Christian.

--- v2.0/linux-2.0.36/drivers/net/apne.c	Thu Jan  7 19:52:17 1999
+++ linux-2.0.36/drivers/net/apne.c	Wed Mar 31 22:58:31 1999
@@ -69,21 +69,21 @@
 		const unsigned char *buf, const int start_page);
 
 
-static int ethdev_init(struct device *dev);
+static int apne_ethdev_init(struct device *dev);
 
-#define ei_reset_8390 (ei_local->reset_8390)
-#define ei_block_output (ei_local->block_output)
-#define ei_block_input (ei_local->block_input)
-#define ei_get_8390_hdr (ei_local->get_8390_hdr)
-
-static int ei_open(struct device *dev);
-static int ei_close(struct device *dev);
-static void ei_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-
-static void ei_tx_intr(struct device *dev);
-static void ei_tx_err(struct device *dev);
-static void ei_receive(struct device *dev);
-static void ei_rx_overrun(struct device *dev);
+#define ei_apne_reset_8390 (ei_apne_local->reset_8390)
+#define ei_apne_block_output (ei_apne_local->block_output)
+#define ei_apne_block_input (ei_apne_local->block_input)
+#define ei_apne_get_8390_hdr (ei_apne_local->get_8390_hdr)
+
+static int ei_apne_open(struct device *dev);
+static int ei_apne_close(struct device *dev);
+static void ei_apne_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+
+static void ei_apne_tx_intr(struct device *dev);
+static void ei_apne_tx_err(struct device *dev);
+static void ei_apne_receive(struct device *dev);
+static void ei_apne_rx_overrun(struct device *dev);
 
 static void NS8390_trigger_send(struct device *dev, unsigned int length,
 								int start_page);
@@ -170,7 +170,7 @@
 /*-*************************************************************************-*/
 static int apne_open(struct device *dev)
 {
-    ei_open(dev);
+    ei_apne_open(dev);
     MOD_INC_USE_COUNT;
     return 0;
 }
@@ -179,7 +179,7 @@
 {
     if (apne_debug > 1)
 	printk("%s: Shutting down ethercard.\n", dev->name);
-    ei_close(dev);
+    ei_apne_close(dev);
     MOD_DEC_USE_COUNT;
     return 0;
 }
@@ -191,9 +191,9 @@
 static void apNS8390_init(struct device *dev, int startp)
 {
     int e8390_base = dev->base_addr;
-    struct ei_device *ei_local = (struct ei_device *) dev->priv;
+    struct ei_apne_device *ei_apne_local = (struct ei_apne_device *) dev->priv;
     int i;
-    int endcfg = ei_local->word16 ? (0x48 | ENDCFG_WTS) : 0x48;
+    int endcfg = ei_apne_local->word16 ? (0x48 | ENDCFG_WTS) : 0x48;
     unsigned long flags;
     
     /* Follow National Semi's recommendations for initing the DP83902. */
@@ -206,12 +206,12 @@
     gayle_outb(E8390_RXOFF, e8390_base + EN0_RXCR); /* 0x20 */
     gayle_outb(E8390_TXOFF, e8390_base + EN0_TXCR); /* 0x02 */
     /* Set the transmit page and receive ring. */
-    gayle_outb(ei_local->tx_start_page, e8390_base + EN0_TPSR);
-    ei_local->tx1 = ei_local->tx2 = 0;
-    gayle_outb(ei_local->rx_start_page, e8390_base + EN0_STARTPG);
-    gayle_outb(ei_local->stop_page-1, e8390_base + EN0_BOUNDARY); /* 3c503 says 0x3f,NS0x26*/
-    ei_local->current_page = ei_local->rx_start_page;		/* assert boundary+1 */
-    gayle_outb(ei_local->stop_page, e8390_base + EN0_STOPPG);
+    gayle_outb(ei_apne_local->tx_start_page, e8390_base + EN0_TPSR);
+    ei_apne_local->tx1 = ei_apne_local->tx2 = 0;
+    gayle_outb(ei_apne_local->rx_start_page, e8390_base + EN0_STARTPG);
+    gayle_outb(ei_apne_local->stop_page-1, e8390_base + EN0_BOUNDARY); /* 3c503 says 0x3f,NS0x26*/
+    ei_apne_local->current_page = ei_apne_local->rx_start_page;		/* assert boundary+1 */
+    gayle_outb(ei_apne_local->stop_page, e8390_base + EN0_STOPPG);
     /* Clear the pending interrupts and mask. */
     gayle_outb(0xFF, e8390_base + EN0_ISR);
     gayle_outb(0x00,  e8390_base + EN0_IMR);
@@ -240,13 +240,13 @@
         }
     }
 
-    gayle_outb(ei_local->rx_start_page, e8390_base + EN1_CURPAG);
+    gayle_outb(ei_apne_local->rx_start_page, e8390_base + EN1_CURPAG);
     gayle_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base);
     restore_flags(flags);
     dev->tbusy = 0;
     dev->interrupt = 0;
-    ei_local->tx1 = ei_local->tx2 = 0;
-    ei_local->txing = 0;
+    ei_apne_local->tx1 = ei_apne_local->tx2 = 0;
+    ei_apne_local->txing = 0;
     if (startp) {
 		gayle_outb(0xff, e8390_base + EN0_ISR);
 		gayle_outb(ENISR_ALL, e8390_base + EN0_IMR);
@@ -387,12 +387,12 @@
     dev->base_addr = ioaddr;
 
     /* Install the Interrupt handler */
-    if (request_irq(IRQ_AMIGA_PORTS, ei_interrupt, 0, "apne Ethernet", dev))
+    if (request_irq(IRQ_AMIGA_PORTS, ei_apne_interrupt, 0, "apne Ethernet", dev))
         return -EAGAIN;
 
 
     /* Allocate dev->priv and fill in 8390 specific dev fields. */
-    if (ethdev_init(dev)) {
+    if (apne_ethdev_init(dev)) {
 	printk (" unable to get memory for dev->priv.\n");
 	return -ENOMEM;
     }
@@ -405,17 +405,17 @@
     printk("\n%s: %s found.\n",
 	   dev->name, name);
 
-    ei_status.name = name;
-    ei_status.tx_start_page = start_page;
-    ei_status.stop_page = stop_page;
-    ei_status.word16 = (wordlength == 2);
-
-    ei_status.rx_start_page = start_page + TX_PAGES;
-
-    ei_status.reset_8390 = &apne_reset_8390;
-    ei_status.block_input = &apne_block_input;
-    ei_status.block_output = &apne_block_output;
-    ei_status.get_8390_hdr = &apne_get_8390_hdr;
+    ei_apne_status.name = name;
+    ei_apne_status.tx_start_page = start_page;
+    ei_apne_status.stop_page = stop_page;
+    ei_apne_status.word16 = (wordlength == 2);
+
+    ei_apne_status.rx_start_page = start_page + TX_PAGES;
+
+    ei_apne_status.reset_8390 = &apne_reset_8390;
+    ei_apne_status.block_input = &apne_block_input;
+    ei_apne_status.block_output = &apne_block_output;
+    ei_apne_status.get_8390_hdr = &apne_get_8390_hdr;
     dev->open = &apne_open;
     dev->stop = &apne_close;
     apNS8390_init(dev, 0);
@@ -441,8 +441,8 @@
 
     gayle_outb(gayle_inb(NE_BASE + NE_RESET), NE_BASE + NE_RESET);
 
-    ei_status.txing = 0;
-    ei_status.dmaing = 0;
+    ei_apne_status.txing = 0;
+    ei_apne_status.dmaing = 0;
 
     /* This check _should_not_ be necessary, omit eventually. */
     while ((gayle_inb(NE_BASE+EN0_ISR) & ENISR_RESET) == 0)
@@ -468,15 +468,15 @@
     short *ptrs;
 
     /* This *shouldn't* happen. If it does, it's the last thing you'll see */
-    if (ei_status.dmaing) {
+    if (ei_apne_status.dmaing) {
 	printk("%s: DMAing conflict in ne_get_8390_hdr "
 	   "[DMAstat:%d][irqlock:%d][intr:%d].\n",
-	   dev->name, ei_status.dmaing, ei_status.irqlock,
+	   dev->name, ei_apne_status.dmaing, ei_apne_status.irqlock,
 	   dev->interrupt);
 	return;
     }
 
-    ei_status.dmaing |= 0x01;
+    ei_apne_status.dmaing |= 0x01;
     gayle_outb(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base+ NE_CMD);
     gayle_outb(ENISR_RDC, nic_base + EN0_ISR);
     gayle_outb(sizeof(struct e8390_pkt_hdr), nic_base + EN0_RCNTLO);
@@ -485,7 +485,7 @@
     gayle_outb(ring_page, nic_base + EN0_RSARHI);
     gayle_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);
 
-    if (ei_status.word16) {
+    if (ei_apne_status.word16) {
         ptrs = (short*)hdr;
         for(cnt = 0; cnt < (sizeof(struct e8390_pkt_hdr)>>1); cnt++)
             *ptrs++ = gayle_inw(NE_BASE + NE_DATAPORT);
@@ -499,7 +499,7 @@
 
     hdr->count = WORDSWAP(hdr->count);
 
-    ei_status.dmaing &= ~0x01;
+    ei_apne_status.dmaing &= ~0x01;
 }
 
 /*-*************************************************************************-*/
@@ -518,14 +518,14 @@
     int cnt;
 
     /* This *shouldn't* happen. If it does, it's the last thing you'll see */
-    if (ei_status.dmaing) {
+    if (ei_apne_status.dmaing) {
 	printk("%s: DMAing conflict in ne_block_input "
 	   "[DMAstat:%d][irqlock:%d][intr:%d].\n",
-	   dev->name, ei_status.dmaing, ei_status.irqlock,
+	   dev->name, ei_apne_status.dmaing, ei_apne_status.irqlock,
 	   dev->interrupt);
 	return;
     }
-    ei_status.dmaing |= 0x01;
+    ei_apne_status.dmaing |= 0x01;
     gayle_outb(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base+ NE_CMD);
     gayle_outb(ENISR_RDC, nic_base + EN0_ISR);
     gayle_outb(count & 0xff, nic_base + EN0_RCNTLO);
@@ -533,7 +533,7 @@
     gayle_outb(ring_offset & 0xff, nic_base + EN0_RSARLO);
     gayle_outb(ring_offset >> 8, nic_base + EN0_RSARHI);
     gayle_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);
-    if (ei_status.word16) {
+    if (ei_apne_status.word16) {
       ptrs = (short*)buf;
       for (cnt = 0; cnt < (count>>1); cnt++)
         *ptrs++ = gayle_inw(NE_BASE + NE_DATAPORT);
@@ -547,7 +547,7 @@
     }
 
     gayle_outb(ENISR_RDC, nic_base + EN0_ISR);	/* Ack intr. */
-    ei_status.dmaing &= ~0x01;
+    ei_apne_status.dmaing &= ~0x01;
 }
 
 /*-*************************************************************************-*/
@@ -565,18 +565,18 @@
     /* Round the count up for word writes.  Do we need to do this?
        What effect will an odd byte count have on the 8390?
        I should check someday. */
-    if (ei_status.word16 && (count & 0x01))
+    if (ei_apne_status.word16 && (count & 0x01))
       count++;
 
     /* This *shouldn't* happen. If it does, it's the last thing you'll see */
-    if (ei_status.dmaing) {
+    if (ei_apne_status.dmaing) {
 	printk("%s: DMAing conflict in ne_block_output."
 	   "[DMAstat:%d][irqlock:%d][intr:%d]\n",
-	   dev->name, ei_status.dmaing, ei_status.irqlock,
+	   dev->name, ei_apne_status.dmaing, ei_apne_status.irqlock,
 	   dev->interrupt);
 	return;
     }
-    ei_status.dmaing |= 0x01;
+    ei_apne_status.dmaing |= 0x01;
     /* We should already be in page 0, but to be safe... */
     gayle_outb(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base + NE_CMD);
 
@@ -589,7 +589,7 @@
     gayle_outb(start_page, nic_base + EN0_RSARHI);
 
     gayle_outb(E8390_RWRITE+E8390_START, nic_base + NE_CMD);
-    if (ei_status.word16) {
+    if (ei_apne_status.word16) {
         ptrs = (short*)buf;
         for (cnt = 0; cnt < count>>1; cnt++)
             gayle_outw(*ptrs++, NE_BASE+NE_DATAPORT);
@@ -610,7 +610,7 @@
 	}
 
     gayle_outb(ENISR_RDC, nic_base + EN0_ISR);	/* Ack intr. */
-    ei_status.dmaing &= ~0x01;
+    ei_apne_status.dmaing &= ~0x01;
     return;
 }
 
@@ -619,24 +619,24 @@
    up anew at each open, even though many of these registers should only
    need to be set once at boot.
    */
-static int ei_open(struct device *dev)
+static int ei_apne_open(struct device *dev)
 {
-    struct ei_device *ei_local = (struct ei_device *) dev->priv;
+    struct ei_apne_device *ei_apne_local = (struct ei_apne_device *) dev->priv;
 
-    /* This can't happen unless somebody forgot to call ethdev_init(). */
-    if (ei_local == NULL) {
-	printk(KERN_EMERG "%s: ei_open passed a non-existent device!\n", dev->name);
+    /* This can't happen unless somebody forgot to call apne_ethdev_init(). */
+    if (ei_apne_local == NULL) {
+	printk(KERN_EMERG "%s: ei_apne_open passed a non-existent device!\n", dev->name);
 	return -ENXIO;
     }
 
     apNS8390_init(dev, 1);
     dev->start = 1;
-    ei_local->irqlock = 0;
+    ei_apne_local->irqlock = 0;
     return 0;
 }
 
 /* Opposite of above. Only used when "ifconfig <devname> down" is done. */
-static int ei_close(struct device *dev)
+static int ei_apne_close(struct device *dev)
 {
     apNS8390_init(dev, 0);
     dev->start = 0;
@@ -645,10 +645,10 @@
 
 /*-*************************************************************************-*/
 
-static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
+static int ei_apne_start_xmit(struct sk_buff *skb, struct device *dev)
 {
     int e8390_base = dev->base_addr;
-    struct ei_device *ei_local = (struct ei_device *) dev->priv;
+    struct ei_apne_device *ei_apne_local = (struct ei_apne_device *) dev->priv;
     int length, send_length, output_page;
 
 /*
@@ -679,13 +679,13 @@
 		   dev->name, (txsr & ENTSR_ABT) ? "excess collisions." :
 		   (isr) ? "lost interrupt?" : "cable problem?", txsr, isr, tickssofar);
 
-		if (!isr && !ei_local->stat.tx_packets) {
+		if (!isr && !ei_apne_local->stat.tx_packets) {
 		   /* The 8390 probably hasn't gotten on the cable yet. */
-		   ei_local->interface_num ^= 1;   /* Try a different xcvr.  */
+		   ei_apne_local->interface_num ^= 1;   /* Try a different xcvr.  */
 		}
 
 		/* Try to restart the card.  Perhaps the user has fixed something. */
-		ei_reset_8390(dev);
+		ei_apne_reset_8390(dev);
 		apNS8390_init(dev, 1);
 		dev->trans_start = jiffies;
     }
@@ -711,7 +711,7 @@
 	gayle_outb(ENISR_ALL, e8390_base + EN0_IMR);
 	return 1;
     }
-    ei_local->irqlock = 1;
+    ei_apne_local->irqlock = 1;
 
     send_length = ETH_ZLEN < length ? length : ETH_ZLEN;
 
@@ -725,23 +725,23 @@
      * card, leaving a substantial gap between each transmitted packet.
      */
 
-    if (ei_local->tx1 == 0) {
-	output_page = ei_local->tx_start_page;
-	ei_local->tx1 = send_length;
-	if (apne_debug  &&  ei_local->tx2 > 0)
+    if (ei_apne_local->tx1 == 0) {
+	output_page = ei_apne_local->tx_start_page;
+	ei_apne_local->tx1 = send_length;
+	if (apne_debug  &&  ei_apne_local->tx2 > 0)
 		printk("%s: idle transmitter tx2=%d, lasttx=%d, txing=%d.\n",
-			dev->name, ei_local->tx2, ei_local->lasttx, ei_local->txing);
-    } else if (ei_local->tx2 == 0) {
-	output_page = ei_local->tx_start_page + TX_1X_PAGES;
-	ei_local->tx2 = send_length;
-	if (apne_debug  &&  ei_local->tx1 > 0)
+			dev->name, ei_apne_local->tx2, ei_apne_local->lasttx, ei_apne_local->txing);
+    } else if (ei_apne_local->tx2 == 0) {
+	output_page = ei_apne_local->tx_start_page + TX_1X_PAGES;
+	ei_apne_local->tx2 = send_length;
+	if (apne_debug  &&  ei_apne_local->tx1 > 0)
 		printk("%s: idle transmitter, tx1=%d, lasttx=%d, txing=%d.\n",
-			dev->name, ei_local->tx1, ei_local->lasttx, ei_local->txing);
+			dev->name, ei_apne_local->tx1, ei_apne_local->lasttx, ei_apne_local->txing);
     } else {	/* We should never get here. */
 	if (apne_debug)
 		printk("%s: No Tx buffers free! irq=%d tx1=%d tx2=%d last=%d\n",
-			dev->name, dev->interrupt, ei_local->tx1, ei_local->tx2, ei_local->lasttx);
-	ei_local->irqlock = 0;
+			dev->name, dev->interrupt, ei_apne_local->tx1, ei_apne_local->tx2, ei_apne_local->lasttx);
+	ei_apne_local->irqlock = 0;
 	dev->tbusy = 1;
 	gayle_outb(ENISR_ALL, e8390_base + EN0_IMR);
         /* enable PCMCIA IRQ interrupt */
@@ -755,22 +755,22 @@
      * trigger the send later, upon receiving a Tx done interrupt.
      */
 
-    ei_block_output(dev, length, skb->data, output_page);
-    if (! ei_local->txing) {
-	ei_local->txing = 1;
+    ei_apne_block_output(dev, length, skb->data, output_page);
+    if (! ei_apne_local->txing) {
+	ei_apne_local->txing = 1;
 	NS8390_trigger_send(dev, send_length, output_page);
 	dev->trans_start = jiffies;
-	if (output_page == ei_local->tx_start_page) {
-		ei_local->tx1 = -1;
-		ei_local->lasttx = -1;
+	if (output_page == ei_apne_local->tx_start_page) {
+		ei_apne_local->tx1 = -1;
+		ei_apne_local->lasttx = -1;
 	} else {
-		ei_local->tx2 = -1;
-		ei_local->lasttx = -2;
+		ei_apne_local->tx2 = -1;
+		ei_apne_local->lasttx = -2;
 	}
     } else
-	ei_local->txqueue++;
+	ei_apne_local->txqueue++;
 
-    dev->tbusy = (ei_local->tx1  &&  ei_local->tx2);
+    dev->tbusy = (ei_apne_local->tx1  &&  ei_apne_local->tx2);
 
 #else	/* EI_PINGPONG */
 
@@ -780,16 +780,16 @@
      * reasonable hardware if you only use one Tx buffer.
      */
 
-    ei_block_output(dev, length, skb->data, ei_local->tx_start_page);
-    ei_local->txing = 1;
-    NS8390_trigger_send(dev, send_length, ei_local->tx_start_page);
+    ei_apne_block_output(dev, length, skb->data, ei_apne_local->tx_start_page);
+    ei_apne_local->txing = 1;
+    NS8390_trigger_send(dev, send_length, ei_apne_local->tx_start_page);
     dev->trans_start = jiffies;
     dev->tbusy = 1;
 
 #endif	/* EI_PINGPONG */
 
     /* Turn 8390 interrupts back on. */
-    ei_local->irqlock = 0;
+    ei_apne_local->irqlock = 0;
     gayle_outb(ENISR_ALL, e8390_base + EN0_IMR);
     /* enable PCMCIA IRQ interrupt */
     pcmcia_enable_irq();
@@ -804,17 +804,17 @@
 static struct enet_statistics *get_stats(struct device *dev)
 {
     int ioaddr = dev->base_addr;
-    struct ei_device *ei_local = (struct ei_device *) dev->priv;
+    struct ei_apne_device *ei_apne_local = (struct ei_apne_device *) dev->priv;
     
     /* If the card is stopped, just return the present stats. */
-    if (dev->start == 0) return &ei_local->stat;
+    if (dev->start == 0) return &ei_apne_local->stat;
 
     /* Read the counter registers, assuming we are in page 0. */
-    ei_local->stat.rx_frame_errors += gayle_inb(ioaddr + EN0_COUNTER0);
-    ei_local->stat.rx_crc_errors   += gayle_inb(ioaddr + EN0_COUNTER1);
-    ei_local->stat.rx_missed_errors+= gayle_inb(ioaddr + EN0_COUNTER2);
+    ei_apne_local->stat.rx_frame_errors += gayle_inb(ioaddr + EN0_COUNTER0);
+    ei_apne_local->stat.rx_crc_errors   += gayle_inb(ioaddr + EN0_COUNTER1);
+    ei_apne_local->stat.rx_missed_errors+= gayle_inb(ioaddr + EN0_COUNTER2);
 
-    return &ei_local->stat;
+    return &ei_apne_local->stat;
 }
 
 /*-*************************************************************************-*/
@@ -827,12 +827,12 @@
  * an unnecessary card reset.
  */
 
-static void ei_tx_err(struct device *dev)
+static void ei_apne_tx_err(struct device *dev)
 {
     int e8390_base = dev->base_addr;
     unsigned char txsr = gayle_inb(e8390_base+EN0_TSR);
     unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU);
-    struct ei_device *ei_local = (struct ei_device *) dev->priv;
+    struct ei_apne_device *ei_apne_local = (struct ei_apne_device *) dev->priv;
 
 #ifdef VERBOSE_ERROR_DUMP
     printk(KERN_DEBUG "%s: transmitter error (%#2x): ", dev->name, txsr);
@@ -852,25 +852,25 @@
     gayle_outb(ENISR_TX_ERR, e8390_base + EN0_ISR); /* Ack intr. */
 
     if (tx_was_aborted)
-		ei_tx_intr(dev);
+		ei_apne_tx_intr(dev);
 
     /*
      * Note: NCR reads zero on 16 collisions so we add them
      * in by hand. Somebody might care...
      */
     if (txsr & ENTSR_ABT)
-	ei_local->stat.collisions += 16;
+	ei_apne_local->stat.collisions += 16;
 	
 }
 
 /*-*************************************************************************-*/
 /* We have finished a transmit: check for errors and then trigger the next
    packet to be sent. */
-static void ei_tx_intr(struct device *dev)
+static void ei_apne_tx_intr(struct device *dev)
 {
     int e8390_base = dev->base_addr;
     int status = gayle_inb(e8390_base + EN0_TSR);
-    struct ei_device *ei_local = (struct ei_device *) dev->priv;
+    struct ei_apne_device *ei_apne_local = (struct ei_apne_device *) dev->priv;
     
     gayle_outb(ENISR_TX, e8390_base + EN0_ISR); /* Ack intr. */
 
@@ -880,59 +880,59 @@
      * There are two Tx buffers, see which one finished, and trigger
      * the send of another one if it exists.
      */
-    ei_local->txqueue--;
-    if (ei_local->tx1 < 0) {
-	if (ei_local->lasttx != 1 && ei_local->lasttx != -1)
+    ei_apne_local->txqueue--;
+    if (ei_apne_local->tx1 < 0) {
+	if (ei_apne_local->lasttx != 1 && ei_apne_local->lasttx != -1)
 		printk("%s: bogus last_tx_buffer %d, tx1=%d.\n",
-			   ei_local->name, ei_local->lasttx, ei_local->tx1);
-	ei_local->tx1 = 0;
+			   ei_apne_local->name, ei_apne_local->lasttx, ei_apne_local->tx1);
+	ei_apne_local->tx1 = 0;
 	dev->tbusy = 0;
-	if (ei_local->tx2 > 0) {
-		ei_local->txing = 1;
-		NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6);
+	if (ei_apne_local->tx2 > 0) {
+		ei_apne_local->txing = 1;
+		NS8390_trigger_send(dev, ei_apne_local->tx2, ei_apne_local->tx_start_page + 6);
 		dev->trans_start = jiffies;
-		ei_local->tx2 = -1,
-		ei_local->lasttx = 2;
+		ei_apne_local->tx2 = -1,
+		ei_apne_local->lasttx = 2;
 	} else
-		ei_local->lasttx = 20, ei_local->txing = 0;
-    } else if (ei_local->tx2 < 0) {
-	if (ei_local->lasttx != 2  &&  ei_local->lasttx != -2)
+		ei_apne_local->lasttx = 20, ei_apne_local->txing = 0;
+    } else if (ei_apne_local->tx2 < 0) {
+	if (ei_apne_local->lasttx != 2  &&  ei_apne_local->lasttx != -2)
 		printk("%s: bogus last_tx_buffer %d, tx2=%d.\n",
-			   ei_local->name, ei_local->lasttx, ei_local->tx2);
-	ei_local->tx2 = 0;
+			   ei_apne_local->name, ei_apne_local->lasttx, ei_apne_local->tx2);
+	ei_apne_local->tx2 = 0;
 	dev->tbusy = 0;
-	if (ei_local->tx1 > 0) {
-		ei_local->txing = 1;
-		NS8390_trigger_send(dev, ei_local->tx1, ei_local->tx_start_page);
+	if (ei_apne_local->tx1 > 0) {
+		ei_apne_local->txing = 1;
+		NS8390_trigger_send(dev, ei_apne_local->tx1, ei_apne_local->tx_start_page);
 		dev->trans_start = jiffies;
-		ei_local->tx1 = -1;
-		ei_local->lasttx = 1;
+		ei_apne_local->tx1 = -1;
+		ei_apne_local->lasttx = 1;
 	} else
-		ei_local->lasttx = 10, ei_local->txing = 0;
+		ei_apne_local->lasttx = 10, ei_apne_local->txing = 0;
     } else
 	printk("%s: unexpected TX-done interrupt, lasttx=%d.\n",
-		   dev->name, ei_local->lasttx);
+		   dev->name, ei_apne_local->lasttx);
 
 #else	/* EI_PINGPONG */
     /*
      *  Single Tx buffer: mark it free so another packet can be loaded.
      */
-    ei_local->txing = 0;
+    ei_apne_local->txing = 0;
     dev->tbusy = 0;
 #endif
 
     /* Minimize Tx latency: update the statistics after we restart TXing. */
     if (status & ENTSR_COL)
-	ei_local->stat.collisions++;
+	ei_apne_local->stat.collisions++;
     if (status & ENTSR_PTX)
-	ei_local->stat.tx_packets++;
+	ei_apne_local->stat.tx_packets++;
     else {
-	ei_local->stat.tx_errors++;
-	if (status & ENTSR_ABT) ei_local->stat.tx_aborted_errors++;
-	if (status & ENTSR_CRS) ei_local->stat.tx_carrier_errors++;
-	if (status & ENTSR_FU)  ei_local->stat.tx_fifo_errors++;
-	if (status & ENTSR_CDH) ei_local->stat.tx_heartbeat_errors++;
-	if (status & ENTSR_OWC) ei_local->stat.tx_window_errors++;
+	ei_apne_local->stat.tx_errors++;
+	if (status & ENTSR_ABT) ei_apne_local->stat.tx_aborted_errors++;
+	if (status & ENTSR_CRS) ei_apne_local->stat.tx_carrier_errors++;
+	if (status & ENTSR_FU)  ei_apne_local->stat.tx_fifo_errors++;
+	if (status & ENTSR_CDH) ei_apne_local->stat.tx_heartbeat_errors++;
+	if (status & ENTSR_OWC) ei_apne_local->stat.tx_window_errors++;
     }
 
     mark_bh (NET_BH);
@@ -941,15 +941,15 @@
 /*-*************************************************************************-*/
 /* We have a good packet(s), get it/them out of the buffers. */
 
-static void ei_receive(struct device *dev)
+static void ei_apne_receive(struct device *dev)
 {
     int e8390_base = dev->base_addr;
-    struct ei_device *ei_local = (struct ei_device *) dev->priv;
+    struct ei_apne_device *ei_apne_local = (struct ei_apne_device *) dev->priv;
     unsigned char rxing_page, this_frame, next_frame;
     unsigned short current_offset;
     int rx_pkt_count = 0;
     struct e8390_pkt_hdr rx_frame;
-    int num_rx_pages = ei_local->stop_page-ei_local->rx_start_page;
+    int num_rx_pages = ei_apne_local->stop_page-ei_apne_local->rx_start_page;
 
     while (++rx_pkt_count < 10) {
 		int pkt_len;
@@ -961,20 +961,20 @@
 		
 		/* Remove one frame from the ring.  Boundary is always a page behind. */
 		this_frame = gayle_inb(e8390_base + EN0_BOUNDARY) + 1;
-		if (this_frame >= ei_local->stop_page)
-			this_frame = ei_local->rx_start_page;
+		if (this_frame >= ei_apne_local->stop_page)
+			this_frame = ei_apne_local->rx_start_page;
 		
 		/* Someday we'll omit the previous, iff we never get this message.
 		   (There is at least one clone claimed to have a problem.)  */
-		if (apne_debug > 0  &&  this_frame != ei_local->current_page)
+		if (apne_debug > 0  &&  this_frame != ei_apne_local->current_page)
 			printk("%s: mismatched read page pointers %2x vs %2x.\n",
-				   dev->name, this_frame, ei_local->current_page);
+				   dev->name, this_frame, ei_apne_local->current_page);
 		
 		if (this_frame == rxing_page)	/* Read all the frames? */
 			break;				/* Done for now */
 		
 		current_offset = this_frame << 8;
-		ei_get_8390_hdr(dev, &rx_frame, this_frame);
+		ei_apne_get_8390_hdr(dev, &rx_frame, this_frame);
 		
 		pkt_len = rx_frame.count - sizeof(struct e8390_pkt_hdr);
 		
@@ -987,9 +987,9 @@
 			&& rx_frame.next != next_frame + 1
 			&& rx_frame.next != next_frame - num_rx_pages
 			&& rx_frame.next != next_frame + 1 - num_rx_pages) {
-			ei_local->current_page = rxing_page;
-			gayle_outb(ei_local->current_page-1, e8390_base+EN0_BOUNDARY);
-			ei_local->stat.rx_errors++;
+			ei_apne_local->current_page = rxing_page;
+			gayle_outb(ei_apne_local->current_page-1, e8390_base+EN0_BOUNDARY);
+			ei_apne_local->stat.rx_errors++;
 			continue;
 		}
 
@@ -998,7 +998,7 @@
 				printk("%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n",
 					   dev->name, rx_frame.count, rx_frame.status,
 					   rx_frame.next);
-			ei_local->stat.rx_errors++;
+			ei_apne_local->stat.rx_errors++;
 		} else if ((rx_frame.status & 0x0F) == ENRSR_RXOK) {
 			struct sk_buff *skb;
 			
@@ -1007,16 +1007,16 @@
 				if (apne_debug > 1)
 					printk("%s: Couldn't allocate a sk_buff of size %d.\n",
 						   dev->name, pkt_len);
-				ei_local->stat.rx_dropped++;
+				ei_apne_local->stat.rx_dropped++;
 				break;
 			} else {
 				skb_reserve(skb,2);	/* IP headers on 16 byte boundaries */
 				skb->dev = dev;
 				skb_put(skb, pkt_len);	/* Make room */
-				ei_block_input(dev, pkt_len, skb, current_offset + sizeof(rx_frame));
+				ei_apne_block_input(dev, pkt_len, skb, current_offset + sizeof(rx_frame));
 				skb->protocol=eth_type_trans(skb,dev);
 				netif_rx(skb);
-				ei_local->stat.rx_packets++;
+				ei_apne_local->stat.rx_packets++;
 			}
 		} else {
 			int errs = rx_frame.status;
@@ -1025,17 +1025,17 @@
 					   dev->name, rx_frame.status, rx_frame.next,
 					   rx_frame.count);
 			if (errs & ENRSR_FO)
-				ei_local->stat.rx_fifo_errors++;
+				ei_apne_local->stat.rx_fifo_errors++;
 		}
 		next_frame = rx_frame.next;
 		
 		/* This _should_ never happen: it's here for avoiding bad clones. */
-		if (next_frame >= ei_local->stop_page) {
+		if (next_frame >= ei_apne_local->stop_page) {
 			printk("%s: next frame inconsistency, %#2x\n", dev->name,
 				   next_frame);
-			next_frame = ei_local->rx_start_page;
+			next_frame = ei_apne_local->rx_start_page;
 		}
-		ei_local->current_page = next_frame;
+		ei_apne_local->current_page = next_frame;
 		gayle_outb(next_frame-1, e8390_base+EN0_BOUNDARY);
     }
 
@@ -1053,12 +1053,12 @@
  * This includes causing "the NIC to defer indefinitely when it is stopped
  * on a busy network."  Ugh.
  */
-static void ei_rx_overrun(struct device *dev)
+static void ei_apne_rx_overrun(struct device *dev)
 {
     int e8390_base = dev->base_addr;
     unsigned long wait_start_time;
     unsigned char was_txing, must_resend = 0;
-    struct ei_device *ei_local = (struct ei_device *) dev->priv;
+    struct ei_apne_device *ei_apne_local = (struct ei_apne_device *) dev->priv;
     
     /*
      * Record whether a Tx was in progress and then issue the
@@ -1069,7 +1069,7 @@
     
     if (apne_debug > 1)
 	printk("%s: Receiver overrun.\n", dev->name);
-    ei_local->stat.rx_over_errors++;
+    ei_apne_local->stat.rx_over_errors++;
     
     /* 
      * Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total.
@@ -1106,7 +1106,7 @@
     /*
      * Clear the Rx ring of all the debris, and ack the interrupt.
      */
-    ei_receive(dev);
+    ei_apne_receive(dev);
     gayle_outb(ENISR_OVER, e8390_base+EN0_ISR);
 
     /*
@@ -1144,22 +1144,22 @@
 /*-*************************************************************************-*/
 
 /* Initialize the rest of the 8390 device structure. */
-static int ethdev_init(struct device *dev)
+static int apne_ethdev_init(struct device *dev)
 {
     if (apne_debug > 1)
 		printk(version);
     
     if (dev->priv == NULL) {
-		struct ei_device *ei_local;
+		struct ei_apne_device *ei_apne_local;
 		
-		dev->priv = kmalloc(sizeof(struct ei_device), GFP_KERNEL);
+		dev->priv = kmalloc(sizeof(struct ei_apne_device), GFP_KERNEL);
 		if (dev->priv == NULL)
 			return -ENOMEM;
-		memset(dev->priv, 0, sizeof(struct ei_device));
-		ei_local = (struct ei_device *)dev->priv;
+		memset(dev->priv, 0, sizeof(struct ei_apne_device));
+		ei_apne_local = (struct ei_apne_device *)dev->priv;
     }
     
-    dev->hard_start_xmit = &ei_start_xmit;
+    dev->hard_start_xmit = &ei_apne_start_xmit;
     dev->get_stats	= get_stats;
     dev->set_multicast_list = &set_multicast_list;
 
@@ -1194,12 +1194,12 @@
 /* The typical workload of the driver:
    Handle the ether interface interrupts. */
 
-static void ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+static void ei_apne_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
     struct device *dev;
     int e8390_base;
     int interrupts, nr_serviced = 0;
-    struct ei_device *ei_local;
+    struct ei_apne_device *ei_apne_local;
     unsigned char pcmcia_intreq;
 
     dev = (struct device *) dev_id;
@@ -1222,10 +1222,10 @@
         printk("pcmcia intreq = %x\n", pcmcia_intreq);
 
     e8390_base = dev->base_addr;
-    ei_local = (struct ei_device *) dev->priv;
-    if (dev->interrupt || ei_local->irqlock) {
+    ei_apne_local = (struct ei_apne_device *) dev->priv;
+    if (dev->interrupt || ei_apne_local->irqlock) {
 		/* The "irqlock" check is only for testing. */
-		printk(ei_local->irqlock
+		printk(ei_apne_local->irqlock
 			   ? "%s: Interrupted while interrupts are masked! isr=%#2x imr=%#2x.\n"
 			   : "%s: Reentering the interrupt handler! isr=%#2x imr=%#2x.\n",
 			   dev->name, gayle_inb(e8390_base + EN0_ISR),
@@ -1250,22 +1250,22 @@
 			break;
 		}
 		if (interrupts & ENISR_OVER) {
-			ei_rx_overrun(dev);
+			ei_apne_rx_overrun(dev);
 		} else if (interrupts & (ENISR_RX+ENISR_RX_ERR)) {
 			/* Got a good (?) packet. */
-			ei_receive(dev);
+			ei_apne_receive(dev);
 		}
 		/* Push the next to-transmit packet through. */
 		if (interrupts & ENISR_TX) {
-			ei_tx_intr(dev);
+			ei_apne_tx_intr(dev);
 		} else if (interrupts & ENISR_TX_ERR) {
-			ei_tx_err(dev);
+			ei_apne_tx_err(dev);
 		}
 
 		if (interrupts & ENISR_COUNTERS) {
-			ei_local->stat.rx_frame_errors += gayle_inb(e8390_base + EN0_COUNTER0);
-			ei_local->stat.rx_crc_errors   += gayle_inb(e8390_base + EN0_COUNTER1);
-			ei_local->stat.rx_missed_errors+= gayle_inb(e8390_base + EN0_COUNTER2);
+			ei_apne_local->stat.rx_frame_errors += gayle_inb(e8390_base + EN0_COUNTER0);
+			ei_apne_local->stat.rx_crc_errors   += gayle_inb(e8390_base + EN0_COUNTER1);
+			ei_apne_local->stat.rx_missed_errors+= gayle_inb(e8390_base + EN0_COUNTER2);
 			gayle_outb(ENISR_COUNTERS, e8390_base + EN0_ISR); /* Ack intr. */
 		}
 		
--- v2.0/linux-2.0.36/drivers/net/apne.h	Wed Dec 17 13:08:09 1997
+++ linux-2.0.36/drivers/net/apne.h	Fri Apr  2 13:39:00 1999
@@ -175,7 +175,7 @@
 /* Most of these entries should be in 'struct device' (or most of the
    things in there should be here!) */
 /* You have one of these per-board */
-struct ei_device {
+struct ei_apne_device {
   const char *name;
   void (*reset_8390)(struct device *);
   void (*get_8390_hdr)(struct device *, struct e8390_pkt_hdr *, int);
@@ -205,7 +205,7 @@
 /* The maximum time waited (in jiffies) before assuming a Tx failed. (20ms) */
 #define TX_TIMEOUT (20*HZ/100)
 
-#define ei_status (*(struct ei_device *)(dev->priv))
+#define ei_apne_status (*(struct ei_apne_device *)(dev->priv))
 
 
 #endif

