Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158831
b: refs/heads/master
c: a33e9e7
h: refs/heads/master
i:
  158829: 741a4b8
  158827: c52c163
  158823: ece4e69
  158815: d3dc903
v: v3
  • Loading branch information
Jussi Kivilinna authored and John W. Linville committed Jul 10, 2009
1 parent 3215c53 commit a83b956
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d75ec2b7ec27fd6cdba78492fbd63bee4d091a87
refs/heads/master: a33e9e7f35ef6dcab528e0327f29188475f60691
14 changes: 14 additions & 0 deletions trunk/drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,9 @@ EXPORT_SYMBOL_GPL(usbnet_unlink_rx_urbs);
int usbnet_stop (struct net_device *net)
{
struct usbnet *dev = netdev_priv(net);
struct driver_info *info = dev->driver_info;
int temp;
int retval;
DECLARE_WAIT_QUEUE_HEAD_ONSTACK (unlink_wakeup);
DECLARE_WAITQUEUE (wait, current);

Expand All @@ -587,6 +589,18 @@ int usbnet_stop (struct net_device *net)
net->stats.rx_errors, net->stats.tx_errors
);

/* allow minidriver to stop correctly (wireless devices to turn off
* radio etc) */
if (info->stop) {
retval = info->stop(dev);
if (retval < 0 && netif_msg_ifdown(dev))
devinfo(dev,
"stop fail (%d) usbnet usb-%s-%s, %s",
retval,
dev->udev->bus->bus_name, dev->udev->devpath,
info->description);
}

// ensure there are no more active urbs
add_wait_queue (&unlink_wakeup, &wait);
dev->wait = &unlink_wakeup;
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/usb/usbnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ struct driver_info {
/* reset device ... can sleep */
int (*reset)(struct usbnet *);

/* stop device ... can sleep */
int (*stop)(struct usbnet *);

/* see if peer is connected ... can sleep */
int (*check_connect)(struct usbnet *);

Expand Down

0 comments on commit a83b956

Please sign in to comment.