]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sched/sch_generic.c
[IPSEC] proto: Move transport mode input path into xfrm_mode_transport
[linux-2.6-omap-h63xx.git] / net / sched / sch_generic.c
index 0d066c965342e5bbb93bcbe2a80cd4d39653028b..138ea92ed268457b99d9c6b44a1a9580cc7c016a 100644 (file)
@@ -193,8 +193,10 @@ static void dev_watchdog(unsigned long arg)
                    netif_running(dev) &&
                    netif_carrier_ok(dev)) {
                        if (netif_queue_stopped(dev) &&
-                           (jiffies - dev->trans_start) > dev->watchdog_timeo) {
-                               printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n", dev->name);
+                           time_after(jiffies, dev->trans_start + dev->watchdog_timeo)) {
+
+                               printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n",
+                                      dev->name);
                                dev->tx_timeout(dev);
                        }
                        if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo))
@@ -234,10 +236,24 @@ static void dev_watchdog_down(struct net_device *dev)
 {
        spin_lock_bh(&dev->xmit_lock);
        if (del_timer(&dev->watchdog_timer))
-               __dev_put(dev);
+               dev_put(dev);
        spin_unlock_bh(&dev->xmit_lock);
 }
 
+void netif_carrier_on(struct net_device *dev)
+{
+       if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state))
+               linkwatch_fire_event(dev);
+       if (netif_running(dev))
+               __netdev_watchdog_up(dev);
+}
+
+void netif_carrier_off(struct net_device *dev)
+{
+       if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state))
+               linkwatch_fire_event(dev);
+}
+
 /* "NOOP" scheduler: the best scheduler, recommended for all interfaces
    under all circumstances. It is difficult to invent anything faster or
    cheaper.
@@ -600,6 +616,8 @@ void dev_shutdown(struct net_device *dev)
 }
 
 EXPORT_SYMBOL(__netdev_watchdog_up);
+EXPORT_SYMBOL(netif_carrier_on);
+EXPORT_SYMBOL(netif_carrier_off);
 EXPORT_SYMBOL(noop_qdisc);
 EXPORT_SYMBOL(noop_qdisc_ops);
 EXPORT_SYMBOL(qdisc_create_dflt);