--- linux-2.2.16-usb/./drivers/usb/serial/usb-serial.h Mon May 7 01:26:48 2001 +++ linux-2.2.16-usb-james/./drivers/usb/serial/usb-serial.h Fri Oct 27 04:41:25 2000 @@ -49,6 +49,13 @@ int bulk_out_size; struct urb * write_urb; + spinlock_t lock; + unsigned char *xmit_buf; + int xmit_head; + int xmit_tail; + int xmit_cnt; + + wait_queue_head_t write_wait; void * private; /* data private to the specific port */ @@ -117,6 +124,7 @@ extern struct usb_serial_device_type handspring_device; +extern struct usb_serial_device_type pl2303_device; extern struct usb_serial_device_type whiteheat_fake_device; extern struct usb_serial_device_type whiteheat_device; extern struct usb_serial_device_type ftdi_sio_device; --- linux-2.2.16-usb/./drivers/usb/serial/usbserial.c Mon May 7 01:26:48 2001 +++ linux-2.2.16-usb-james/./drivers/usb/serial/usbserial.c Mon Oct 30 00:36:23 2000 @@ -226,6 +226,9 @@ #else #undef DEBUG #endif + +#undef DEBUG + #include /* Module information */ @@ -234,6 +237,8 @@ #include "usb-serial.h" +#include "pl2303.h" + #define MAX(a,b) (((a)>(b))?(a):(b)) /* function prototypes for a "generic" type serial converter (no flow control, not all endpoints needed) */ @@ -284,6 +289,9 @@ &whiteheat_fake_device, &whiteheat_device, #endif +#ifdef CONFIG_USB_SERIAL_PL2303 + &pl2303_device, +#endif #ifdef CONFIG_USB_SERIAL_VISOR &handspring_device, #endif @@ -841,6 +849,8 @@ } #ifdef DEBUG +#endif +#if 1 if (urb->actual_length) { printk (KERN_DEBUG __FILE__ ": data read - length = %d, data = ", urb->actual_length); for (i = 0; i < urb->actual_length; ++i) { @@ -968,7 +978,30 @@ interrupt_in_endpoint[num_interrupt_in] = endpoint; ++num_interrupt_in; } + } + +/* BEGIN HORRIBLE HACK FOR PL2303*/ + + if ((dev->descriptor.idVendor == PL2303_VENDOR_ID) && + (dev->descriptor.idProduct == PL2303_PRODUCT_ID) && (ifnum==1)) { + + /* check out the endpoints of the other interface*/ + interface = &dev->actconfig->interface[ifnum ^ 1].altsetting[0]; + for (i = 0; i < interface->bNumEndpoints; ++i) { + endpoint = &interface->endpoint[i]; + + if ((endpoint->bEndpointAddress & 0x80) && + ((endpoint->bmAttributes & 3) == 0x03)) { + /* we found a interrupt in endpoint */ + dbg("found interrupt in"); + interrupt_pipe = HAS; + interrupt_in_endpoint[num_interrupt_in] = endpoint; + ++num_interrupt_in; + } } + } + +/*END HORRIBLE HACK FOR PL2303 */ /* verify that we found all of the endpoints that we need */ if (!((interrupt_pipe & type->needs_interrupt_in) &&