lkml.org 
[lkml]   [2014]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC] usb: gadget: Add xilinx axi usb2 device support
Hi,

On Wed, Mar 26, 2014 at 03:37:52PM +0530, sundeep subbaraya wrote:
> >> + INIT_LIST_HEAD(&req->queue);
> >
> > remove this INIT_LIST_HEAD();
> >
> > also, before returning, I suppose you probably want to link the request
> > to the endpoint somehow. Usually people save the endpoint pointer inside
> > the private request structure (iow: req->ep = ep;)
> >
>
> in ep_queue (say,for IN transaction) the driver copies the gadget
> driver buffer to HW endpoint buffer and if whole data
> has been transferred successfully then request is not added to
> endpoint request list. Hence INIT_LIST_HEAD(&req->queue)
> is required since list_add_tail is not done every time in ep_queue. Is
> it ok to let this be here?o

my bad, you _do_ need this INIT_LIST_HEAD() here. When I first read, I
thought you were initializing struct usb_request list_head, and that is
not necessary ;-)

> >> + if (req != NULL)
> >> + list_add_tail(&req->queue, &ep->queue);
> Here. INIT_LIST_HEAD(&req->queue) is required in alloc_req since
> list_add_tail is not executed every time.
>
> Could you please clarify my questions regarding requests queuing.
> 1. If Device need to send 5120 bytes to host and
> ep->desc->wMaxPacketSize is 512 then single request with length 5120
> is issued or 10 requests are issued?

single request.

> 2. Does device need to know OUT transactions before hand so that OUT
> requests are queued for endpoint before packets are received
> from host?

well, no. Gadget driver shouldn't depend on that. That's UDC driver's
responsability to manage that. I mean, if host sends OUT token and
there's nothing in the out queue, then UDC need to start transfer as
soon as gadget driver queues the request. If, on the other hand, gadget
driver queues packet before host has sent OUT token then you have two
choices:

1) start the transfer - most HW will wait for OUT token
2) wait for out token

--
balbi
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-04-16 05:01    [W:0.202 / U:1.912 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site