sky2: version 1.28
[safe/jmp/linux-2.6] / drivers / net / sunbmac.c
index 977b3e0..34446b6 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -25,6 +24,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/gfp.h>
 
 #include <asm/auxio.h>
 #include <asm/byteorder.h>
@@ -919,7 +919,7 @@ static int bigmac_open(struct net_device *dev)
        struct bigmac *bp = netdev_priv(dev);
        int ret;
 
-       ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp);
+       ret = request_irq(dev->irq, bigmac_interrupt, IRQF_SHARED, dev->name, bp);
        if (ret) {
                printk(KERN_ERR "BIGMAC: Can't order irq %d to go.\n", dev->irq);
                return ret;
@@ -982,9 +982,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
        sbus_writel(CREG_CTRL_TWAKEUP, bp->creg + CREG_CTRL);
 
 
-       dev->trans_start = jiffies;
-
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
@@ -999,7 +997,7 @@ static void bigmac_set_multicast(struct net_device *dev)
 {
        struct bigmac *bp = netdev_priv(dev);
        void __iomem *bregs = bp->bregs;
-       struct dev_mc_list *dmi = dev->mc_list;
+       struct netdev_hw_addr *ha;
        char *addrs;
        int i;
        u32 tmp, crc;
@@ -1013,7 +1011,7 @@ static void bigmac_set_multicast(struct net_device *dev)
        while ((sbus_readl(bregs + BMAC_RXCFG) & BIGMAC_RXCFG_ENABLE) != 0)
                udelay(20);
 
-       if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) {
+       if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 64)) {
                sbus_writel(0xffff, bregs + BMAC_HTABLE0);
                sbus_writel(0xffff, bregs + BMAC_HTABLE1);
                sbus_writel(0xffff, bregs + BMAC_HTABLE2);
@@ -1028,9 +1026,8 @@ static void bigmac_set_multicast(struct net_device *dev)
                for (i = 0; i < 4; i++)
                        hash_table[i] = 0;
 
-               for (i = 0; i < dev->mc_count; i++) {
-                       addrs = dmi->dmi_addr;
-                       dmi = dmi->next;
+               netdev_for_each_mc_addr(ha, dev) {
+                       addrs = ha->addr;
 
                        if (!(*addrs & 1))
                                continue;
@@ -1074,6 +1071,18 @@ static const struct ethtool_ops bigmac_ethtool_ops = {
        .get_link               = bigmac_get_link,
 };
 
+static const struct net_device_ops bigmac_ops = {
+       .ndo_open               = bigmac_open,
+       .ndo_stop               = bigmac_close,
+       .ndo_start_xmit         = bigmac_start_xmit,
+       .ndo_get_stats          = bigmac_get_stats,
+       .ndo_set_multicast_list = bigmac_set_multicast,
+       .ndo_tx_timeout         = bigmac_tx_timeout,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 static int __devinit bigmac_ether_init(struct of_device *op,
                                       struct of_device *qec_op)
 {
@@ -1187,16 +1196,8 @@ static int __devinit bigmac_ether_init(struct of_device *op,
        bp->dev = dev;
 
        /* Set links to our BigMAC open and close routines. */
-       dev->open = &bigmac_open;
-       dev->stop = &bigmac_close;
-       dev->hard_start_xmit = &bigmac_start_xmit;
        dev->ethtool_ops = &bigmac_ethtool_ops;
-
-       /* Set links to BigMAC statistic and multi-cast loading code. */
-       dev->get_stats = &bigmac_get_stats;
-       dev->set_multicast_list = &bigmac_set_multicast;
-
-       dev->tx_timeout = &bigmac_tx_timeout;
+       dev->netdev_ops = &bigmac_ops;
        dev->watchdog_timeo = 5*HZ;
 
        /* Finish net device registration. */
@@ -1233,7 +1234,7 @@ fail_and_cleanup:
                                  bp->bmac_block,
                                  bp->bblock_dvma);
 
-       /* This also frees the co-located 'dev->priv' */
+       /* This also frees the co-located private data */
        free_netdev(dev);
        return -ENODEV;
 }