Re: Some information on USB API

"Curran, Dominic" <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
> 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?

Correct.


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

I believe the driver stack will look something like this:

App that calls read()                       USERMODE
------------------------------------------
File system driver (like ext3, fat32)       KERNEL MODE
SCSI driver
usbcore
USB Host controller driver (like EHCI)
PCI driver
------------------------------------------
HARDWARE



>    Does the same process happen for all of the devices? 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, but obviously the driver stack looks a little different.
In the case of HID I think it looks something like this...

App like X                                  USERMODE
------------------------------------------
HID                                         KERNEL MODE
usbcore
USB Host controller driver (like EHCI)
PCI driver
------------------------------------------
HARDWARE


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

Yes.
As long as you unload the driver or make sure it doesn't load to start
with.

>Also does libusb work on all
> HCD's(
>UHCI

yes

> EHCI

yes

> Mentor graphics MUSBHDRC etc.,)?

Maybe.  Is there a linux driver for this ?



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