qlcnic: fix caching window register
[safe/jmp/linux-2.6] / drivers / net / eepro.c
index 53317a8..8d97f16 100644 (file)
@@ -137,7 +137,6 @@ static const char version[] =
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/netdevice.h>
@@ -309,7 +308,8 @@ struct eepro_local {
 
 static int     eepro_probe1(struct net_device *dev, int autoprobe);
 static int     eepro_open(struct net_device *dev);
-static int     eepro_send_packet(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t eepro_send_packet(struct sk_buff *skb,
+                                    struct net_device *dev);
 static irqreturn_t eepro_interrupt(int irq, void *dev_id);
 static void    eepro_rx(struct net_device *dev);
 static void    eepro_transmit_interrupt(struct net_device *dev);
@@ -645,7 +645,7 @@ static void __init printEEPROMInfo(struct net_device *dev)
        if (GetBit(Word,ee_PortTPE)) printk(KERN_DEBUG "TPE ");
        if (GetBit(Word,ee_PortBNC)) printk(KERN_DEBUG "BNC ");
        if (GetBit(Word,ee_PortAUI)) printk(KERN_DEBUG "AUI ");
-       printk(KERN_DEBUG "port(s) \n");
+       printk(KERN_DEBUG "port(s)\n");
 
        Word = lp->word[6];
        printk(KERN_DEBUG "Word6:\n");
@@ -765,7 +765,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe)
        /* Grab the region so we can find another board if autoIRQ fails. */
        if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) {
                if (!autoprobe)
-                       printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n",
+                       printk(KERN_WARNING "EEPRO: io-port 0x%04x in use\n",
                                ioaddr);
                return -EBUSY;
        }
@@ -989,7 +989,7 @@ static int eepro_open(struct net_device *dev)
                return -EAGAIN;
        }
 
-       if (request_irq(dev->irq , &eepro_interrupt, 0, dev->name, dev)) {
+       if (request_irq(dev->irq , eepro_interrupt, 0, dev->name, dev)) {
                printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq);
                return -EAGAIN;
        }
@@ -1133,7 +1133,8 @@ static void eepro_tx_timeout (struct net_device *dev)
 }
 
 
-static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t eepro_send_packet(struct sk_buff *skb,
+                                    struct net_device *dev)
 {
        struct eepro_local *lp = netdev_priv(dev);
        unsigned long flags;
@@ -1160,8 +1161,7 @@ static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
                        /* we won't wake queue here because we're out of space */
                        dev->stats.tx_dropped++;
                else {
-               dev->stats.tx_bytes+=skb->len;
-               dev->trans_start = jiffies;
+                       dev->stats.tx_bytes+=skb->len;
                        netif_wake_queue(dev);
                }
 
@@ -1285,9 +1285,10 @@ set_multicast_list(struct net_device *dev)
        struct eepro_local *lp = netdev_priv(dev);
        short ioaddr = dev->base_addr;
        unsigned short mode;
-       struct dev_mc_list *dmi=dev->mc_list;
+       struct netdev_hw_addr *ha;
+       int mc_count = netdev_mc_count(dev);
 
-       if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || dev->mc_count > 63)
+       if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || mc_count > 63)
        {
                eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
                mode = inb(ioaddr + REG2);
@@ -1297,7 +1298,7 @@ set_multicast_list(struct net_device *dev)
                eepro_sw2bank0(ioaddr); /* Return to BANK 0 now */
        }
 
-       else if (dev->mc_count==0 )
+       else if (mc_count == 0)
        {
                eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
                mode = inb(ioaddr + REG2);
@@ -1327,12 +1328,10 @@ set_multicast_list(struct net_device *dev)
                outw(MC_SETUP, ioaddr + IO_PORT);
                outw(0, ioaddr + IO_PORT);
                outw(0, ioaddr + IO_PORT);
-               outw(6*(dev->mc_count + 1), ioaddr + IO_PORT);
+               outw(6 * (mc_count + 1), ioaddr + IO_PORT);
 
-               for (i = 0; i < dev->mc_count; i++)
-               {
-                       eaddrs=(unsigned short *)dmi->dmi_addr;
-                       dmi=dmi->next;
+               netdev_for_each_mc_addr(ha, dev) {
+                       eaddrs = (unsigned short *) ha->addr;
                        outw(*eaddrs++, ioaddr + IO_PORT);
                        outw(*eaddrs++, ioaddr + IO_PORT);
                        outw(*eaddrs++, ioaddr + IO_PORT);
@@ -1346,7 +1345,7 @@ set_multicast_list(struct net_device *dev)
                outb(MC_SETUP, ioaddr);
 
                /* Update the transmit queue */
-               i = lp->tx_end + XMT_HEADER + 6*(dev->mc_count + 1);
+               i = lp->tx_end + XMT_HEADER + 6 * (mc_count + 1);
 
                if (lp->tx_start != lp->tx_end)
                {
@@ -1378,8 +1377,8 @@ set_multicast_list(struct net_device *dev)
                                        break;
                                } else if ((i & 0x0f) == 0x03)  { /* MC-Done */
                                        printk(KERN_DEBUG "%s: set Rx mode to %d address%s.\n",
-                                               dev->name, dev->mc_count,
-                                               dev->mc_count > 1 ? "es":"");
+                                               dev->name, mc_count,
+                                               mc_count > 1 ? "es":"");
                                        break;
                                }
                        }