Re: (Query): [PATCH v4 2/4] usb gadget: Configure endpoint according to gadget speed.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 26 Jul 2012, Rajaram R wrote:

> Hi Felipe/Alan
> 
> Any comments for the below query ?
> 
> On Thu, Jul 12, 2012 at 4:53 PM, Rajaram R <rajaram.officemail@xxxxxxxxx> wrote:
> > Hi
> >
> >
> > On Thu, Nov 18, 2010 at 6:17 PM, Tatyana Brokhman
> > <tlinder@xxxxxxxxxxxxxx> wrote:
> >>
> >> Add config_ep_by_speed() to configure the endpoint according to the gadget
> >> speed. Using this function will spare the FDs from handling the endpoint
> >> chosen descriptor.
> >>
> >> Signed-off-by: Tatyana Brokhman <tlinder@xxxxxxxxxxxxxx>
> >> ---
> >>  drivers/usb/gadget/composite.c  |   76 +++++++++++++++++++++++++++++++++++++++
> >>  drivers/usb/gadget/epautoconf.c |    1 +
> >>  include/linux/usb/composite.h   |   21 +++++++++++
> >>  include/linux/usb/gadget.h      |    3 ++
> >>  4 files changed, 101 insertions(+), 0 deletions(-)
> >>
> > ---cut---
> >
> >> + */
> >> +int config_ep_by_speed(struct usb_gadget *g,
> >> +                       struct usb_function *f,
> >> +                       struct usb_ep *_ep)
> >> +{

...

> >> +ep_found:
> >> +       /* commit results */
> >> +       _ep->maxpacket = le16_to_cpu(chosen_desc->wMaxPacketSize);
> >> +       _ep->desc = chosen_desc;
> 
>  Could you please comment on why do we need to update gadget's ep list
>  with function's maxpacket ? Will this not affect when we switch
>  functions ?

The ep list doesn't belong to the gadget driver; it belongs to the UDC
driver.  The maxpacket has to be adjusted to match the value stored in
the descriptor so that the UDC will tell the hardware to use the right
maxpacket value.

When you switch functions, the new function should call 
config_ep_by_speed().

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux