net/au1000_eth.c MDIO namespace fixes
[safe/jmp/linux-2.6] / drivers / net / au1000_eth.c
index 55f6e3f..019b13c 100644 (file)
@@ -6,8 +6,8 @@
  * Copyright 2002 TimeSys Corp.
  * Added ethtool/mii-tool support,
  * Copyright 2004 Matt Porter <mporter@kernel.crashing.org>
- * Update: 2004 Bjoern Riemer, riemer@fokus.fraunhofer.de 
- * or riemer@riemer-nt.de: fixed the link beat detection with 
+ * Update: 2004 Bjoern Riemer, riemer@fokus.fraunhofer.de
+ * or riemer@riemer-nt.de: fixed the link beat detection with
  * ioctls (SIOCGMIIPHY)
  * Copyright 2006 Herbert Valerio Riedel <hvr@gnu.org>
  *  converted to use linux-2.6.x's PHY framework
  *
  * ########################################################################
  *
- * 
+ *
  */
-
+#include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/errno.h>
@@ -46,7 +45,6 @@
 #include <linux/bitops.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
-#include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/delay.h>
 #include <linux/crc32.h>
 #include <linux/phy.h>
+
+#include <asm/cpu.h>
 #include <asm/mipsregs.h>
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 
-#include <asm/mach-au1x00/au1000.h>
-#include <asm/cpu.h>
+#include <au1000.h>
+#include <prom.h>
+
 #include "au1000_eth.h"
 
 #ifdef AU1000_ETH_DEBUG
@@ -72,7 +73,7 @@ static int au1000_debug = 3;
 #endif
 
 #define DRV_NAME       "au1000_eth"
-#define DRV_VERSION    "1.5"
+#define DRV_VERSION    "1.6"
 #define DRV_AUTHOR     "Pete Popov <ppopov@embeddedalley.com>"
 #define DRV_DESC       "Au1xxx on-chip Ethernet driver"
 
@@ -89,31 +90,25 @@ static int au1000_open(struct net_device *);
 static int au1000_close(struct net_device *);
 static int au1000_tx(struct sk_buff *, struct net_device *);
 static int au1000_rx(struct net_device *);
-static irqreturn_t au1000_interrupt(int, void *, struct pt_regs *);
+static irqreturn_t au1000_interrupt(int, void *);
 static void au1000_tx_timeout(struct net_device *);
 static void set_rx_mode(struct net_device *);
-static struct net_device_stats *au1000_get_stats(struct net_device *);
 static int au1000_ioctl(struct net_device *, struct ifreq *, int);
-static int mdio_read(struct net_device *, int, int);
-static void mdio_write(struct net_device *, int, int, u16);
+static int au1000_mdio_read(struct net_device *, int, int);
+static void au1000_mdio_write(struct net_device *, int, int, u16);
 static void au1000_adjust_link(struct net_device *);
 static void enable_mac(struct net_device *, int);
 
-// externs
-extern int get_ethernet_addr(char *ethernet_addr);
-extern void str2eaddr(unsigned char *ea, unsigned char *str);
-extern char * __init prom_getcmdline(void);
-
 /*
  * Theory of operation
  *
- * The Au1000 MACs use a simple rx and tx descriptor ring scheme. 
- * There are four receive and four transmit descriptors.  These 
- * descriptors are not in memory; rather, they are just a set of 
+ * The Au1000 MACs use a simple rx and tx descriptor ring scheme.
+ * There are four receive and four transmit descriptors.  These
+ * descriptors are not in memory; rather, they are just a set of
  * hardware registers.
  *
  * Since the Au1000 has a coherent data cache, the receive and
- * transmit buffers are allocated from the KSEG0 segment. The 
+ * transmit buffers are allocated from the KSEG0 segment. The
  * hardware registers, however, are still mapped at KSEG1 to
  * make sure there's no out-of-order writes, and that all writes
  * complete immediately.
@@ -123,7 +118,7 @@ extern char * __init prom_getcmdline(void);
  * the mac address is, and the mac address is not passed on the
  * command line.
  */
-static unsigned char au1000_mac_addr[6] __devinitdata = { 
+static unsigned char au1000_mac_addr[6] __devinitdata = {
        0x00, 0x50, 0xc2, 0x0c, 0x30, 0x00
 };
 
@@ -196,7 +191,7 @@ struct au1000_private *au_macs[NUM_ETH_INTERFACES];
 /*
  * MII operations
  */
-static int mdio_read(struct net_device *dev, int phy_addr, int reg)
+static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg)
 {
        struct au1000_private *aup = (struct au1000_private *) dev->priv;
        volatile u32 *const mii_control_reg = &aup->mac->mii_control;
@@ -207,13 +202,13 @@ static int mdio_read(struct net_device *dev, int phy_addr, int reg)
        while (*mii_control_reg & MAC_MII_BUSY) {
                mdelay(1);
                if (--timedout == 0) {
-                       printk(KERN_ERR "%s: read_MII busy timeout!!\n", 
+                       printk(KERN_ERR "%s: read_MII busy timeout!!\n",
                                        dev->name);
                        return -1;
                }
        }
 
-       mii_control = MAC_SET_MII_SELECT_REG(reg) | 
+       mii_control = MAC_SET_MII_SELECT_REG(reg) |
                MAC_SET_MII_SELECT_PHY(phy_addr) | MAC_MII_READ;
 
        *mii_control_reg = mii_control;
@@ -222,7 +217,7 @@ static int mdio_read(struct net_device *dev, int phy_addr, int reg)
        while (*mii_control_reg & MAC_MII_BUSY) {
                mdelay(1);
                if (--timedout == 0) {
-                       printk(KERN_ERR "%s: mdio_read busy timeout!!\n", 
+                       printk(KERN_ERR "%s: mdio_read busy timeout!!\n",
                                        dev->name);
                        return -1;
                }
@@ -230,7 +225,8 @@ static int mdio_read(struct net_device *dev, int phy_addr, int reg)
        return (int)*mii_data_reg;
 }
 
-static void mdio_write(struct net_device *dev, int phy_addr, int reg, u16 value)
+static void au1000_mdio_write(struct net_device *dev, int phy_addr,
+                             int reg, u16 value)
 {
        struct au1000_private *aup = (struct au1000_private *) dev->priv;
        volatile u32 *const mii_control_reg = &aup->mac->mii_control;
@@ -241,20 +237,20 @@ static void mdio_write(struct net_device *dev, int phy_addr, int reg, u16 value)
        while (*mii_control_reg & MAC_MII_BUSY) {
                mdelay(1);
                if (--timedout == 0) {
-                       printk(KERN_ERR "%s: mdio_write busy timeout!!\n", 
+                       printk(KERN_ERR "%s: mdio_write busy timeout!!\n",
                                        dev->name);
                        return;
                }
        }
 
-       mii_control = MAC_SET_MII_SELECT_REG(reg) | 
+       mii_control = MAC_SET_MII_SELECT_REG(reg) |
                MAC_SET_MII_SELECT_PHY(phy_addr) | MAC_MII_WRITE;
 
        *mii_data_reg = value;
        *mii_control_reg = mii_control;
 }
 
-static int mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
+static int au1000_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
 {
        /* WARNING: bus->phy_map[phy_addr].attached_dev == dev does
         * _NOT_ hold (e.g. when PHY is accessed through other MAC's MII bus) */
@@ -262,21 +258,21 @@ static int mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
 
        enable_mac(dev, 0); /* make sure the MAC associated with this
                             * mii_bus is enabled */
-       return mdio_read(dev, phy_addr, regnum);
+       return au1000_mdio_read(dev, phy_addr, regnum);
 }
 
-static int mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
-                        u16 value)
+static int au1000_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
+                               u16 value)
 {
        struct net_device *const dev = bus->priv;
 
        enable_mac(dev, 0); /* make sure the MAC associated with this
                             * mii_bus is enabled */
-       mdio_write(dev, phy_addr, regnum, value);
+       au1000_mdio_write(dev, phy_addr, regnum, value);
        return 0;
 }
 
-static int mdiobus_reset(struct mii_bus *bus)
+static int au1000_mdiobus_reset(struct mii_bus *bus)
 {
        struct net_device *const dev = bus->priv;
 
@@ -295,7 +291,7 @@ static int mii_probe (struct net_device *dev)
 
        if(aup->mac_id == 0) { /* get PHY0 */
 # if defined(AU1XXX_PHY0_ADDR)
-               phydev = au_macs[AU1XXX_PHY0_BUSID]->mii_bus.phy_map[AU1XXX_PHY0_ADDR];
+               phydev = au_macs[AU1XXX_PHY0_BUSID]->mii_bus->phy_map[AU1XXX_PHY0_ADDR];
 # else
                printk (KERN_INFO DRV_NAME ":%s: using PHY-less setup\n",
                        dev->name);
@@ -303,7 +299,7 @@ static int mii_probe (struct net_device *dev)
 # endif /* defined(AU1XXX_PHY0_ADDR) */
        } else if (aup->mac_id == 1) { /* get PHY1 */
 # if defined(AU1XXX_PHY1_ADDR)
-               phydev = au_macs[AU1XXX_PHY1_BUSID]->mii_bus.phy_map[AU1XXX_PHY1_ADDR];
+               phydev = au_macs[AU1XXX_PHY1_BUSID]->mii_bus->phy_map[AU1XXX_PHY1_ADDR];
 # else
                printk (KERN_INFO DRV_NAME ":%s: using PHY-less setup\n",
                        dev->name);
@@ -316,8 +312,8 @@ static int mii_probe (struct net_device *dev)
 
        /* find the first (lowest address) PHY on the current MAC's MII bus */
        for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++)
-               if (aup->mii_bus.phy_map[phy_addr]) {
-                       phydev = aup->mii_bus.phy_map[phy_addr];
+               if (aup->mii_bus->phy_map[phy_addr]) {
+                       phydev = aup->mii_bus->phy_map[phy_addr];
 # if !defined(AU1XXX_PHY_SEARCH_HIGHEST_ADDR)
                        break; /* break out with first one found */
 # endif
@@ -336,7 +332,7 @@ static int mii_probe (struct net_device *dev)
                 * the MAC0 MII bus */
                for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
                        struct phy_device *const tmp_phydev =
-                               au_macs[0]->mii_bus.phy_map[phy_addr];
+                               au_macs[0]->mii_bus->phy_map[phy_addr];
 
                        if (!tmp_phydev)
                                continue; /* no PHY here... */
@@ -360,7 +356,8 @@ static int mii_probe (struct net_device *dev)
        BUG_ON(!phydev);
        BUG_ON(phydev->attached_dev);
 
-       phydev = phy_connect(dev, phydev->dev.bus_id, &au1000_adjust_link, 0);
+       phydev = phy_connect(dev, phydev->dev.bus_id, &au1000_adjust_link, 0,
+                       PHY_INTERFACE_MODE_MII);
 
        if (IS_ERR(phydev)) {
                printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
@@ -394,7 +391,7 @@ static int mii_probe (struct net_device *dev)
 
 /*
  * Buffer allocation/deallocation routines. The buffer descriptor returned
- * has the virtual and dma address of a buffer suitable for 
+ * has the virtual and dma address of a buffer suitable for
  * both, receive and transmit operations.
  */
 static db_dest_t *GetFreeDB(struct au1000_private *aup)
@@ -500,22 +497,22 @@ static void reset_mac(struct net_device *dev)
        spin_unlock_irqrestore(&aup->lock, flags);
 }
 
-/* 
+/*
  * Setup the receive and transmit "rings".  These pointers are the addresses
  * of the rx and tx MAC DMA registers so they are fixed by the hardware --
  * these are not descriptors sitting in memory.
  */
-static void 
+static void
 setup_hw_rings(struct au1000_private *aup, u32 rx_base, u32 tx_base)
 {
        int i;
 
        for (i = 0; i < NUM_RX_DMA; i++) {
-               aup->rx_dma_ring[i] = 
+               aup->rx_dma_ring[i] =
                        (volatile rx_dma_t *) (rx_base + sizeof(rx_dma_t)*i);
        }
        for (i = 0; i < NUM_TX_DMA; i++) {
-               aup->tx_dma_ring[i] = 
+               aup->tx_dma_ring[i] =
                        (volatile tx_dma_t *) (tx_base + sizeof(tx_dma_t)*i);
        }
 }
@@ -546,7 +543,7 @@ static struct {
 static int num_ifs;
 
 /*
- * Setup the base address and interupt of the Au1xxx ethernet macs
+ * Setup the base address and interrupt of the Au1xxx ethernet macs
  * based on cpu type and whether the interface is enabled in sys_pinfunc
  * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0.
  */
@@ -608,7 +605,7 @@ au1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
        info->regdump_len = 0;
 }
 
-static struct ethtool_ops au1000_ethtool_ops = {
+static const struct ethtool_ops au1000_ethtool_ops = {
        .get_settings = au1000_get_settings,
        .set_settings = au1000_set_settings,
        .get_drvinfo = au1000_get_drvinfo,
@@ -621,7 +618,6 @@ static struct net_device * au1000_probe(int port_num)
        struct au1000_private *aup = NULL;
        struct net_device *dev = NULL;
        db_dest_t *pDB, *pDBfree;
-       char *pmac, *argptr;
        char ethaddr[6];
        int irq, i, err;
        u32 base, macen;
@@ -658,6 +654,8 @@ static struct net_device * au1000_probe(int port_num)
 
        aup = dev->priv;
 
+       spin_lock_init(&aup->lock);
+
        /* Allocate the data buffers */
        /* Snooping works fine with eth on all au1xxx */
        aup->vaddr = (u32)dma_alloc_noncoherent(NULL, MAX_BUF_SIZE *
@@ -679,21 +677,12 @@ static struct net_device * au1000_probe(int port_num)
        au_macs[port_num] = aup;
 
        if (port_num == 0) {
-               /* Check the environment variables first */
-               if (get_ethernet_addr(ethaddr) == 0)
+               if (prom_get_ethernet_addr(ethaddr) == 0)
                        memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr));
                else {
-                       /* Check command line */
-                       argptr = prom_getcmdline();
-                       if ((pmac = strstr(argptr, "ethaddr=")) == NULL)
-                               printk(KERN_INFO "%s: No MAC address found\n",
-                                                dev->name);
+                       printk(KERN_INFO "%s: No MAC address found\n",
+                                        dev->name);
                                /* Use the hard coded MAC addresses */
-                       else {
-                               str2eaddr(ethaddr, pmac + strlen("ethaddr="));
-                               memcpy(au1000_mac_addr, ethaddr, 
-                                      sizeof(au1000_mac_addr));
-                       }
                }
 
                setup_hw_rings(aup, MAC0_RX_DMA_ADDR, MAC0_TX_DMA_ADDR);
@@ -710,28 +699,32 @@ static struct net_device * au1000_probe(int port_num)
        *aup->enable = 0;
        aup->mac_enabled = 0;
 
-       aup->mii_bus.priv = dev;
-       aup->mii_bus.read = mdiobus_read;
-       aup->mii_bus.write = mdiobus_write;
-       aup->mii_bus.reset = mdiobus_reset;
-       aup->mii_bus.name = "au1000_eth_mii";
-       aup->mii_bus.id = aup->mac_id;
-       aup->mii_bus.irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
+       aup->mii_bus = mdiobus_alloc();
+       if (aup->mii_bus == NULL)
+               goto err_out;
+
+       aup->mii_bus->priv = dev;
+       aup->mii_bus->read = au1000_mdiobus_read;
+       aup->mii_bus->write = au1000_mdiobus_write;
+       aup->mii_bus->reset = au1000_mdiobus_reset;
+       aup->mii_bus->name = "au1000_eth_mii";
+       snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id);
+       aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
        for(i = 0; i < PHY_MAX_ADDR; ++i)
-               aup->mii_bus.irq[i] = PHY_POLL;
+               aup->mii_bus->irq[i] = PHY_POLL;
 
        /* if known, set corresponding PHY IRQs */
 #if defined(AU1XXX_PHY_STATIC_CONFIG)
 # if defined(AU1XXX_PHY0_IRQ)
-       if (AU1XXX_PHY0_BUSID == aup->mii_bus.id)
-               aup->mii_bus.irq[AU1XXX_PHY0_ADDR] = AU1XXX_PHY0_IRQ;
+       if (AU1XXX_PHY0_BUSID == aup->mac_id)
+               aup->mii_bus->irq[AU1XXX_PHY0_ADDR] = AU1XXX_PHY0_IRQ;
 # endif
 # if defined(AU1XXX_PHY1_IRQ)
-       if (AU1XXX_PHY1_BUSID == aup->mii_bus.id)
-               aup->mii_bus.irq[AU1XXX_PHY1_ADDR] = AU1XXX_PHY1_IRQ;
+       if (AU1XXX_PHY1_BUSID == aup->mac_id)
+               aup->mii_bus->irq[AU1XXX_PHY1_ADDR] = AU1XXX_PHY1_IRQ;
 # endif
 #endif
-       mdiobus_register(&aup->mii_bus);
+       mdiobus_register(aup->mii_bus);
 
        if (mii_probe(dev) != 0) {
                goto err_out;
@@ -767,21 +760,19 @@ static struct net_device * au1000_probe(int port_num)
                aup->tx_db_inuse[i] = pDB;
        }
 
-       spin_lock_init(&aup->lock);
        dev->base_addr = base;
        dev->irq = irq;
        dev->open = au1000_open;
        dev->hard_start_xmit = au1000_tx;
        dev->stop = au1000_close;
-       dev->get_stats = au1000_get_stats;
        dev->set_multicast_list = &set_rx_mode;
        dev->do_ioctl = &au1000_ioctl;
        SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops);
        dev->tx_timeout = au1000_tx_timeout;
        dev->watchdog_timeo = ETH_TX_TIMEOUT;
 
-       /* 
-        * The boot code uses the ethernet controller, so reset it to start 
+       /*
+        * The boot code uses the ethernet controller, so reset it to start
         * fresh.  au1000_init() expects that the device is in reset state.
         */
        reset_mac(dev);
@@ -789,6 +780,11 @@ static struct net_device * au1000_probe(int port_num)
        return dev;
 
 err_out:
+       if (aup->mii_bus != NULL) {
+               mdiobus_unregister(aup->mii_bus);
+               mdiobus_free(aup->mii_bus);
+       }
+
        /* here we should have a valid dev plus aup-> register addresses
         * so we can reset the mac properly.*/
        reset_mac(dev);
@@ -810,7 +806,7 @@ err_out:
        return NULL;
 }
 
-/* 
+/*
  * Initialize the interface.
  *
  * When the device powers up, the clocks are disabled and the
@@ -822,11 +818,11 @@ err_out:
 static int au1000_init(struct net_device *dev)
 {
        struct au1000_private *aup = (struct au1000_private *) dev->priv;
-       u32 flags;
+       unsigned long flags;
        int i;
        u32 control;
 
-       if (au1000_debug > 4) 
+       if (au1000_debug > 4)
                printk("%s: au1000_init\n", dev->name);
 
        /* bring the device out of reset */
@@ -926,9 +922,8 @@ au1000_adjust_link(struct net_device *dev)
        if(phydev->link != aup->old_link) {
                // link state changed
 
-               if (phydev->link) // link went up
-                       netif_schedule(dev);
-               else { // link went down
+               if (!phydev->link) {
+                       /* link went down */
                        aup->old_speed = 0;
                        aup->old_duplex = -1;
                }
@@ -1020,6 +1015,8 @@ static void __exit au1000_cleanup_module(void)
                if (dev) {
                        aup = (struct au1000_private *) dev->priv;
                        unregister_netdev(dev);
+                       mdiobus_unregister(aup->mii_bus);
+                       mdiobus_free(aup->mii_bus);
                        for (j = 0; j < NUM_RX_DMA; j++)
                                if (aup->rx_db_inuse[j])
                                        ReleaseDB(aup, aup->rx_db_inuse[j]);
@@ -1039,7 +1036,7 @@ static void __exit au1000_cleanup_module(void)
 static void update_tx_stats(struct net_device *dev, u32 status)
 {
        struct au1000_private *aup = (struct au1000_private *) dev->priv;
-       struct net_device_stats *ps = &aup->stats;
+       struct net_device_stats *ps = &dev->stats;
 
        if (status & TX_FRAME_ABORTED) {
                if (!aup->phy_dev || (DUPLEX_FULL == aup->phy_dev->duplex)) {
@@ -1095,15 +1092,15 @@ static void au1000_tx_ack(struct net_device *dev)
 static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
 {
        struct au1000_private *aup = (struct au1000_private *) dev->priv;
-       struct net_device_stats *ps = &aup->stats;
+       struct net_device_stats *ps = &dev->stats;
        volatile tx_dma_t *ptxd;
        u32 buff_stat;
        db_dest_t *pDB;
        int i;
 
        if (au1000_debug > 5)
-               printk("%s: tx: aup %x len=%d, data=%p, head %d\n", 
-                               dev->name, (unsigned)aup, skb->len, 
+               printk("%s: tx: aup %x len=%d, data=%p, head %d\n",
+                               dev->name, (unsigned)aup, skb->len,
                                skb->data, aup->tx_head);
 
        ptxd = aup->tx_dma_ring[aup->tx_head];
@@ -1125,9 +1122,9 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
        }
 
        pDB = aup->tx_db_inuse[aup->tx_head];
-       memcpy((void *)pDB->vaddr, skb->data, skb->len);
+       skb_copy_from_linear_data(skb, pDB->vaddr, skb->len);
        if (skb->len < ETH_ZLEN) {
-               for (i=skb->len; i<ETH_ZLEN; i++) { 
+               for (i=skb->len; i<ETH_ZLEN; i++) {
                        ((char *)pDB->vaddr)[i] = 0;
                }
                ptxd->len = ETH_ZLEN;
@@ -1149,7 +1146,7 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
 static inline void update_rx_stats(struct net_device *dev, u32 status)
 {
        struct au1000_private *aup = (struct au1000_private *) dev->priv;
-       struct net_device_stats *ps = &aup->stats;
+       struct net_device_stats *ps = &dev->stats;
 
        ps->rx_packets++;
        if (status & RX_MCAST_FRAME)
@@ -1166,7 +1163,7 @@ static inline void update_rx_stats(struct net_device *dev, u32 status)
                if (status & RX_COLL)
                        ps->collisions++;
        }
-       else 
+       else
                ps->rx_bytes += status & RX_FRAME_LEN_MASK;
 
 }
@@ -1202,26 +1199,25 @@ static int au1000_rx(struct net_device *dev)
                                printk(KERN_ERR
                                       "%s: Memory squeeze, dropping packet.\n",
                                       dev->name);
-                               aup->stats.rx_dropped++;
+                               dev->stats.rx_dropped++;
                                continue;
                        }
-                       skb->dev = dev;
                        skb_reserve(skb, 2);    /* 16 byte IP header align */
-                       eth_copy_and_sum(skb,
-                               (unsigned char *)pDB->vaddr, frmlen, 0);
+                       skb_copy_to_linear_data(skb,
+                               (unsigned char *)pDB->vaddr, frmlen);
                        skb_put(skb, frmlen);
                        skb->protocol = eth_type_trans(skb, dev);
                        netif_rx(skb);  /* pass the packet to upper layers */
                }
                else {
                        if (au1000_debug > 4) {
-                               if (status & RX_MISSED_FRAME) 
+                               if (status & RX_MISSED_FRAME)
                                        printk("rx miss\n");
-                               if (status & RX_WDOG_TIMER) 
+                               if (status & RX_WDOG_TIMER)
                                        printk("rx wdog\n");
-                               if (status & RX_RUNT) 
+                               if (status & RX_RUNT)
                                        printk("rx runt\n");
-                               if (status & RX_OVERLEN) 
+                               if (status & RX_OVERLEN)
                                        printk("rx overlen\n");
                                if (status & RX_COLL)
                                        printk("rx coll\n");
@@ -1253,14 +1249,9 @@ static int au1000_rx(struct net_device *dev)
 /*
  * Au1000 interrupt service routine.
  */
-static irqreturn_t au1000_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t au1000_interrupt(int irq, void *dev_id)
 {
-       struct net_device *dev = (struct net_device *) dev_id;
-
-       if (dev == NULL) {
-               printk(KERN_ERR "%s: isr: null dev ptr\n", dev->name);
-               return IRQ_RETVAL(1);
-       }
+       struct net_device *dev = dev_id;
 
        /* Handle RX interrupts first to minimize chance of overrun */
 
@@ -1287,12 +1278,11 @@ static void set_rx_mode(struct net_device *dev)
 {
        struct au1000_private *aup = (struct au1000_private *) dev->priv;
 
-       if (au1000_debug > 4) 
+       if (au1000_debug > 4)
                printk("%s: set_rx_mode: flags=%x\n", dev->name, dev->flags);
 
        if (dev->flags & IFF_PROMISC) {                 /* Set promiscuous. */
                aup->mac->control |= MAC_PROMISCUOUS;
-               printk(KERN_INFO "%s: Promiscuous mode enabled.\n", dev->name);
        } else if ((dev->flags & IFF_ALLMULTI)  ||
                           dev->mc_count > MULTICAST_FILTER_LIMIT) {
                aup->mac->control |= MAC_PASS_ALL_MULTI;
@@ -1306,7 +1296,7 @@ static void set_rx_mode(struct net_device *dev)
                mc_filter[1] = mc_filter[0] = 0;
                for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
                         i++, mclist = mclist->next) {
-                       set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26, 
+                       set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26,
                                        (long *)mc_filter);
                }
                aup->mac->multi_hash_high = mc_filter[1];
@@ -1327,18 +1317,5 @@ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        return phy_mii_ioctl(aup->phy_dev, if_mii(rq), cmd);
 }
 
-static struct net_device_stats *au1000_get_stats(struct net_device *dev)
-{
-       struct au1000_private *aup = (struct au1000_private *) dev->priv;
-
-       if (au1000_debug > 4)
-               printk("%s: au1000_get_stats: dev=%p\n", dev->name, dev);
-
-       if (netif_device_present(dev)) {
-               return &aup->stats;
-       }
-       return 0;
-}
-
 module_init(au1000_init_module);
 module_exit(au1000_cleanup_module);