]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/3c501.c
ide: remove unused macros from <asm-parisc/ide.h>
[linux-2.6-omap-h63xx.git] / drivers / net / 3c501.c
index 98e0bc4628a21de35362329a3d2052130e068d80..7d15e7c6bcad51f65860ff6b42e09881e8e2064a 100644 (file)
@@ -17,7 +17,7 @@
        Annapolis MD 21403
 
     Fixed (again!) the missing interrupt locking on TX/RX shifting.
        Annapolis MD 21403
 
     Fixed (again!) the missing interrupt locking on TX/RX shifting.
-               Alan Cox <Alan.Cox@linux.org>
+       Alan Cox <alan@lxorguk.ukuu.org.uk>
 
     Removed calls to init_etherdev since they are no longer needed, and
     cleaned up modularization just a bit. The driver still allows only
 
     Removed calls to init_etherdev since they are no longer needed, and
     cleaned up modularization just a bit. The driver still allows only
     the board. Now getting 150K/second FTP with a 3c501 card. Still playing
     with a TX-TX optimisation to see if we can touch 180-200K/second as seems
     theoretically maximum.
     the board. Now getting 150K/second FTP with a 3c501 card. Still playing
     with a TX-TX optimisation to see if we can touch 180-200K/second as seems
     theoretically maximum.
-               19950402 Alan Cox <Alan.Cox@linux.org>
+               19950402 Alan Cox <alan@lxorguk.ukuu.org.uk>
 
     Cleaned up for 2.3.x because we broke SMP now.
 
     Cleaned up for 2.3.x because we broke SMP now.
-               20000208 Alan Cox <alan@redhat.com>
+               20000208 Alan Cox <alan@lxorguk.ukuu.org.uk>
 
     Check up pass for 2.5. Nothing significant changed
 
     Check up pass for 2.5. Nothing significant changed
-               20021009 Alan Cox <alan@redhat.com>
+               20021009 Alan Cox <alan@lxorguk.ukuu.org.uk>
 
     Fixed zero fill corner case
 
     Fixed zero fill corner case
-               20030104 Alan Cox <alan@redhat.com>
+               20030104 Alan Cox <alan@lxorguk.ukuu.org.uk>
 
 
    For the avoidance of doubt the "preferred form" of this code is one which
 
 
    For the avoidance of doubt the "preferred form" of this code is one which
 
 
 static const char version[] =
 
 
 static const char version[] =
-       DRV_NAME ".c: " DRV_VERSION " Alan Cox (alan@redhat.com).\n";
+       DRV_NAME ".c: " DRV_VERSION " Alan Cox (alan@lxorguk.ukuu.org.uk).\n";
 
 /*
  *     Braindamage remaining:
 
 /*
  *     Braindamage remaining:
@@ -139,8 +139,8 @@ static const char version[] =
  *     The boilerplate probe code.
  */
 
  *     The boilerplate probe code.
  */
 
-static int io=0x280;
-static int irq=5;
+static int io = 0x280;
+static int irq = 5;
 static int mem_start;
 
 /**
 static int mem_start;
 
 /**
@@ -229,8 +229,7 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
         *      Read the station address PROM data from the special port.
         */
 
         *      Read the station address PROM data from the special port.
         */
 
-       for (i = 0; i < 6; i++)
-       {
+       for (i = 0; i < 6; i++) {
                outw(i, ioaddr + EL1_DATAPTR);
                station_addr[i] = inb(ioaddr + EL1_SAPROM);
        }
                outw(i, ioaddr + EL1_DATAPTR);
                station_addr[i] = inb(ioaddr + EL1_SAPROM);
        }
@@ -240,28 +239,24 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
         */
 
        if (station_addr[0] == 0x02  &&  station_addr[1] == 0x60
         */
 
        if (station_addr[0] == 0x02  &&  station_addr[1] == 0x60
-               && station_addr[2] == 0x8c)
-       {
+                                               && station_addr[2] == 0x8c)
                mname = "3c501";
                mname = "3c501";
-       } else if (station_addr[0] == 0x00  &&  station_addr[1] == 0x80
-       && station_addr[2] == 0xC8)
-       {
+       else if (station_addr[0] == 0x00  &&  station_addr[1] == 0x80
+                                               && station_addr[2] == 0xC8)
                mname = "NP943";
                mname = "NP943";
-       }
-       else {
+       else {
                release_region(ioaddr, EL1_IO_EXTENT);
                return -ENODEV;
        }
 
        /*
                release_region(ioaddr, EL1_IO_EXTENT);
                return -ENODEV;
        }
 
        /*
-        *      We auto-IRQ by shutting off the interrupt line and letting it float
-        *      high.
+        *      We auto-IRQ by shutting off the interrupt line and letting it
+        *      float high.
         */
 
        dev->irq = irq;
 
         */
 
        dev->irq = irq;
 
-       if (dev->irq < 2)
-       {
+       if (dev->irq < 2) {
                unsigned long irq_mask;
 
                irq_mask = probe_irq_on();
                unsigned long irq_mask;
 
                irq_mask = probe_irq_on();
@@ -274,8 +269,7 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
                mdelay(20);
                autoirq = probe_irq_off(irq_mask);
 
                mdelay(20);
                autoirq = probe_irq_off(irq_mask);
 
-               if (autoirq == 0)
-               {
+               if (autoirq == 0) {
                        printk(KERN_WARNING "%s probe at %#x failed to detect IRQ line.\n",
                                mname, ioaddr);
                        release_region(ioaddr, EL1_IO_EXTENT);
                        printk(KERN_WARNING "%s probe at %#x failed to detect IRQ line.\n",
                                mname, ioaddr);
                        release_region(ioaddr, EL1_IO_EXTENT);
@@ -292,7 +286,8 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
        if (autoirq)
                dev->irq = autoirq;
 
        if (autoirq)
                dev->irq = autoirq;
 
-       printk(KERN_INFO "%s: %s EtherLink at %#lx, using %sIRQ %d.\n", dev->name, mname, dev->base_addr,
+       printk(KERN_INFO "%s: %s EtherLink at %#lx, using %sIRQ %d.\n",
+                       dev->name, mname, dev->base_addr,
                        autoirq ? "auto":"assigned ", dev->irq);
 
 #ifdef CONFIG_IP_MULTICAST
                        autoirq ? "auto":"assigned ", dev->irq);
 
 #ifdef CONFIG_IP_MULTICAST
@@ -315,7 +310,6 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
        dev->tx_timeout = &el_timeout;
        dev->watchdog_timeo = HZ;
        dev->stop = &el1_close;
        dev->tx_timeout = &el_timeout;
        dev->watchdog_timeo = HZ;
        dev->stop = &el1_close;
-       dev->get_stats = &el1_get_stats;
        dev->set_multicast_list = &set_multicast_list;
        dev->ethtool_ops = &netdev_ethtool_ops;
        return 0;
        dev->set_multicast_list = &set_multicast_list;
        dev->ethtool_ops = &netdev_ethtool_ops;
        return 0;
@@ -344,7 +338,8 @@ static int el_open(struct net_device *dev)
        if (el_debug > 2)
                printk(KERN_DEBUG "%s: Doing el_open()...", dev->name);
 
        if (el_debug > 2)
                printk(KERN_DEBUG "%s: Doing el_open()...", dev->name);
 
-       if ((retval = request_irq(dev->irq, &el_interrupt, 0, dev->name, dev)))
+       retval = request_irq(dev->irq, &el_interrupt, 0, dev->name, dev);
+       if (retval)
                return retval;
 
        spin_lock_irqsave(&lp->lock, flags);
                return retval;
 
        spin_lock_irqsave(&lp->lock, flags);
@@ -372,9 +367,10 @@ static void el_timeout(struct net_device *dev)
        int ioaddr = dev->base_addr;
 
        if (el_debug)
        int ioaddr = dev->base_addr;
 
        if (el_debug)
-               printk (KERN_DEBUG "%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n",
-                       dev->name, inb(TX_STATUS), inb(AX_STATUS), inb(RX_STATUS));
-       lp->stats.tx_errors++;
+               printk(KERN_DEBUG "%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n",
+                       dev->name, inb(TX_STATUS),
+                       inb(AX_STATUS), inb(RX_STATUS));
+       dev->stats.tx_errors++;
        outb(TX_NORM, TX_CMD);
        outb(RX_NORM, RX_CMD);
        outb(AX_OFF, AX_CMD);   /* Just trigger a false interrupt. */
        outb(TX_NORM, TX_CMD);
        outb(RX_NORM, RX_CMD);
        outb(AX_OFF, AX_CMD);   /* Just trigger a false interrupt. */
@@ -426,8 +422,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        netif_stop_queue(dev);
 
 
        netif_stop_queue(dev);
 
-       do
-       {
+       do {
                int len = skb->len;
                int pad = 0;
                int gp_start;
                int len = skb->len;
                int pad = 0;
                int gp_start;
@@ -436,12 +431,12 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
                if (len < ETH_ZLEN)
                        pad = ETH_ZLEN - len;
 
                if (len < ETH_ZLEN)
                        pad = ETH_ZLEN - len;
 
-               gp_start = 0x800 - ( len + pad );
+               gp_start = 0x800 - (len + pad);
 
                lp->tx_pkt_start = gp_start;
 
                lp->tx_pkt_start = gp_start;
-               lp->collisions = 0;
+               lp->collisions = 0;
 
 
-               lp->stats.tx_bytes += skb->len;
+               dev->stats.tx_bytes += skb->len;
 
                /*
                 *      Command mode with status cleared should [in theory]
 
                /*
                 *      Command mode with status cleared should [in theory]
@@ -456,38 +451,41 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
                lp->txing = 1;
 
                /*
                lp->txing = 1;
 
                /*
-                *      Turn interrupts back on while we spend a pleasant afternoon
-                *      loading bytes into the board
+                *      Turn interrupts back on while we spend a pleasant
+                *      afternoon loading bytes into the board
                 */
 
                spin_unlock_irqrestore(&lp->lock, flags);
 
                 */
 
                spin_unlock_irqrestore(&lp->lock, flags);
 
-               outw(0x00, RX_BUF_CLR);         /* Set rx packet area to 0. */
-               outw(gp_start, GP_LOW);         /* aim - packet will be loaded into buffer start */
-               outsb(DATAPORT,buf,len);        /* load buffer (usual thing each byte increments the pointer) */
+               /* Set rx packet area to 0. */
+               outw(0x00, RX_BUF_CLR);
+               /* aim - packet will be loaded into buffer start */
+               outw(gp_start, GP_LOW);
+               /* load buffer (usual thing each byte increments the pointer) */
+               outsb(DATAPORT, buf, len);
                if (pad) {
                if (pad) {
-                       while(pad--)            /* Zero fill buffer tail */
+                       while (pad--)           /* Zero fill buffer tail */
                                outb(0, DATAPORT);
                }
                                outb(0, DATAPORT);
                }
-               outw(gp_start, GP_LOW);         /* the board reuses the same register */
+               /* the board reuses the same register */
+               outw(gp_start, GP_LOW);
 
 
-               if(lp->loading != 2)
-               {
-                       outb(AX_XMIT, AX_CMD);          /* fire ... Trigger xmit.  */
-                       lp->loading=0;
+               if (lp->loading != 2) {
+                       /* fire ... Trigger xmit.  */
+                       outb(AX_XMIT, AX_CMD);
+                       lp->loading = 0;
                        dev->trans_start = jiffies;
                        if (el_debug > 2)
                                printk(KERN_DEBUG " queued xmit.\n");
                        dev->trans_start = jiffies;
                        if (el_debug > 2)
                                printk(KERN_DEBUG " queued xmit.\n");
-                       dev_kfree_skb (skb);
+                       dev_kfree_skb(skb);
                        return 0;
                }
                /* A receive upset our load, despite our best efforts */
                        return 0;
                }
                /* A receive upset our load, despite our best efforts */
-               if(el_debug>2)
-                       printk(KERN_DEBUG "%s: burped during tx load.\n", dev->name);
+               if (el_debug > 2)
+                       printk(KERN_DEBUG "%s: burped during tx load.\n",
+                               dev->name);
                spin_lock_irqsave(&lp->lock, flags);
                spin_lock_irqsave(&lp->lock, flags);
-       }
-       while(1);
-
+       } while (1);
 }
 
 /**
 }
 
 /**
@@ -535,64 +533,59 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)
         */
 
        if (el_debug > 3)
         */
 
        if (el_debug > 3)
-               printk(KERN_DEBUG "%s: el_interrupt() aux=%#02x", dev->name, axsr);
-
-        if(lp->loading==1 && !lp->txing)
-               printk(KERN_WARNING "%s: Inconsistent state loading while not in tx\n",
-                       dev->name);
+               printk(KERN_DEBUG "%s: el_interrupt() aux=%#02x",
+                                                       dev->name, axsr);
 
 
-       if (lp->txing)
-       {
-
-               /*
-                *      Board in transmit mode. May be loading. If we are
-                *      loading we shouldn't have got this.
-                */
+       if (lp->loading == 1 && !lp->txing)
+               printk(KERN_WARNING "%s: Inconsistent state loading while not in tx\n",
+                       dev->name);
 
 
+       if (lp->txing) {
+               /*
+                *      Board in transmit mode. May be loading. If we are
+                *      loading we shouldn't have got this.
+                */
                int txsr = inb(TX_STATUS);
 
                int txsr = inb(TX_STATUS);
 
-               if(lp->loading==1)
-               {
-                       if(el_debug > 2)
-                       {
-                               printk(KERN_DEBUG "%s: Interrupt while loading [", dev->name);
-                               printk(KERN_DEBUG " txsr=%02x gp=%04x rp=%04x]\n", txsr, inw(GP_LOW),inw(RX_LOW));
+               if (lp->loading == 1) {
+                       if (el_debug > 2) {
+                               printk(KERN_DEBUG "%s: Interrupt while loading [",
+                                       dev->name);
+                               printk(" txsr=%02x gp=%04x rp=%04x]\n",
+                                       txsr, inw(GP_LOW), inw(RX_LOW));
                        }
                        }
-                       lp->loading=2;          /* Force a reload */
+                       /* Force a reload */
+                       lp->loading = 2;
                        spin_unlock(&lp->lock);
                        goto out;
                }
                        spin_unlock(&lp->lock);
                        goto out;
                }
-
                if (el_debug > 6)
                if (el_debug > 6)
-                       printk(KERN_DEBUG " txsr=%02x gp=%04x rp=%04x", txsr, inw(GP_LOW),inw(RX_LOW));
+                       printk(KERN_DEBUG " txsr=%02x gp=%04x rp=%04x",
+                                       txsr, inw(GP_LOW), inw(RX_LOW));
 
 
-               if ((axsr & 0x80) && (txsr & TX_READY) == 0)
-               {
+               if ((axsr & 0x80) && (txsr & TX_READY) == 0) {
                        /*
                        /*
-                        *      FIXME: is there a logic to whether to keep on trying or
-                        *      reset immediately ?
+                        *      FIXME: is there a logic to whether to keep
+                        *      on trying or reset immediately ?
                         */
                         */
-                       if(el_debug>1)
-                               printk(KERN_DEBUG "%s: Unusual interrupt during Tx, txsr=%02x axsr=%02x"
-                                       " gp=%03x rp=%03x.\n", dev->name, txsr, axsr,
-                       inw(ioaddr + EL1_DATAPTR), inw(ioaddr + EL1_RXPTR));
+                       if (el_debug > 1)
+                               printk(KERN_DEBUG "%s: Unusual interrupt during Tx, txsr=%02x axsr=%02x gp=%03x rp=%03x.\n",
+                                       dev->name, txsr, axsr,
+                                       inw(ioaddr + EL1_DATAPTR),
+                                       inw(ioaddr + EL1_RXPTR));
                        lp->txing = 0;
                        netif_wake_queue(dev);
                        lp->txing = 0;
                        netif_wake_queue(dev);
-               }
-               else if (txsr & TX_16COLLISIONS)
-               {
+               } else if (txsr & TX_16COLLISIONS) {
                        /*
                         *      Timed out
                         */
                        if (el_debug)
                        /*
                         *      Timed out
                         */
                        if (el_debug)
-                               printk (KERN_DEBUG "%s: Transmit failed 16 times, Ethernet jammed?\n",dev->name);
+                               printk(KERN_DEBUG "%s: Transmit failed 16 times, Ethernet jammed?\n", dev->name);
                        outb(AX_SYS, AX_CMD);
                        lp->txing = 0;
                        outb(AX_SYS, AX_CMD);
                        lp->txing = 0;
-                       lp->stats.tx_aborted_errors++;
+                       dev->stats.tx_aborted_errors++;
                        netif_wake_queue(dev);
                        netif_wake_queue(dev);
-               }
-               else if (txsr & TX_COLLISION)
-               {
+               } else if (txsr & TX_COLLISION) {
                        /*
                         *      Retrigger xmit.
                         */
                        /*
                         *      Retrigger xmit.
                         */
@@ -600,62 +593,56 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)
                        if (el_debug > 6)
                                printk(KERN_DEBUG " retransmitting after a collision.\n");
                        /*
                        if (el_debug > 6)
                                printk(KERN_DEBUG " retransmitting after a collision.\n");
                        /*
-                        *      Poor little chip can't reset its own start pointer
+                        *      Poor little chip can't reset its own start
+                        *      pointer
                         */
 
                        outb(AX_SYS, AX_CMD);
                        outw(lp->tx_pkt_start, GP_LOW);
                        outb(AX_XMIT, AX_CMD);
                         */
 
                        outb(AX_SYS, AX_CMD);
                        outw(lp->tx_pkt_start, GP_LOW);
                        outb(AX_XMIT, AX_CMD);
-                       lp->stats.collisions++;
+                       dev->stats.collisions++;
                        spin_unlock(&lp->lock);
                        goto out;
                        spin_unlock(&lp->lock);
                        goto out;
-               }
-               else
-               {
+               } else {
                        /*
                         *      It worked.. we will now fall through and receive
                         */
                        /*
                         *      It worked.. we will now fall through and receive
                         */
-                       lp->stats.tx_packets++;
+                       dev->stats.tx_packets++;
                        if (el_debug > 6)
                                printk(KERN_DEBUG " Tx succeeded %s\n",
                        if (el_debug > 6)
                                printk(KERN_DEBUG " Tx succeeded %s\n",
-                                       (txsr & TX_RDY) ? "." : "but tx is busy!");
+                                       (txsr & TX_RDY) ? "." :
+                                                       "but tx is busy!");
                        /*
                         *      This is safe the interrupt is atomic WRT itself.
                         */
                        /*
                         *      This is safe the interrupt is atomic WRT itself.
                         */
-
                        lp->txing = 0;
                        lp->txing = 0;
-                       netif_wake_queue(dev);  /* In case more to transmit */
+                       /* In case more to transmit */
+                       netif_wake_queue(dev);
                }
                }
-       }
-       else
-       {
-               /*
-                *      In receive mode.
-                */
+       } else {
+               /*
+                *      In receive mode.
+                */
 
                int rxsr = inb(RX_STATUS);
                if (el_debug > 5)
 
                int rxsr = inb(RX_STATUS);
                if (el_debug > 5)
-                       printk(KERN_DEBUG " rxsr=%02x txsr=%02x rp=%04x", rxsr, inb(TX_STATUS),inw(RX_LOW));
+                       printk(KERN_DEBUG " rxsr=%02x txsr=%02x rp=%04x", rxsr, inb(TX_STATUS), inw(RX_LOW));
                /*
                 *      Just reading rx_status fixes most errors.
                 */
                if (rxsr & RX_MISSED)
                /*
                 *      Just reading rx_status fixes most errors.
                 */
                if (rxsr & RX_MISSED)
-                       lp->stats.rx_missed_errors++;
-               else if (rxsr & RX_RUNT)
-               {       /* Handled to avoid board lock-up. */
-                       lp->stats.rx_length_errors++;
+                       dev->stats.rx_missed_errors++;
+               else if (rxsr & RX_RUNT) {
+                       /* Handled to avoid board lock-up. */
+                       dev->stats.rx_length_errors++;
                        if (el_debug > 5)
                                printk(KERN_DEBUG " runt.\n");
                        if (el_debug > 5)
                                printk(KERN_DEBUG " runt.\n");
-               }
-               else if (rxsr & RX_GOOD)
-               {
+               } else if (rxsr & RX_GOOD) {
                        /*
                         *      Receive worked.
                         */
                        el_receive(dev);
                        /*
                         *      Receive worked.
                         */
                        el_receive(dev);
-               }
-               else
-               {
+               } else {
                        /*
                         *      Nothing?  Something is broken!
                         */
                        /*
                         *      Nothing?  Something is broken!
                         */
@@ -694,7 +681,6 @@ out:
 
 static void el_receive(struct net_device *dev)
 {
 
 static void el_receive(struct net_device *dev)
 {
-       struct net_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
        int pkt_len;
        struct sk_buff *skb;
        int ioaddr = dev->base_addr;
        int pkt_len;
        struct sk_buff *skb;
@@ -704,11 +690,11 @@ static void el_receive(struct net_device *dev)
        if (el_debug > 4)
                printk(KERN_DEBUG " el_receive %d.\n", pkt_len);
 
        if (el_debug > 4)
                printk(KERN_DEBUG " el_receive %d.\n", pkt_len);
 
-       if ((pkt_len < 60)  ||  (pkt_len > 1536))
-       {
+       if (pkt_len < 60 || pkt_len > 1536) {
                if (el_debug)
                if (el_debug)
-                       printk(KERN_DEBUG "%s: bogus packet, length=%d\n", dev->name, pkt_len);
-               lp->stats.rx_over_errors++;
+                       printk(KERN_DEBUG "%s: bogus packet, length=%d\n",
+                                               dev->name, pkt_len);
+               dev->stats.rx_over_errors++;
                return;
        }
 
                return;
        }
 
@@ -724,26 +710,24 @@ static void el_receive(struct net_device *dev)
         */
 
        outw(0x00, GP_LOW);
         */
 
        outw(0x00, GP_LOW);
-       if (skb == NULL)
-       {
-               printk(KERN_INFO "%s: Memory squeeze, dropping packet.\n", dev->name);
-               lp->stats.rx_dropped++;
+       if (skb == NULL) {
+               printk(KERN_INFO "%s: Memory squeeze, dropping packet.\n",
+                                                               dev->name);
+               dev->stats.rx_dropped++;
                return;
                return;
-       }
-       else
-       {
-               skb_reserve(skb,2);     /* Force 16 byte alignment */
+       } else {
+               skb_reserve(skb, 2);    /* Force 16 byte alignment */
                /*
                 *      The read increments through the bytes. The interrupt
                 *      handler will fix the pointer when it returns to
                 *      receive mode.
                 */
                /*
                 *      The read increments through the bytes. The interrupt
                 *      handler will fix the pointer when it returns to
                 *      receive mode.
                 */
-               insb(DATAPORT, skb_put(skb,pkt_len), pkt_len);
-               skb->protocol=eth_type_trans(skb,dev);
+               insb(DATAPORT, skb_put(skb, pkt_len), pkt_len);
+               skb->protocol = eth_type_trans(skb, dev);
                netif_rx(skb);
                dev->last_rx = jiffies;
                netif_rx(skb);
                dev->last_rx = jiffies;
-               lp->stats.rx_packets++;
-               lp->stats.rx_bytes+=pkt_len;
+               dev->stats.rx_packets++;
+               dev->stats.rx_bytes += pkt_len;
        }
        return;
 }
        }
        return;
 }
@@ -762,10 +746,11 @@ static void  el_reset(struct net_device *dev)
        struct net_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
 
        struct net_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
 
-       if (el_debug> 2)
+       if (el_debug > 2)
                printk(KERN_INFO "3c501 reset...");
        outb(AX_RESET, AX_CMD);         /* Reset the chip */
                printk(KERN_INFO "3c501 reset...");
        outb(AX_RESET, AX_CMD);         /* Reset the chip */
-       outb(AX_LOOP, AX_CMD);          /* Aux control, irq and loopback enabled */
+       /* Aux control, irq and loopback enabled */
+       outb(AX_LOOP, AX_CMD);
        {
                int i;
                for (i = 0; i < 6; i++) /* Set the station address. */
        {
                int i;
                for (i = 0; i < 6; i++) /* Set the station address. */
@@ -796,7 +781,8 @@ static int el1_close(struct net_device *dev)
        int ioaddr = dev->base_addr;
 
        if (el_debug > 2)
        int ioaddr = dev->base_addr;
 
        if (el_debug > 2)
-               printk(KERN_INFO "%s: Shutting down Ethernet card at %#x.\n", dev->name, ioaddr);
+               printk(KERN_INFO "%s: Shutting down Ethernet card at %#x.\n",
+                                               dev->name, ioaddr);
 
        netif_stop_queue(dev);
 
 
        netif_stop_queue(dev);
 
@@ -810,23 +796,6 @@ static int el1_close(struct net_device *dev)
        return 0;
 }
 
        return 0;
 }
 
-/**
- * el1_get_stats:
- * @dev: The card to get the statistics for
- *
- * In smarter devices this function is needed to pull statistics off the
- * board itself. The 3c501 has no hardware statistics. We maintain them all
- * so they are by definition always up to date.
- *
- * Returns the statistics for the card from the card private data
- */
-
-static struct net_device_stats *el1_get_stats(struct net_device *dev)
-{
-       struct net_local *lp = netdev_priv(dev);
-       return &lp->stats;
-}
-
 /**
  * set_multicast_list:
  * @dev: The device to adjust
 /**
  * set_multicast_list:
  * @dev: The device to adjust
@@ -841,18 +810,14 @@ static void set_multicast_list(struct net_device *dev)
 {
        int ioaddr = dev->base_addr;
 
 {
        int ioaddr = dev->base_addr;
 
-       if(dev->flags&IFF_PROMISC)
-       {
+       if (dev->flags & IFF_PROMISC) {
                outb(RX_PROM, RX_CMD);
                inb(RX_STATUS);
                outb(RX_PROM, RX_CMD);
                inb(RX_STATUS);
-       }
-       else if (dev->mc_list || dev->flags&IFF_ALLMULTI)
-       {
-               outb(RX_MULT, RX_CMD);  /* Multicast or all multicast is the same */
+       } else if (dev->mc_list || dev->flags & IFF_ALLMULTI) {
+               /* Multicast or all multicast is the same */
+               outb(RX_MULT, RX_CMD);
                inb(RX_STATUS);         /* Clear status. */
                inb(RX_STATUS);         /* Clear status. */
-       }
-       else
-       {
+       } else {
                outb(RX_NORM, RX_CMD);
                inb(RX_STATUS);
        }
                outb(RX_NORM, RX_CMD);
                inb(RX_STATUS);
        }