fbdev: section cleanup in w100fb
[safe/jmp/linux-2.6] / drivers / net / tsi108_eth.c
index a69c4a4..a03730b 100644 (file)
@@ -38,7 +38,6 @@
 #include <linux/etherdevice.h>
 #include <linux/ethtool.h>
 #include <linux/skbuff.h>
-#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/delay.h>
 #include <linux/crc32.h>
@@ -48,6 +47,7 @@
 #include <linux/rtnetlink.h>
 #include <linux/timer.h>
 #include <linux/platform_device.h>
+#include <linux/gfp.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -263,7 +263,7 @@ static inline void tsi108_write_tbi(struct tsi108_prv_data *data,
                        return;
                udelay(10);
        }
-       printk(KERN_ERR "%s function time out \n", __func__);
+       printk(KERN_ERR "%s function time out\n", __func__);
 }
 
 static int mii_speed(struct mii_if_info *mii)
@@ -704,8 +704,8 @@ static int tsi108_send_packet(struct sk_buff * skb, struct net_device *dev)
 
                if (i == 0) {
                        data->txring[tx].buf0 = dma_map_single(NULL, skb->data,
-                                       skb->len - skb->data_len, DMA_TO_DEVICE);
-                       data->txring[tx].len = skb->len - skb->data_len;
+                                       skb_headlen(skb), DMA_TO_DEVICE);
+                       data->txring[tx].len = skb_headlen(skb);
                        misc |= TSI108_TX_SOF;
                } else {
                        skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1];
@@ -1056,7 +1056,7 @@ static void tsi108_stop_ethernet(struct net_device *dev)
                        return;
                udelay(10);
        }
-       printk(KERN_ERR "%s function time out \n", __func__);
+       printk(KERN_ERR "%s function time out\n", __func__);
 }
 
 static void tsi108_reset_ether(struct tsi108_prv_data * data)
@@ -1184,29 +1184,19 @@ static void tsi108_set_rx_mode(struct net_device *dev)
 
        rxcfg &= ~(TSI108_EC_RXCFG_UFE | TSI108_EC_RXCFG_MFE);
 
-       if (dev->flags & IFF_ALLMULTI || dev->mc_count) {
+       if (dev->flags & IFF_ALLMULTI || !netdev_mc_empty(dev)) {
                int i;
-               struct dev_mc_list *mc = dev->mc_list;
+               struct netdev_hw_addr *ha;
                rxcfg |= TSI108_EC_RXCFG_MFE | TSI108_EC_RXCFG_MC_HASH;
 
                memset(data->mc_hash, 0, sizeof(data->mc_hash));
 
-               while (mc) {
+               netdev_for_each_mc_addr(ha, dev) {
                        u32 hash, crc;
 
-                       if (mc->dmi_addrlen == 6) {
-                               crc = ether_crc(6, mc->dmi_addr);
-                               hash = crc >> 23;
-
-                               __set_bit(hash, &data->mc_hash[0]);
-                       } else {
-                               printk(KERN_ERR
-               "%s: got multicast address of length %d instead of 6.\n",
-                                      dev->name,
-                                      mc->dmi_addrlen);
-                       }
-
-                       mc = mc->next;
+                       crc = ether_crc(6, ha->addr);
+                       hash = crc >> 23;
+                       __set_bit(hash, &data->mc_hash[0]);
                }
 
                TSI_WRITE(TSI108_EC_HASHADDR,
@@ -1243,7 +1233,7 @@ static void tsi108_init_phy(struct net_device *dev)
                udelay(10);
        }
        if (i == 0)
-               printk(KERN_ERR "%s function time out \n", __func__);
+               printk(KERN_ERR "%s function time out\n", __func__);
 
        if (data->phy_type == TSI108_PHY_BCM54XX) {
                tsi108_write_mii(data, 0x09, 0x0300);