aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/u_ether.c
diff options
context:
space:
mode:
authorTatyana Brokhman <tlinder@codeaurora.org>2011-06-28 09:33:48 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-28 14:14:36 -0400
commit72c973dd2b01b212a159faa330a2bc641a3ed809 (patch)
tree2fbc36b4103678cd9b7599deaab06f89e4871de2 /drivers/usb/gadget/u_ether.c
parent0f91349b89f37dfad7b77f7829a105b6a0f526ec (diff)
usb: gadget: add usb_endpoint_descriptor to struct usb_ep
Change usb_ep_enable() prototype to use endpoint descriptor from usb_ep. This optimization spares the FDs from saving the endpoint chosen descriptor. This optimization is not full though. To fully exploit this change, one needs to update all the UDCs as well since in the current implementation each of them saves the endpoint descriptor in it's internal (and extended) endpoint structure. Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/u_ether.c')
-rw-r--r--drivers/usb/gadget/u_ether.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 2ac1d2147325..b91363e88db7 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -693,8 +693,8 @@ static int eth_stop(struct net_device *net)
693 usb_ep_disable(link->out_ep); 693 usb_ep_disable(link->out_ep);
694 if (netif_carrier_ok(net)) { 694 if (netif_carrier_ok(net)) {
695 DBG(dev, "host still using in/out endpoints\n"); 695 DBG(dev, "host still using in/out endpoints\n");
696 usb_ep_enable(link->in_ep, link->in); 696 usb_ep_enable(link->in_ep);
697 usb_ep_enable(link->out_ep, link->out); 697 usb_ep_enable(link->out_ep);
698 } 698 }
699 } 699 }
700 spin_unlock_irqrestore(&dev->lock, flags); 700 spin_unlock_irqrestore(&dev->lock, flags);
@@ -871,7 +871,7 @@ struct net_device *gether_connect(struct gether *link)
871 return ERR_PTR(-EINVAL); 871 return ERR_PTR(-EINVAL);
872 872
873 link->in_ep->driver_data = dev; 873 link->in_ep->driver_data = dev;
874 result = usb_ep_enable(link->in_ep, link->in); 874 result = usb_ep_enable(link->in_ep);
875 if (result != 0) { 875 if (result != 0) {
876 DBG(dev, "enable %s --> %d\n", 876 DBG(dev, "enable %s --> %d\n",
877 link->in_ep->name, result); 877 link->in_ep->name, result);
@@ -879,7 +879,7 @@ struct net_device *gether_connect(struct gether *link)
879 } 879 }
880 880
881 link->out_ep->driver_data = dev; 881 link->out_ep->driver_data = dev;
882 result = usb_ep_enable(link->out_ep, link->out); 882 result = usb_ep_enable(link->out_ep);
883 if (result != 0) { 883 if (result != 0) {
884 DBG(dev, "enable %s --> %d\n", 884 DBG(dev, "enable %s --> %d\n",
885 link->out_ep->name, result); 885 link->out_ep->name, result);
@@ -969,7 +969,7 @@ void gether_disconnect(struct gether *link)
969 } 969 }
970 spin_unlock(&dev->req_lock); 970 spin_unlock(&dev->req_lock);
971 link->in_ep->driver_data = NULL; 971 link->in_ep->driver_data = NULL;
972 link->in = NULL; 972 link->in_ep->desc = NULL;
973 973
974 usb_ep_disable(link->out_ep); 974 usb_ep_disable(link->out_ep);
975 spin_lock(&dev->req_lock); 975 spin_lock(&dev->req_lock);
@@ -984,7 +984,7 @@ void gether_disconnect(struct gether *link)
984 } 984 }
985 spin_unlock(&dev->req_lock); 985 spin_unlock(&dev->req_lock);
986 link->out_ep->driver_data = NULL; 986 link->out_ep->driver_data = NULL;
987 link->out = NULL; 987 link->out_ep->desc = NULL;
988 988
989 /* finish forgetting about this USB link episode */ 989 /* finish forgetting about this USB link episode */
990 dev->header_len = 0; 990 dev->header_len = 0;