The problem with reimplementing the usb_register_dev() is the non existing external access to the "static struct file_operations *usb_minors[MAX_USB_MINORS]".
The FPGA board itself has only iso endpoints, the rest of the system is controlled via control messages. One could in principle implement the access via library, but then that would need wrappers for different languges. A file access interface is much much cleaner to do, and something the hardware designers mentally like better :) So now I have working hack, of which I'm not very proud of :( First the probel: usb_set_intfdata(interface, dev); retval = usb_register_dev(interface, &x2s_firmware); if (retval) { err ("Not able to get a minor for this device."); usb_set_intfdata(interface, NULL); goto error; } dev->io_minors[0] = interface->minor; info ("USB X2S device firmware now attached to minor %d", interface->minor); retval = usb_register_dev(interface, &x2s_io); if (retval) { err ("Not able to get a minor for this device."); usb_set_intfdata(interface, NULL); goto error; } dev->io_minors[1] = interface->minor; info ("USB X2S device io now attached to minor %d", interface->minor); retval = usb_register_dev(interface, &x2s_iso); if (retval) { err ("Not able to get a minor for this device."); usb_set_intfdata(interface, NULL); goto error; } dev->io_minors[2] = interface->minor; info ("USB X2S device iso now attached to minor %d", interface->minor); interface->minor = dev->io_minors[0]; dev->minor = interface->minor; and then in the open(): minor = iminor(inode); interface = usb_find_interface(&x2s_driver, minor); if (!interface) { interface = usb_find_interface(&x2s_driver, minor-1); if (!interface) { interface = usb_find_interface(&x2s_driver, minor-2); if (!interface) { err("%s-error, can't find device for minor %d", __FUNCTION__, minor); return -ENODEV; } } } dev = usb_get_intfdata(interface); if (!dev) { return -ENODEV; } index = -1; for (ii=0;ii<X2S_MINORS;ii++) { if (minor == dev->io_minors[ii]) { index = ii; } } dbg ( " - minor is %d, index %i", minor, index); if (index < 0) { return -ENODEV; } regards Jouni On Thu, 2005-08-25 at 15:03 +0200, Clemens Ladisch wrote: > Jouni Rynö wrote: > > I try to upgrade my x2s_usb 2.4 kernel driver to 2.6. > > > > On 2.4 the driver had 6 /dev entries (via devfs) > > > > Now I have to say, that I cannot figure out the proper way to > > generate these /dev entries for the USB-driver. None of the kernel > > provided drivers seem to have that kind of multiple interface. > > The ALSA drivers do this. Their device registrations end up in > snd_register_device() (in sound/core/sound.c). > > The main difference to usb_register_dev() seems to be that the former > stores the minors in a list. I'd guess you'd have to reimplement > usb_register_dev() with this change. > > > HTH > Clemens > -- Jouni Rynö mailto://[EMAIL PROTECTED]/ http://www.geo.fmi.fi/~ryno/ Finnish Meteorological Institute http://www.fmi.fi/ Space Research http://www.geo.fmi.fi/ P.O.BOX 503 Tel (+358)-9-19294656 FIN-00101 Helsinki FAX (+358)-9-19294603 Finland priv-GSM (+358)-50-5302903 "It's just zeros and ones, it cannot be hard" ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel