drivers: wireless: bcm4329: set MMC_PM_KEEP_POWER on suspend
[linux-2.6.git] / drivers / net / eexpress.c
index 592de8f..a192285 100644 (file)
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
-#include <linux/slab.h>
 #include <linux/mca-legacy.h>
 #include <linux/spinlock.h>
 #include <linux/bitops.h>
@@ -366,7 +365,7 @@ static int __init do_express_probe(struct net_device *dev)
                        dev->irq = mca_irqmap[(pos1>>4)&0x7];
 
                        /*
-                        * XXX: Transciever selection is done
+                        * XXX: Transceiver selection is done
                         * differently on the MCA version.
                         * How to get it to select something
                         * other than external/AUI is currently
@@ -457,7 +456,7 @@ static int eexp_open(struct net_device *dev)
        if (!dev->irq || !irqrmap[dev->irq])
                return -ENXIO;
 
-       ret = request_irq(dev->irq, &eexp_irq, 0, dev->name, dev);
+       ret = request_irq(dev->irq, eexp_irq, 0, dev->name, dev);
        if (ret)
                return ret;
 
@@ -544,7 +543,7 @@ static void unstick_cu(struct net_device *dev)
 
        if (lp->started)
        {
-               if (time_after(jiffies, dev->trans_start + 50))
+               if (time_after(jiffies, dev_trans_start(dev) + HZ/2))
                {
                        if (lp->tx_link==lp->last_tx_restart)
                        {
@@ -1019,7 +1018,7 @@ static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf,
        outw(lp->tx_head+0x16, ioaddr + DATAPORT);
        outw(0, ioaddr + DATAPORT);
 
-        outsw(ioaddr + DATAPORT, buf, (len+1)>>1);
+       outsw(ioaddr + DATAPORT, buf, (len+1)>>1);
 
        outw(lp->tx_tail+0xc, ioaddr + WRITE_PTR);
        outw(lp->tx_head, ioaddr + DATAPORT);
@@ -1104,7 +1103,7 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr)
                dev->dev_addr[i] = ((unsigned char *)hw_addr)[5-i];
 
        {
-               static char irqmap[]={0, 9, 3, 4, 5, 10, 11, 0};
+               static const char irqmap[] = { 0, 9, 3, 4, 5, 10, 11, 0 };
                unsigned short setupval = eexp_hw_readeeprom(ioaddr,0);
 
                /* Use the IRQ from EEPROM if none was given */
@@ -1571,14 +1570,13 @@ static void eexp_hw_init586(struct net_device *dev)
 #if NET_DEBUG > 6
         printk("%s: leaving eexp_hw_init586()\n", dev->name);
 #endif
-       return;
 }
 
 static void eexp_setup_filter(struct net_device *dev)
 {
-       struct dev_mc_list *dmi;
+       struct netdev_hw_addr *ha;
        unsigned short ioaddr = dev->base_addr;
-       int count = dev->mc_count;
+       int count = netdev_mc_count(dev);
        int i;
        if (count > 8) {
                printk(KERN_INFO "%s: too many multicast addresses (%d)\n",
@@ -1588,23 +1586,19 @@ static void eexp_setup_filter(struct net_device *dev)
 
        outw(CONF_NR_MULTICAST & ~31, ioaddr+SM_PTR);
        outw(6*count, ioaddr+SHADOW(CONF_NR_MULTICAST));
-       for (i = 0, dmi = dev->mc_list; i < count; i++, dmi = dmi->next) {
-               unsigned short *data;
-               if (!dmi) {
-                       printk(KERN_INFO "%s: too few multicast addresses\n", dev->name);
+       i = 0;
+       netdev_for_each_mc_addr(ha, dev) {
+               unsigned short *data = (unsigned short *) ha->addr;
+
+               if (i == count)
                        break;
-               }
-               if (dmi->dmi_addrlen != ETH_ALEN) {
-                       printk(KERN_INFO "%s: invalid multicast address length given.\n", dev->name);
-                       continue;
-               }
-               data = (unsigned short *)dmi->dmi_addr;
                outw((CONF_MULTICAST+(6*i)) & ~31, ioaddr+SM_PTR);
                outw(data[0], ioaddr+SHADOW(CONF_MULTICAST+(6*i)));
                outw((CONF_MULTICAST+(6*i)+2) & ~31, ioaddr+SM_PTR);
                outw(data[1], ioaddr+SHADOW(CONF_MULTICAST+(6*i)+2));
                outw((CONF_MULTICAST+(6*i)+4) & ~31, ioaddr+SM_PTR);
                outw(data[2], ioaddr+SHADOW(CONF_MULTICAST+(6*i)+4));
+               i++;
        }
 }
 
@@ -1627,9 +1621,9 @@ eexp_set_multicast(struct net_device *dev)
         }
         if (!(dev->flags & IFF_PROMISC)) {
                 eexp_setup_filter(dev);
-                if (lp->old_mc_count != dev->mc_count) {
+                if (lp->old_mc_count != netdev_mc_count(dev)) {
                         kick = 1;
-                        lp->old_mc_count = dev->mc_count;
+                        lp->old_mc_count = netdev_mc_count(dev);
                 }
         }
         if (kick) {