USB: rename usb_buffer_alloc() and usb_buffer_free() users
[safe/jmp/linux-2.6] / drivers / net / typhoon.c
index 38c2161..98d818d 100644 (file)
@@ -109,7 +109,6 @@ static const int multicast_filter_limit = 32;
 #include <linux/timer.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/netdevice.h>
@@ -480,7 +479,7 @@ typhoon_hello(struct typhoon *tp)
                typhoon_inc_cmd_index(&ring->lastWrite, 1);
 
                INIT_COMMAND_NO_RESPONSE(cmd, TYPHOON_CMD_HELLO_RESP);
-               smp_wmb();
+               wmb();
                iowrite32(ring->lastWrite, tp->ioaddr + TYPHOON_REG_CMD_READY);
                spin_unlock(&tp->command_lock);
        }
@@ -922,12 +921,9 @@ typhoon_set_rx_mode(struct net_device *dev)
                filter |= TYPHOON_RX_FILTER_ALL_MCAST;
        } else if (!netdev_mc_empty(dev)) {
                struct dev_mc_list *mclist;
-               int i;
 
                memset(mc_filter, 0, sizeof(mc_filter));
-               for (i = 0, mclist = dev->mc_list;
-                    mclist && i < netdev_mc_count(dev);
-                    i++, mclist = mclist->next) {
+               netdev_for_each_mc_addr(mclist, dev) {
                        int bit = ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3f;
                        mc_filter[bit >> 5] |= 1 << (bit & 0x1f);
                }
@@ -1314,13 +1310,15 @@ typhoon_init_interface(struct typhoon *tp)
 
        tp->txlo_dma_addr = le32_to_cpu(iface->txLoAddr);
        tp->card_state = Sleeping;
-       smp_wmb();
 
        tp->offload = TYPHOON_OFFLOAD_IP_CHKSUM | TYPHOON_OFFLOAD_TCP_CHKSUM;
        tp->offload |= TYPHOON_OFFLOAD_UDP_CHKSUM | TSO_OFFLOAD_ON;
 
        spin_lock_init(&tp->command_lock);
        spin_lock_init(&tp->state_lock);
+
+       /* Force the writes to the shared memory area out before continuing. */
+       wmb();
 }
 
 static void
@@ -2099,7 +2097,7 @@ typhoon_tx_timeout(struct net_device *dev)
 
        if(typhoon_reset(tp->ioaddr, WaitNoSleep) < 0) {
                netdev_warn(dev, "could not reset in tx timeout\n");
-               goto truely_dead;
+               goto truly_dead;
        }
 
        /* If we ever start using the Hi ring, it will need cleaning too */
@@ -2108,13 +2106,13 @@ typhoon_tx_timeout(struct net_device *dev)
 
        if(typhoon_start_runtime(tp) < 0) {
                netdev_err(dev, "could not start runtime in tx timeout\n");
-               goto truely_dead;
+               goto truly_dead;
         }
 
        netif_wake_queue(dev);
        return;
 
-truely_dead:
+truly_dead:
        /* Reset the hardware, and turn off carrier to avoid more timeouts */
        typhoon_reset(tp->ioaddr, NoWait);
        netif_carrier_off(dev);