> 1. What's the difference between usbdevfs and devfs? Is there a way of
> searching the /proc/bus/usb directory for a file entry (driver) that manages
> a certain device (by checking its vendor and product id)?

Usbdevfs is a file system for getting information about usb devices and
user space drivers for usb devices. If you are writing a kernel driver you
should not think about usbdevfs at all.

> 2. Under which directory should I open an entry - /proc/bus/usb/ or /dev?
> (what are the conventions?)

/dev or whereever devfs is mounted. You have no choice in this matter.

> 3. If my driver should be able to manage more than one device, should I
> register at init() or probe() all the entries? or do it only on demand?

You should register them at probe() by returning non NULL values from
probe().

> 4. Should I use devfs_register_chrdev() or devfs_register()? Or does using
> usb_resigter() replace these calls?

usb_register() registers the driver, not the devices. It'll cause your
probe() method to be called for matching unclaimed and new devices.
If you are writing a driver for a character device use the appropriate
devfs function.

> 5. Can I know when a new device is attached (at the probe() function) what's
> its minor? Can I get a dynamic major number but force the minor? What's the
> purpose of the minor entry in the usb_device structure?

You in the driver decide the minor.

> 6. After registering the driver, the user mode application can communicate
> with the driver by simply opening the associated file descriptor. So what're
> the major and minor numbers used for?

To allow you or the system administrator to assign a name and, much more
importantely, a set of access permissions to the device.
Should you choose to work with devfs only the major:minor combination
becomes just a token to help you recognise which device is referred to.

        HTH
                Oliver



_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to