Re: How to handle USB_ENDPOINT_XFER_BULK in gadget API?

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

 



On Wed, 27 Apr 2011 22:04:24 +0200, baseplast <baseplast@xxxxxxx> wrote:
i looked inside gadget.h and found declaration usb_ep_queue
---
usb_ep_queue(struct usb_ep *ep, struct usb_request *req, gfp_tgfp_flags)
---
but i dint find any call for it in zero.c
however, i found it called inside gmidi.c that is close to my project.
as i realized, each time HCD sends request to my device, gmidi_setup
routine is called. But this routine related only to ep0 control
requests.

Yes, the setup callback is called for control requests only (my
terminology may be wrong here).

After creation of device, i made myendpoints enabled with
        err = usb_ep_enable(dev->in_ep, &bulk_in_desc);
        err = usb_ep_enable(dev->out_ep, &bulk_out_desc);

        ep = dev->out_ep;
        req = alloc_ep_req(ep, buflen);

        then i calling the
        err = usb_ep_queue(ep, req, GFP_ATOMIC);

am i right ?

in what handler do i need to call from in/out endpoints to
receive/send BULK data?

struct usb_request has a complete callback which you need to
set which is called when the request is finished (for OUT
endpoints that means data is available, for IN endpoints
data has been sent to host), cancelled or failed.

Also, if you want to send data you must fill the buffer before
calling usb_ep_queue().

--
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: mnazarewicz@xxxxxxxxxx>-----ooO--(_)--Ooo--
--
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