summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-09-07 06:33:49 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-17 23:41:01 +0200
commit29bac7b7661bbbdbbd32bc1e6cedca22f260da7f (patch)
tree95600092fe262980ea0fec4d4581f398cb0ea5b4 /drivers/usb/gadget
parentUSB: omap_udc: sync with OMAP tree (diff)
downloadlinux-29bac7b7661bbbdbbd32bc1e6cedca22f260da7f.tar.xz
linux-29bac7b7661bbbdbbd32bc1e6cedca22f260da7f.zip
usb gadget: cdc ethernet notification bugfix
Bugfix for the new CDC Ethernet code: as part of activating the network interface's USB link, make sure its link management code knows whether the interface is open or not. Without this fix, the link won't work right when it's brought up before the link is active ... because the initial notification it sends will have the wrong link state (down, not up). Makes it hard to bridge these links (on the host side), among other things. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: stable <stable@kernel.org> [2.6.27] Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/u_ether.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index dbd575a194f3..66948b72bb9b 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -873,6 +873,13 @@ struct net_device *gether_connect(struct gether *link)
spin_lock(&dev->lock);
dev->port_usb = link;
link->ioport = dev;
+ if (netif_running(dev->net)) {
+ if (link->open)
+ link->open(link);
+ } else {
+ if (link->close)
+ link->close(link);
+ }
spin_unlock(&dev->lock);
netif_carrier_on(dev->net);