iwlwifi: add missing rcu_read_lock
[safe/jmp/linux-2.6] / drivers / net / wireless / zd1201.c
index dae1bfb..390d77f 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <linux/module.h>
 #include <linux/usb.h>
+#include <linux/slab.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/wireless.h>
@@ -112,6 +113,9 @@ exit:
        return err;
 }
 
+MODULE_FIRMWARE("zd1201-ap.fw");
+MODULE_FIRMWARE("zd1201.fw");
+
 static void zd1201_usbfree(struct urb *urb)
 {
        struct zd1201 *zd = urb->context;
@@ -130,7 +134,6 @@ static void zd1201_usbfree(struct urb *urb)
 
        kfree(urb->transfer_buffer);
        usb_free_urb(urb);
-       return;
 }
 
 /* cmdreq message: 
@@ -181,7 +184,6 @@ static void zd1201_usbtx(struct urb *urb)
 {
        struct zd1201 *zd = urb->context;
        netif_wake_queue(zd->dev);
-       return;
 }
 
 /* Incoming data */
@@ -403,7 +405,6 @@ exit:
                wake_up(&zd->rxdataq);
                kfree(urb->transfer_buffer);
        }
-       return;
 }
 
 static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata,
@@ -779,7 +780,8 @@ static int zd1201_net_stop(struct net_device *dev)
                                (llc+snap+type+payload)
                zd              1 null byte, zd1201 packet type
  */
-static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t zd1201_hard_start_xmit(struct sk_buff *skb,
+                                               struct net_device *dev)
 {
        struct zd1201 *zd = netdev_priv(dev);
        unsigned char *txbuf = zd->txdata;
@@ -822,7 +824,6 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
        } else {
                dev->stats.tx_packets++;
                dev->stats.tx_bytes += skb->len;
-               dev->trans_start = jiffies;
        }
        kfree_skb(skb);
 
@@ -840,7 +841,7 @@ static void zd1201_tx_timeout(struct net_device *dev)
        usb_unlink_urb(zd->tx_urb);
        dev->stats.tx_errors++;
        /* Restart the timeout to quiet the watchdog: */
-       dev->trans_start = jiffies;
+       dev->trans_start = jiffies; /* prevent tx timeout */
 }
 
 static int zd1201_set_mac_address(struct net_device *dev, void *p)
@@ -871,20 +872,18 @@ static struct iw_statistics *zd1201_get_wireless_stats(struct net_device *dev)
 static void zd1201_set_multicast(struct net_device *dev)
 {
        struct zd1201 *zd = netdev_priv(dev);
-       struct dev_mc_list *mc = dev->mc_list;
+       struct netdev_hw_addr *ha;
        unsigned char reqbuf[ETH_ALEN*ZD1201_MAXMULTI];
        int i;
 
-       if (dev->mc_count > ZD1201_MAXMULTI)
+       if (netdev_mc_count(dev) > ZD1201_MAXMULTI)
                return;
 
-       for (i=0; i<dev->mc_count; i++) {
-               memcpy(reqbuf+i*ETH_ALEN, mc->dmi_addr, ETH_ALEN);
-               mc = mc->next;
-       }
+       i = 0;
+       netdev_for_each_mc_addr(ha, dev)
+               memcpy(reqbuf + i++ * ETH_ALEN, ha->addr, ETH_ALEN);
        zd1201_setconfig(zd, ZD1201_RID_CNFGROUPADDRESS, reqbuf,
-           dev->mc_count*ETH_ALEN, 0);
-       
+                        netdev_mc_count(dev) * ETH_ALEN, 0);
 }
 
 static int zd1201_config_commit(struct net_device *dev,