On 09/07/2005 03:50, Greg KH wrote:
On Thu, Jul 07, 2005 at 09:20:44PM +0530, Jayaprakash Shanmugam wrote:
I have one driver serving 4 devices at a time. Can't I have one fixed
minor number for one device ?
When read() / write() into the device, how can I know which device I
am operating on ?
Get the pointer to the device that is associated with that minor number.
See the usb-skeleton driver as an example.
Greg,
I think Jayaprakash wants to asociate the minor number with a physical
device at user level. I think he needs pointing towards the udev tutorials!
Jayprakash,
If possible, you could use four fixed USB serial numbers, one for each
device in a set, and write udev rules to automatically create (and
destroy) symlinks to each device, based on their serial number. The
minor device numbers will change depending on the order you plug in the
devices, but the symlink names will still match the physical device no
matter which minor device number it ends up with. Use the symlinks to
open the device.
If your driver needs to treat the four devices differently from each
other, implement an ioctl so that the application can inform the driver
which device has which rĂ´le.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <[EMAIL PROTECTED]> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel