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>
This commit is contained in:
parent
0f91349b89
commit
72c973dd2b
26 changed files with 111 additions and 117 deletions
|
@ -693,8 +693,8 @@ static int eth_stop(struct net_device *net)
|
|||
usb_ep_disable(link->out_ep);
|
||||
if (netif_carrier_ok(net)) {
|
||||
DBG(dev, "host still using in/out endpoints\n");
|
||||
usb_ep_enable(link->in_ep, link->in);
|
||||
usb_ep_enable(link->out_ep, link->out);
|
||||
usb_ep_enable(link->in_ep);
|
||||
usb_ep_enable(link->out_ep);
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&dev->lock, flags);
|
||||
|
@ -871,7 +871,7 @@ struct net_device *gether_connect(struct gether *link)
|
|||
return ERR_PTR(-EINVAL);
|
||||
|
||||
link->in_ep->driver_data = dev;
|
||||
result = usb_ep_enable(link->in_ep, link->in);
|
||||
result = usb_ep_enable(link->in_ep);
|
||||
if (result != 0) {
|
||||
DBG(dev, "enable %s --> %d\n",
|
||||
link->in_ep->name, result);
|
||||
|
@ -879,7 +879,7 @@ struct net_device *gether_connect(struct gether *link)
|
|||
}
|
||||
|
||||
link->out_ep->driver_data = dev;
|
||||
result = usb_ep_enable(link->out_ep, link->out);
|
||||
result = usb_ep_enable(link->out_ep);
|
||||
if (result != 0) {
|
||||
DBG(dev, "enable %s --> %d\n",
|
||||
link->out_ep->name, result);
|
||||
|
@ -969,7 +969,7 @@ void gether_disconnect(struct gether *link)
|
|||
}
|
||||
spin_unlock(&dev->req_lock);
|
||||
link->in_ep->driver_data = NULL;
|
||||
link->in = NULL;
|
||||
link->in_ep->desc = NULL;
|
||||
|
||||
usb_ep_disable(link->out_ep);
|
||||
spin_lock(&dev->req_lock);
|
||||
|
@ -984,7 +984,7 @@ void gether_disconnect(struct gether *link)
|
|||
}
|
||||
spin_unlock(&dev->req_lock);
|
||||
link->out_ep->driver_data = NULL;
|
||||
link->out = NULL;
|
||||
link->out_ep->desc = NULL;
|
||||
|
||||
/* finish forgetting about this USB link episode */
|
||||
dev->header_len = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue