Merge branch 'linus' into cont_syslog
[safe/jmp/linux-2.6] / drivers / net / a2065.c
index 02f64d5..f142cc2 100644 (file)
@@ -46,7 +46,6 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/skbuff.h>
-#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/crc32.h>
@@ -526,7 +525,7 @@ static inline int lance_reset (struct net_device *dev)
        load_csrs (lp);
 
        lance_init_ring (dev);
-       dev->trans_start = jiffies;
+       dev->trans_start = jiffies; /* prevent tx timeout */
        netif_start_queue(dev);
 
        status = init_restart_lance (lp);
@@ -547,38 +546,31 @@ static void lance_tx_timeout(struct net_device *dev)
        netif_wake_queue(dev);
 }
 
-static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t lance_start_xmit (struct sk_buff *skb,
+                                    struct net_device *dev)
 {
        struct lance_private *lp = netdev_priv(dev);
        volatile struct lance_regs *ll = lp->ll;
        volatile struct lance_init_block *ib = lp->init_block;
        int entry, skblen;
-       int status = 0;
+       int status = NETDEV_TX_OK;
        unsigned long flags;
 
        if (skb_padto(skb, ETH_ZLEN))
-               return 0;
+               return NETDEV_TX_OK;
        skblen = max_t(unsigned, skb->len, ETH_ZLEN);
 
        local_irq_save(flags);
 
        if (!TX_BUFFS_AVAIL){
                local_irq_restore(flags);
-               return -1;
+               return NETDEV_TX_LOCKED;
        }
 
 #ifdef DEBUG_DRIVER
        /* dump the packet */
-       {
-               int i;
-
-               for (i = 0; i < 64; i++) {
-                       if ((i % 16) == 0)
-                               printk("\n" KERN_DEBUG);
-                       printk ("%2.2x ", skb->data [i]);
-               }
-               printk("\n");
-       }
+       print_hex_dump(KERN_DEBUG, "skb->data: ", DUMP_PREFIX_NONE,
+                      16, 1, skb->data, 64, true);
 #endif
        entry = lp->tx_new & lp->tx_ring_mod_mask;
        ib->btx_ring [entry].length = (-skblen) | 0xf000;
@@ -596,7 +588,6 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
 
        /* Kick the lance: transmit now */
        ll->rdp = LE_C0_INEA | LE_C0_TDMD;
-       dev->trans_start = jiffies;
        dev_kfree_skb (skb);
 
        local_irq_restore(flags);
@@ -610,9 +601,8 @@ static void lance_load_multicast (struct net_device *dev)
        struct lance_private *lp = netdev_priv(dev);
        volatile struct lance_init_block *ib = lp->init_block;
        volatile u16 *mcast_table = (u16 *)&ib->filter;
-       struct dev_mc_list *dmi=dev->mc_list;
+       struct netdev_hw_addr *ha;
        char *addrs;
-       int i;
        u32 crc;
 
        /* set all multicast bits */
@@ -626,9 +616,8 @@ static void lance_load_multicast (struct net_device *dev)
        ib->filter [1] = 0;
 
        /* Add addresses */
-       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;
 
                /* multicast address? */
                if (!(*addrs & 1))
@@ -638,7 +627,6 @@ static void lance_load_multicast (struct net_device *dev)
                crc = crc >> 26;
                mcast_table [crc >> 4] |= 1 << (crc & 0xf);
        }
-       return;
 }
 
 static void lance_set_multicast (struct net_device *dev)
@@ -684,6 +672,7 @@ static struct zorro_device_id a2065_zorro_tbl[] __devinitdata = {
        { ZORRO_PROD_AMERISTAR_A2065 },
        { 0 }
 };
+MODULE_DEVICE_TABLE(zorro, a2065_zorro_tbl);
 
 static struct zorro_driver a2065_driver = {
        .name           = "a2065",