usbnet.c (c57d5621d2f2dc238f4b9c4d00b2a54187a75445) usbnet.c (f50791ac1aca1ac1b0370d62397b43e9f831421a)
1/*
2 * USB Network driver infrastructure
3 * Copyright (C) 2000-2005 by David Brownell
4 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 764 unchanged lines hidden (view full) ---

773 set_current_state(TASK_RUNNING);
774 remove_wait_queue(&dev->wait, &wait);
775}
776
777int usbnet_stop (struct net_device *net)
778{
779 struct usbnet *dev = netdev_priv(net);
780 struct driver_info *info = dev->driver_info;
1/*
2 * USB Network driver infrastructure
3 * Copyright (C) 2000-2005 by David Brownell
4 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 764 unchanged lines hidden (view full) ---

773 set_current_state(TASK_RUNNING);
774 remove_wait_queue(&dev->wait, &wait);
775}
776
777int usbnet_stop (struct net_device *net)
778{
779 struct usbnet *dev = netdev_priv(net);
780 struct driver_info *info = dev->driver_info;
781 int retval, pm;
781 int retval, pm, mpn;
782
783 clear_bit(EVENT_DEV_OPEN, &dev->flags);
784 netif_stop_queue (net);
785
786 netif_info(dev, ifdown, dev->net,
787 "stop stats: rx/tx %lu/%lu, errs %lu/%lu\n",
788 net->stats.rx_packets, net->stats.tx_packets,
789 net->stats.rx_errors, net->stats.tx_errors);

--- 14 unchanged lines hidden (view full) ---

804
805 if (!(info->flags & FLAG_AVOID_UNLINK_URBS))
806 usbnet_terminate_urbs(dev);
807
808 usbnet_status_stop(dev);
809
810 usbnet_purge_paused_rxq(dev);
811
782
783 clear_bit(EVENT_DEV_OPEN, &dev->flags);
784 netif_stop_queue (net);
785
786 netif_info(dev, ifdown, dev->net,
787 "stop stats: rx/tx %lu/%lu, errs %lu/%lu\n",
788 net->stats.rx_packets, net->stats.tx_packets,
789 net->stats.rx_errors, net->stats.tx_errors);

--- 14 unchanged lines hidden (view full) ---

804
805 if (!(info->flags & FLAG_AVOID_UNLINK_URBS))
806 usbnet_terminate_urbs(dev);
807
808 usbnet_status_stop(dev);
809
810 usbnet_purge_paused_rxq(dev);
811
812 mpn = !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags);
813
812 /* deferred work (task, timer, softirq) must also stop.
813 * can't flush_scheduled_work() until we drop rtnl (later),
814 * else workers could deadlock; so make workers a NOP.
815 */
816 dev->flags = 0;
817 del_timer_sync (&dev->delay);
818 tasklet_kill (&dev->bh);
819 if (!pm)
820 usb_autopm_put_interface(dev->intf);
821
814 /* deferred work (task, timer, softirq) must also stop.
815 * can't flush_scheduled_work() until we drop rtnl (later),
816 * else workers could deadlock; so make workers a NOP.
817 */
818 dev->flags = 0;
819 del_timer_sync (&dev->delay);
820 tasklet_kill (&dev->bh);
821 if (!pm)
822 usb_autopm_put_interface(dev->intf);
823
822 if (info->manage_power &&
823 !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags))
824 if (info->manage_power && mpn)
824 info->manage_power(dev, 0);
825 else
826 usb_autopm_put_interface(dev->intf);
827
828 return 0;
829}
830EXPORT_SYMBOL_GPL(usbnet_stop);
831

--- 1276 unchanged lines hidden ---
825 info->manage_power(dev, 0);
826 else
827 usb_autopm_put_interface(dev->intf);
828
829 return 0;
830}
831EXPORT_SYMBOL_GPL(usbnet_stop);
832

--- 1276 unchanged lines hidden ---