From 8a1ce2c0447b1a0816f66fde2f832c31b5fbee2c Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 18 Aug 2008 17:43:56 -0700 Subject: usb gadget: link fixes for cdc composite gadget Change how the CDC Composite gadget driver builds: don't use separate compilation, since it works poorly when key parts are library code (with init sections etc). Instead be as close as we can to "gcc --combine ...". Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/u_ether.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/usb/gadget/u_ether.c') diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index 3791e627190..dbd575a194f 100644 --- a/drivers/usb/gadget/u_ether.c +++ b/drivers/usb/gadget/u_ether.c @@ -52,7 +52,7 @@ * this single "physical" link to be used by multiple virtual links.) */ -#define DRIVER_VERSION "29-May-2008" +#define UETH__VERSION "29-May-2008" struct eth_dev { /* lock is held while accessing port_usb @@ -170,7 +170,7 @@ static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p) struct eth_dev *dev = netdev_priv(net); strlcpy(p->driver, "g_ether", sizeof p->driver); - strlcpy(p->version, DRIVER_VERSION, sizeof p->version); + strlcpy(p->version, UETH__VERSION, sizeof p->version); strlcpy(p->fw_version, dev->gadget->name, sizeof p->fw_version); strlcpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof p->bus_info); } -- cgit v1.2.3 From 29bac7b7661bbbdbbd32bc1e6cedca22f260da7f Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sat, 6 Sep 2008 21:33:49 -0700 Subject: 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 Cc: stable [2.6.27] Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/u_ether.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/usb/gadget/u_ether.c') diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c index dbd575a194f..66948b72bb9 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); -- cgit v1.2.3