¹ÚÈ£»ó wrote:
Hello.
I used ¡®Gadget Driver¡¯ to test my USB RDK.
However, I have a question.
In Gadget Driver, how read() and write() are operated ?

The read() and write() system calls are from user mode, so to make them work you'd write a gadget driver that hooks up to userspace through a file descriptor. It'd convert userspace read()/write() calls into requests to the USB endpoints ... usb_ep_queue() to issue such a request, the read() being for OUT endpoints (inside the device) and write() for IN endpoints (to host).


Generally, read(fd, ¡¦, ) and write(fd, ¡¦, ) are used or ioctl() is used.
Then, in Gadget Driver, how read and write is realized?

One place to learn about this is in the O'Reilly book about "Linux Device Drivers". Look at what it says about "character device" drivers, starting in chapter 3.

Oh, and avoid ioctl().  There are times it's the right
answer, but those aren't common cases.

- Dave




------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to