hi,
recently I've got reports of a pocketpc device with two pairs of
endpoints (most have only one). the right way would be to add a separate
usb_serial_device_type to deal with them in ipaq.c. however, pocketpc devices
breed like flies, and I really don't want to keep track of which have 2 ports
and which don't.
so... what if I add some logic to usb_serial_probe to deal with
type->num_ports set to NUM_DONT_CARE, like the patch appended below
(note: patch hasn't even been compiled. just wanted to know if the approach
is ok)
ganesh
===== usbserial.c 1.58 vs edited =====
--- 1.58/drivers/usb/serial/usbserial.c Sat Sep 13 02:08:55 2003
+++ edited/usbserial.c Fri Nov 21 21:03:05 2003
@@ -1232,7 +1232,14 @@
}
} else
#endif
- num_ports = type->num_ports;
+ /* we don't use num_ports here cauz some devices have more endpoint pairs than
ports */
+ max_endpoints = max(num_bulk_in, num_bulk_out);
+ max_endpoints = max(max_endpoints, num_interrupt_in);
+ num_ports = type->num_ports;
+ if (num_ports == NUM_DONT_CARE) {
+ num_ports = max_endpoints;
+ }
+ max_endpoints = max(max_endpoints, num_ports);
serial = get_free_serial (num_ports, &minor);
if (serial == NULL) {
@@ -1327,10 +1334,6 @@
}
/* initialize some parts of the port structures */
- /* we don't use num_ports here cauz some devices have more endpoint pairs than
ports */
- max_endpoints = max(num_bulk_in, num_bulk_out);
- max_endpoints = max(max_endpoints, num_interrupt_in);
- max_endpoints = max(max_endpoints, (int)serial->num_ports);
dbg("%s - setting up %d port structures for this device", __FUNCTION__,
max_endpoints);
for (i = 0; i < max_endpoints; ++i) {
port = &serial->port[i];
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel