Merge master.kernel.org:/home/rmk/linux-2.6-arm
[safe/jmp/linux-2.6] / drivers / net / mac89x0.c
index 380a1a5..c0876e9 100644 (file)
@@ -73,8 +73,6 @@ static char *version =
    or override something. */
 #include <linux/module.h>
 
-#define PRINTK(x) printk x
-
 /*
   Sources:
 
@@ -90,7 +88,6 @@ static char *version =
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/nubus.h>
 #include <linux/errno.h>
@@ -100,6 +97,7 @@ static char *version =
 #include <linux/skbuff.h>
 #include <linux/delay.h>
 #include <linux/bitops.h>
+#include <linux/gfp.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -168,6 +166,17 @@ writereg(struct net_device *dev, int portno, int value)
        nubus_writew(swab16(value), dev->mem_start + portno);
 }
 
+static const struct net_device_ops mac89x0_netdev_ops = {
+       .ndo_open               = net_open,
+       .ndo_stop               = net_close,
+       .ndo_start_xmit         = net_send_packet,
+       .ndo_get_stats          = net_get_stats,
+       .ndo_set_multicast_list = set_multicast_list,
+       .ndo_set_mac_address    = set_mac_address,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_change_mtu         = eth_change_mtu,
+};
+
 /* Probe for the CS8900 card in slot E.  We won't bother looking
    anywhere else until we have a really good reason to do so. */
 struct net_device * __init mac89x0_probe(int unit)
@@ -213,8 +222,8 @@ struct net_device * __init mac89x0_probe(int unit)
                int card_present;
 
                local_irq_save(flags);
-               card_present = hwreg_present((void*) ioaddr+4)
-                 && hwreg_present((void*) ioaddr + DATA_PORT);
+               card_present = (hwreg_present((void*) ioaddr+4) &&
+                               hwreg_present((void*) ioaddr + DATA_PORT));
                local_irq_restore(flags);
 
                if (!card_present)
@@ -280,12 +289,7 @@ struct net_device * __init mac89x0_probe(int unit)
 
        printk(" IRQ %d ADDR %pM\n", dev->irq, dev->dev_addr);
 
-       dev->open               = net_open;
-       dev->stop               = net_close;
-       dev->hard_start_xmit = net_send_packet;
-       dev->get_stats  = net_get_stats;
-       dev->set_multicast_list = &set_multicast_list;
-       dev->set_mac_address = &set_mac_address;
+       dev->netdev_ops         = &mac89x0_netdev_ops;
 
        err = register_netdev(dev);
        if (err)
@@ -333,7 +337,7 @@ net_open(struct net_device *dev)
        writereg(dev, PP_BusCTL, readreg(dev, PP_BusCTL) & ~ENABLE_IRQ);
 
        /* Grab the interrupt */
-       if (request_irq(dev->irq, &net_interrupt, 0, "cs89x0", dev))
+       if (request_irq(dev->irq, net_interrupt, 0, "cs89x0", dev))
                return -EAGAIN;
 
        /* Set up the IRQ - Apparently magic */
@@ -396,7 +400,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev)
                /* Gasp!  It hasn't.  But that shouldn't happen since
                   we're waiting for TxOk, so return 1 and requeue this packet. */
                local_irq_restore(flags);
-               return 1;
+               return NETDEV_TX_BUSY;
        }
 
        /* Write the contents of the packet */
@@ -407,7 +411,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev)
        dev->trans_start = jiffies;
        dev_kfree_skb (skb);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /* The typical workload of the driver:
@@ -564,9 +568,7 @@ static void set_multicast_list(struct net_device *dev)
        if(dev->flags&IFF_PROMISC)
        {
                lp->rx_mode = RX_ALL_ACCEPT;
-       }
-       else if((dev->flags&IFF_ALLMULTI)||dev->mc_list)
-       {
+       } else if ((dev->flags & IFF_ALLMULTI) || !netdev_mc_empty(dev)) {
                /* The multicast-accept list is initialized to accept-all, and we
                   rely on higher-level filtering for now. */
                lp->rx_mode = RX_MULTCAST_ACCEPT;