]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/s2io.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[linux-2.6-omap-h63xx.git] / drivers / net / s2io.c
index 639fbc0f16f3f8d8d1832d3bfca7ce436433e784..fd85648d98d142e5b10e8186680721650d695352 100644 (file)
@@ -59,7 +59,6 @@
 #include <linux/stddef.h>
 #include <linux/ioctl.h>
 #include <linux/timex.h>
-#include <linux/sched.h>
 #include <linux/ethtool.h>
 #include <linux/workqueue.h>
 #include <linux/if_vlan.h>
@@ -3759,7 +3758,6 @@ static int s2io_close(struct net_device *dev)
 {
        struct s2io_nic *sp = dev->priv;
 
-       flush_scheduled_work();
        netif_stop_queue(dev);
        /* Reset card, kill tasklet and free Tx and Rx buffers. */
        s2io_card_down(sp);
@@ -5848,9 +5846,14 @@ static void s2io_set_link(struct work_struct *work)
        register u64 val64;
        u16 subid;
 
+       rtnl_lock();
+
+       if (!netif_running(dev))
+               goto out_unlock;
+
        if (test_and_set_bit(0, &(nic->link_state))) {
                /* The card is being reset, no point doing anything */
-               return;
+               goto out_unlock;
        }
 
        subid = nic->pdev->subsystem_device;
@@ -5904,6 +5907,9 @@ static void s2io_set_link(struct work_struct *work)
                s2io_link(nic, LINK_DOWN);
        }
        clear_bit(0, &(nic->link_state));
+
+out_unlock:
+       rtnl_lock();
 }
 
 static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
@@ -6357,6 +6363,11 @@ static void s2io_restart_nic(struct work_struct *work)
        struct s2io_nic *sp = container_of(work, struct s2io_nic, rst_timer_task);
        struct net_device *dev = sp->dev;
 
+       rtnl_lock();
+
+       if (!netif_running(dev))
+               goto out_unlock;
+
        s2io_card_down(sp);
        if (s2io_card_up(sp)) {
                DBG_PRINT(ERR_DBG, "%s: Device bring up failed\n",
@@ -6365,7 +6376,8 @@ static void s2io_restart_nic(struct work_struct *work)
        netif_wake_queue(dev);
        DBG_PRINT(ERR_DBG, "%s: was reset by Tx watchdog timer\n",
                  dev->name);
-
+out_unlock:
+       rtnl_unlock();
 }
 
 /**
@@ -7174,6 +7186,8 @@ static void __devexit s2io_rem_nic(struct pci_dev *pdev)
                return;
        }
 
+       flush_scheduled_work();
+
        sp = dev->priv;
        unregister_netdev(dev);
 
@@ -7298,7 +7312,7 @@ static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro)
 {
        struct iphdr *ip = lro->iph;
        struct tcphdr *tcp = lro->tcph;
-       u16 nchk;
+       __sum16 nchk;
        struct stat_block *statinfo = sp->mac_control.stats_info;
        DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__);