Re: Some information on USB API

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Mon, 30 Apr 2007, Meher wrote:

> Hi,
>      I would like to know if there is any specific API that will be
> used by the Applications that read/write to USB devices. For example
> if a flash device is plugged into a system then the HCD will enumerate
> the device and load the appropriate device driver for that flash
> device to handle the device. Now say if the USB flash drive is mounted
> as /dev/flashd. Then application will not even bother if he is a USB
> device or  on board flash and just do the normal read/write from
> /dev/flashd?

That's right.  Applications don't care whether the device they are using 
is a USB device, an IDE device, a SCSI device, or anything else.

>     When application does a read or even mount of the flash device how
> is that information passed on to the device driver so that it can
> convert that to specific Ctrl/Bulk transfer types and pass it on to
> HCD?

It depends on the driver.  With the usb-storage driver Read and Write
requests go through the SCSI core, where they are encapsulated in
scsi_cmnd structures and passed to the queuecommand() routine in 
usb_storage.

>    Does the same process happen for all of the devices?

The process depends on the driver, but the end result is the same.

> Like if a USB
> keyboard is connected and if I want to read from USB keyboard, I will
> still read from standard keyboard interface?

Yes.

>    If I use libusb, can I get develop the driver in the user space and
> get rid of the driver at kernel level?

Yes.  That is, your program can communicate with the USB device, with no
need for a kernel driver.  However your userspace program may not be able
to communicate with other parts of the kernel in the same way as a kernel
driver.

> Also does libusb work on all
> HCD's(UHCI, EHCI, Mentor graphics MUSBHDRC etc.,)?

Yes.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.