Hi again! Greg KH a écrit : > >> - usb_serial_probe() is not laid out in a way wich pleases me, and >> this may be useful for others: >> the call to type->calc_num_ports(serial); is done before the >> serial->num_bulk_in = num_bulk_in; >> serial->num_bulk_out = num_bulk_out; >> serial->num_interrupt_in = num_interrupt_in; >> serial->num_interrupt_out = num_interrupt_out; >> so we did calculations to find them, and do not pass them to >> calc_num_ports(), which has to compute again if it needs any >> of them. > > Your driver needs this information in order to determine the number of > ports? Can't you go off of the device id? No, but I should come with some explaination of what I'm doing:
Actually (2.6.19.2 and earlier), when using the generic usb serial driver you can handle only one device type (Vendor/Product) without the need to recompile the driver. (parameters for the module) Here, I got 16 PCI USB Cards, whith 2 OHCI controler each, and 5 USB ports. This allow... too much different devices for the generic driver. Moreover, new different devices can be connected while the driver is in use for already connected devices. So I'm "writting" a "fake" driver, which uses most of the generic one, but is not the generic one. And in usb-serial.c we find this: #ifdef CONFIG_USB_SERIAL_GENERIC if (type == &usb_serial_generic_device) { num_ports = num_bulk_out; I do not want to add another /* BEGIN HORRIBLE HACK FOR MY DRIVER */ Why don't I simply modify the generic driver ? Because I need other functionnalities like "static" allocation of tty numbers (just think of the number of cables connected to the PC, and try to immagine yourself trying to find which ttyUSB is which device....) Then, it seems I will have to hack more in the usb-serial for this, so I may have used the generic driver finaly. > If not, then yes, when your driver is accepted into the kernel tree, I'd > be glad to take a patch moving these values to be set before the call to > calc_num_ports. Some of my modifications may rather be merged into the generic driver, and if you are interested in this, I can try to do a patch when this is OK > Which device are you creating a driver for? Any "generic compliant" device. > > thanks, > > greg k-h Have fun :) +++ nathael ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel