Yes. Thats correct. Thanks for your suggestion. I will try it out.
Currently I am stuck up in probe(). I have two devices for one driver. The kernel reports error when it probes for the second device. While my first device is plugged in, it didnt complain anything. But it reports BUG if I plug in the second device as follows: devfs_mk_dev: could not append to parent for USBHClassDriver kernel BUG in sysfs_create_file at fs/sysfs/file.c:381! Oops: Exception in kernel mode, sig: 5 [#1] PREEMPT NIP: C009A580 LR: C012381C SP: C0783D30 REGS: c0783c80 TRAP: 0700 Not tainted MSR: 00029032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11 TASK = c054d3d0[35] 'khubd' THREAD: c0782000 Last syscall: -1 GPR00: 00000001 C0783D30 C054D3D0 00000000 C0267230 C009A8F4 CF2BAFDE 0000000A GPR08: FFFFFFFF 00000001 00000001 00000000 24008024 FFFFFFFF 0FFFE000 00000000 GPR16: 00000001 00000001 C0260000 C0150000 C0210000 CF0D1260 C0210000 C01F0000 GPR24: 00000001 C01F0000 FFFFFFED 00000000 CF4AE760 00000040 D106C118 CFF81C20 NIP [c009a580] sysfs_create_file+0x2c/0x40 LR [c012381c] class_device_create_file+0x20/0x38 Call trace: [c0152074] usb_register_dev+0x164/0x198 [d1069d20] USBH__iProbe+0x4c/0xf8 [USBH1C1] [c0146bac] usb_probe_interface+0xd8/0x108 [c0122544] driver_probe_device+0x4c/0xa0 [c01225f0] device_attach+0x58/0xe0 [c01229d8] bus_add_device+0x7c/0xe4 [c0121048] device_add+0xd8/0x18c [c01507b0] usb_set_configuration+0x2dc/0x434 [c014a2ec] usb_new_device+0x110/0x200 [c014b610] hub_port_connect_change+0x340/0x528 [c014bc38] hub_events+0x440/0x548 [c014bd80] hub_thread+0x40/0xe8 [c00064a4] kernel_thread+0x44/0x60 I do the following in Probe: retval = usb_register_dev(interface, &USBH__stClassDriver); and I call usb_register() in my init(). Regards, Jayaprakash On 7/11/05, Ian Abbott <[EMAIL PROTECTED]> wrote: > 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