sky2: Avoid race in sky2_change_mtu
[safe/jmp/linux-2.6] / drivers / net / seeq8005.c
index ebbbe09..d2fce98 100644 (file)
@@ -37,7 +37,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/init.h>
 #include <linux/delay.h>
@@ -81,7 +80,8 @@ struct net_local {
 static int seeq8005_probe1(struct net_device *dev, int ioaddr);
 static int seeq8005_open(struct net_device *dev);
 static void seeq8005_timeout(struct net_device *dev);
-static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t seeq8005_send_packet(struct sk_buff *skb,
+                                       struct net_device *dev);
 static irqreturn_t seeq8005_interrupt(int irq, void *dev_id);
 static void seeq8005_rx(struct net_device *dev);
 static int seeq8005_close(struct net_device *dev);
@@ -334,7 +334,7 @@ static int __init seeq8005_probe1(struct net_device *dev, int ioaddr)
 
 #if 0
        {
-                int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", dev);
+                int irqval = request_irq(dev->irq, seeq8005_interrupt, 0, "seeq8005", dev);
                 if (irqval) {
                         printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name,
                                         dev->irq, irqval);
@@ -366,7 +366,7 @@ static int seeq8005_open(struct net_device *dev)
        struct net_local *lp = netdev_priv(dev);
 
        {
-                int irqval = request_irq(dev->irq, &seeq8005_interrupt, 0, "seeq8005", dev);
+                int irqval = request_irq(dev->irq, seeq8005_interrupt, 0, "seeq8005", dev);
                 if (irqval) {
                         printk ("%s: unable to get IRQ %d (irqval=%d).\n", dev->name,
                                         dev->irq, irqval);
@@ -390,18 +390,19 @@ static void seeq8005_timeout(struct net_device *dev)
                   tx_done(dev) ? "IRQ conflict" : "network cable problem");
        /* Try to restart the adaptor. */
        seeq8005_init(dev, 1);
-       dev->trans_start = jiffies;
+       dev->trans_start = jiffies; /* prevent tx timeout */
        netif_wake_queue(dev);
 }
 
-static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t seeq8005_send_packet(struct sk_buff *skb,
+                                       struct net_device *dev)
 {
        short length = skb->len;
        unsigned char *buf;
 
        if (length < ETH_ZLEN) {
                if (skb_padto(skb, ETH_ZLEN))
-                       return 0;
+                       return NETDEV_TX_OK;
                length = ETH_ZLEN;
        }
        buf = skb->data;
@@ -410,12 +411,11 @@ static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev)
        netif_stop_queue(dev);
 
        hardware_send_packet(dev, buf, length);
-       dev->trans_start = jiffies;
        dev->stats.tx_bytes += length;
        dev_kfree_skb (skb);
        /* You might need to clean up and record Tx statistics here. */
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -578,7 +578,6 @@ static void seeq8005_rx(struct net_device *dev)
        /* If any worth-while packets have been received, netif_rx()
           has done a mark_bh(NET_BH) for us and will work on them
           when we get to the bottom-half routine. */
-       return;
 }
 
 /* The inverse routine to net_open(). */