Hi, Thanks for your help.
Assuming that the usb driver is written for kernel v2.4 and above, I suppose I can use the devfs and dynamic allocation of major and minor numbers instead of fixed minors. I read some stuff about it, but since I'm new to Linux I still have a few questions that I would be happy if you could help me with: 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)? 2. Under which directory should I open an entry - /proc/bus/usb/ or /dev? (what are the conventions?) 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? 4. Should I use devfs_register_chrdev() or devfs_register()? Or does using usb_resigter() replace these calls? 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? 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? I know these are awfully too many questions, but I would be grateful to have them answered... Thanks in advance, Amira. -----Original Message----- From: Greg KH [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 30, 2001 7:21 PM To: Amira Solomovici Cc: Linux_Usb_Develop (E-mail) Subject: Re: [linux-usb-devel] USB devices major/minor numbers On Thu, Dec 27, 2001 at 01:39:00PM +0200, Amira Solomovici wrote: > Hi, > > I am writing a usb device driver that is loaded as a module into the kernel. > My question is who allocates the major and minor numbers for my device > driver (it's for a smartcard reader)? I saw in the device list that there > are allocated major number for other usb devices, but not for the type I > need. I'm the person in charge of allocating the usb minor numbers right now. If you will post your driver, and why you think you need a minor number, I (and the mailing list) can review and discuss it. > Also, I understood that there is a way to communicate with the kernel driver > from a user mode application without using the mknod command to create the > link to the driver. I would be grateful if someone could explain how to use > it and how to open a communication channel with the driver if this dynamic > way is used. Your driver can create a /proc entry that userspace can use to talk to your driver. Or it can export a filesystem (like the pci hotplug driver does) and have userspace programs interact with the driver through it. Hope this helps, greg k-h _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel