Re: How to handle USB_ENDPOINT_XFER_BULK in gadget API?

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

 



On Thu, 28 Apr 2011 21:04:14 +0200, baseplast wrote:
it means that complete() function at gagdet side handles one endpoint.

In my code i made one complete() function for both 01 and 81 endpoint.

The complete callback is assigned to a request not an endpoint.  Actually
making a single complete function which handless all requests on all
endpoints is most of the time suboptimal.  It's usually much better to
have separate complete functions for endpoints (or even for different
requests but let's not complicate things just now).

Dont understand, how to send readed data from endpoint 81 to host.

in complete function i receiving data correctly, but cant's send any
data back from endpoint 81.

To send data through an IN endpoint, you need to initialise request
correctly and fill the buffer with data.

what correct sequnce to BULK read from endpoint 81 ?
HCD sends usb_ep_queue to endpoint 81, then i need to fill req->buffer
with correct data and return it back, but  how to do this?

No, you need to first fill the buffer and set other fields of the
request and then queue.

In loopback code gadget it just redirects queue from OUT to IN
endpoint. Do i need to make 2 complete functions for 01 and 81
endpoint?

You don't have to but in the end it's more readable and maintainable
as you don't have to have condition in the single complete function.

--
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