Re: starting a new hw driver for gadget support

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

 



On Mon, 30 Jan 2012, Klaus Rudolph wrote:

> > > I really miss a simple beginners guide to the gadget framework where a
> > > simple data flow diagram give answers to these beginners questions.
> > 
> > 
> >  I'm new to this list and also to the field of usb drivers. However i
> > have these documents  Seems it may help you,
> > 
> >  http://www.linux-usb.org/gadget/
> >  http://www.linux-usb.org/gadget/h2-otg.htm

You should also read include/linux/usb/gadget.h.  There are lots of 
comments explaining the various fields and APIs.

> Thanks for the link. I read the docs but could not find a answer to
> my problem.
> 
> My understanding is:
> The function usb_ep_queue gives my the requests which my hardware
> driver could deal with. But for ep0 I have no pending request and the
> first non setup packet with 24 bytes of data could not be handled.

If you have not received a request -- that is, if usb_ep_queue() was 
not called for ep0 -- then the hardware should reply with NAK when the 
24-byte data packet is received.

> The bulk data transfer seems to be quite simple. IN request data must
> be send, OUT requests could be filled with "incoming" OUT data and
> the callback ( complete) is called. Thats all!?

Yes.

> But for ep0 I have no understanding where incoming data
> (OUT-Transfer) should be placed???

It's the same as for bulk transfers -- the UDC driver gets a request 
from usb_ep_queue() and it puts the data there.

However there is one more complication when it comes to ep0.  At the 
end of a control-IN transfer, the UDC will receive a data-OUT packet 
with 0 bytes (the status stage of the transfer).  The hardware should 
reply with ACK and the driver should throw away the packet.

> Maybe someone in the list can give me three sentences to that topic?

Have you read Sections 8.4 and 8.5 in the USB-2.0 specification?

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