Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[safe/jmp/linux-2.6] / drivers / net / sun3lance.c
index e5beb29..1694ca5 100644 (file)
@@ -28,7 +28,6 @@ static char *version = "sun3lance.c: v1.2 1/12/2001  Sam Creasey (sammy@sammy.ne
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/errno.h>
-#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
@@ -294,6 +293,16 @@ out:
        return ERR_PTR(err);
 }
 
+static const struct net_device_ops lance_netdev_ops = {
+       .ndo_open               = lance_open,
+       .ndo_stop               = lance_close,
+       .ndo_start_xmit         = lance_start_xmit,
+       .ndo_set_multicast_list = set_multicast_list,
+       .ndo_set_mac_address    = NULL,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 static int __init lance_probe( struct net_device *dev)
 {
        unsigned long ioaddr;
@@ -397,12 +406,7 @@ static int __init lance_probe( struct net_device *dev)
        if (did_version++ == 0)
                printk( version );
 
-       /* The LANCE-specific entries in the device structure. */
-       dev->open = &lance_open;
-       dev->hard_start_xmit = &lance_start_xmit;
-       dev->stop = &lance_close;
-       dev->set_multicast_list = &set_multicast_list;
-       dev->set_mac_address = NULL;
+       dev->netdev_ops = &lance_netdev_ops;
 //     KLUDGE -- REMOVE ME
        set_bit(__LINK_STATE_PRESENT, &dev->state);
 
@@ -521,7 +525,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
        if (netif_queue_stopped(dev)) {
                int tickssofar = jiffies - dev->trans_start;
                if (tickssofar < 20)
-                       return( 1 );
+                       return NETDEV_TX_BUSY;
 
                DPRINTK( 1, ( "%s: transmit timed out, status %04x, resetting.\n",
                                          dev->name, DREG ));
@@ -557,7 +561,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
                netif_start_queue(dev);
                dev->trans_start = jiffies;
 
-               return 0;
+               return NETDEV_TX_OK;
        }
 
 
@@ -572,7 +576,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
        if (test_and_set_bit( 0, (void*)&lp->lock ) != 0) {
                printk( "%s: tx queue lock!.\n", dev->name);
                /* don't clear dev->tbusy flag. */
-               return 1;
+               return NETDEV_TX_BUSY;
        }
 
        AREG = CSR0;
@@ -643,7 +647,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
 
        local_irq_restore(flags);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /* The LANCE interrupt handler. */
@@ -912,7 +916,7 @@ static void set_multicast_list( struct net_device *dev )
                REGA( CSR15 ) = 0x8000; /* Set promiscuous mode */
        } else {
                short multicast_table[4];
-               int num_addrs = dev->mc_count;
+               int num_addrs = netdev_mc_count(dev);
                int i;
                /* We don't use the multicast table, but rely on upper-layer
                 * filtering. */