summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-08-05 18:46:26 -0700
committerDavid S. Miller <davem@davemloft.net>2014-08-05 18:46:26 -0700
commitd247b6ab3ce6dd43665780865ec5fa145d9ab6bd (patch)
tree02eb71e4d64b678d7568d2b99f309e08f56ef2fe /drivers/net/usb
parent30f00847953e3aa3f710d62ffd37b42042807900 (diff)
parent4d8fdc95c60e90d84c8257a0067ff4b1729a3757 (diff)
downloadlinux-d247b6ab3ce6dd43665780865ec5fa145d9ab6bd.tar.gz
linux-d247b6ab3ce6dd43665780865ec5fa145d9ab6bd.tar.bz2
linux-d247b6ab3ce6dd43665780865ec5fa145d9ab6bd.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/Makefile net/ipv6/sysctl_net_ipv6.c Two ipv6_table_template[] additions overlap, so the index of the ipv6_table[x] assignments needed to be adjusted. In the drivers/net/Makefile case, we've gotten rid of the garbage whereby we had to list every single USB networking driver in the top-level Makefile, there is just one "USB_NETWORKING" that guards everything. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/cdc_subset.c27
-rw-r--r--drivers/net/usb/usbnet.c8
2 files changed, 32 insertions, 3 deletions
diff --git a/drivers/net/usb/cdc_subset.c b/drivers/net/usb/cdc_subset.c
index 91f0919fe278..6ea98cff2d3b 100644
--- a/drivers/net/usb/cdc_subset.c
+++ b/drivers/net/usb/cdc_subset.c
@@ -85,14 +85,28 @@ static int always_connected (struct usbnet *dev)
*
*-------------------------------------------------------------------------*/
+static void m5632_recover(struct usbnet *dev)
+{
+ struct usb_device *udev = dev->udev;
+ struct usb_interface *intf = dev->intf;
+ int r;
+
+ r = usb_lock_device_for_reset(udev, intf);
+ if (r < 0)
+ return;
+
+ usb_reset_device(udev);
+ usb_unlock_device(udev);
+}
+
static const struct driver_info ali_m5632_info = {
.description = "ALi M5632",
.flags = FLAG_POINTTOPOINT,
+ .recover = m5632_recover,
};
#endif
-
#ifdef CONFIG_USB_AN2720
#define HAVE_HARDWARE
@@ -326,12 +340,23 @@ static const struct usb_device_id products [] = {
MODULE_DEVICE_TABLE(usb, products);
/*-------------------------------------------------------------------------*/
+static int dummy_prereset(struct usb_interface *intf)
+{
+ return 0;
+}
+
+static int dummy_postreset(struct usb_interface *intf)
+{
+ return 0;
+}
static struct usb_driver cdc_subset_driver = {
.name = "cdc_subset",
.probe = usbnet_probe,
.suspend = usbnet_suspend,
.resume = usbnet_resume,
+ .pre_reset = dummy_prereset,
+ .post_reset = dummy_postreset,
.disconnect = usbnet_disconnect,
.id_table = products,
.disable_hub_initiated_lpm = 1,
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index f9e96c427558..5173821a9575 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1218,8 +1218,12 @@ void usbnet_tx_timeout (struct net_device *net)
unlink_urbs (dev, &dev->txq);
tasklet_schedule (&dev->bh);
-
- // FIXME: device recovery -- reset?
+ /* this needs to be handled individually because the generic layer
+ * doesn't know what is sufficient and could not restore private
+ * information if a remedy of an unconditional reset were used.
+ */
+ if (dev->driver_info->recover)
+ (dev->driver_info->recover)(dev);
}
EXPORT_SYMBOL_GPL(usbnet_tx_timeout);