On Thu, Jan 25, 2007 at 10:25:34AM +0100, Nathael Pajani wrote:
> 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)
Don't use the generic driver for any real device, it's not made for that
at all.
> 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.
You can do that in very few lines, look at the funsoft.c driver for such
an example. I recommend doing that.
> 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 will not let you :)
> 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....)
That's what sysfs and udev solve.
> Then, it seems I will have to hack more in the usb-serial for this, so I
> may have used the generic driver finaly.
Care to post what you have? I still don't see why you are doing
something different from what everyone else has been doing for a while.
thanks,
greg k-h
-------------------------------------------------------------------------
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
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel