On Thu, Jun 07, 2001 at 07:00:09PM -0400, Ed Tomlinson wrote:
> The app did not complain that it could not open the device but no
> data was exchanged, so the device opened but data did not move. Notice
> in the log that the end point did not get reconized...
Yeah, that's just the second interface not getting "attached" properly.
It's a side effect of the wierd way the device is used.
> > thanks for testing this,
>
> Welcome. Please free to send any updates to me.
>
> Also have experienced a few panics since after rmmod pl2303 and usbserial...
> Experimental code tends to do this at times.
Yeah, sorry about this. I didn't write the driver, but only ported it
from 2.2.x. I can't test it out due to me not having the device.
I've attached a patch that applies on top of the last one I sent out.
It adds support for another device that this driver should work for, and
moves the printk messages to the proper logging level.
If you could load the module with "debug=1" option and send me the
kernel debug log for when you try to send data, I'll see what I can do.
> <rant>
> Also my messages are not making it to the list. Seems sourceforge has
> started to use DULS. There was a small 'rebellion' on lkml when they
> tried it their. Wonder how long it takes for sourceforge to get the
> messages that DULS stinks (yes I _do_ know how to get around it). I
> use my own smpt server since my isp has had problems.
> </rant>
I didn't realize this. I agree that this is not a good thing, and I was
wondering why I didn't see your responses show up there.
thanks for your help,
greg k-h
diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
--- a/drivers/usb/serial/pl2303.c Thu Jun 7 16:17:17 2001
+++ b/drivers/usb/serial/pl2303.c Thu Jun 7 16:17:17 2001
@@ -69,6 +69,7 @@
static __devinitdata struct usb_device_id id_table [] = {
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) },
+ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
{ } /* Terminating entry */
};
@@ -243,8 +244,8 @@
char buf[64];
- printk("throttle %s: %d....\n", tty_name(tty, buf),
- tty->ldisc.chars_in_buffer(tty));
+ dbg("throttle %s: %d....", tty_name(tty, buf),
+ tty->ldisc.chars_in_buffer(tty));
//FIXME FIXME FIXME
if (I_IXOFF(tty))
@@ -266,8 +267,8 @@
char buf[64];
- printk("unthrottle %s: %d....\n", tty_name(tty, buf),
- tty->ldisc.chars_in_buffer(tty));
+ dbg("unthrottle %s: %d....", tty_name(tty, buf),
+ tty->ldisc.chars_in_buffer(tty));
//FIXME FIXME FIXME FIXME FIXME
if (I_IXOFF(tty)) {
@@ -300,14 +301,14 @@
i = usb_control_msg (serial->dev, usb_rcvctrlpipe (serial->dev, 0),
0x21, 0xa1, 0, 0, buf, 7, 100);
- printk ("0xa1:0x21:0:0 %d - %x %x %x %x %x %x %x\n", i,
- buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
+ dbg ("0xa1:0x21:0:0 %d - %x %x %x %x %x %x %x", i,
+ buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
1, 0x40, 0, 1, NULL, 0, 100);
- printk ("0x40:1:0:1 %d\n", i);
+ dbg ("0x40:1:0:1 %d", i);
@@ -398,32 +399,32 @@
i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
0x20, 0x21, 0, 0, buf, 7, 100);
- printk ("0x21:0x20:0:0 %d \n", i);
+ dbg ("0x21:0x20:0:0 %d", i);
i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
0x22, 0x21, 1, 0, NULL, 0, 100);
- printk ("0x21:0x22:1:0 %d\n", i);
+ dbg ("0x21:0x22:1:0 %d", i);
i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
0x22, 0x21, 3, 0, NULL, 0, 100);
- printk ("0x21:0x22:3:0 %d\n", i);
+ dbg ("0x21:0x22:3:0 %d", i);
buf[0] = buf[1] = buf[2] = buf[3] = buf[4] = buf[5] = buf[6] = 0;
i = usb_control_msg (serial->dev, usb_rcvctrlpipe (serial->dev, 0),
0x21, 0xa1, 0, 0, buf, 7, 100);
- printk ("0xa1:0x21:0:0 %d - %x %x %x %x %x %x %x\n", i,
- buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
+ dbg ("0xa1:0x21:0:0 %d - %x %x %x %x %x %x %x", i,
+ buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
if (cflag & CRTSCTS) {
i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
0x01, 0x40, 0x0, 0x41, NULL, 0, 100);
- printk ("0x40:0x1:0x0:0x41 %d \n", i);
+ dbg ("0x40:0x1:0x0:0x41 %d", i);
}
@@ -447,12 +448,12 @@
#define FISH(a,b,c,d) \
i=usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev,0), \
b, a,c , d, buf, 1, 100); \
- printk("0x%x:0x%x:0x%x:0x%x %d - %x\n",a,b,c,d,i,buf[0]);
+ dbg("0x%x:0x%x:0x%x:0x%x %d - %x",a,b,c,d,i,buf[0]);
#define SOUP(a,b,c,d) \
i=usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev,0), \
b, a,c , d, NULL, 0, 100); \
- printk("0x%x:0x%x:0x%x:0x%x %d\n",a,b,c,d,i);
+ dbg("0x%x:0x%x:0x%x:0x%x %d",a,b,c,d,i);
FISH (0xc0, 1, 0x8484, 0);
@@ -530,7 +531,7 @@
if ((i = usb_submit_urb (port->read_urb))) {
err ("usb_submit_urb(read bulk 1) failed");
- printk ("i=%d\n", i);
+ dbg ("i=%d", i);
pl2303_close (port, NULL);
return -EPROTO;
@@ -538,7 +539,7 @@
if ((i = usb_submit_urb (port->interrupt_in_urb))) {
err ("usb_submit_urb(interrupt ink) failed");
- printk ("i=%d\n", i);
+ dbg ("i=%d", i);
pl2303_close (port, NULL);
return -EPROTO;
@@ -608,7 +609,7 @@
// int ret, mask;
- printk ("pl2303_sio ioctl 0x%04x\n", cmd);
+ dbg ("pl2303_sio ioctl 0x%04x", cmd);
/* Based on code from acm.c and others */
switch (cmd) {
@@ -700,22 +701,22 @@
return;
}
-#ifdef DEBUG
- if (urb->actual_length) {
- printk (KERN_DEBUG __FILE__ ": BULK data read - length = %d, data = ",
- urb->actual_length);
- for (i = 0; i < urb->actual_length; ++i) {
- printk ("%.2x ", data[i]);
+ if (debug) {
+ if (urb->actual_length) {
+ printk (KERN_DEBUG __FILE__ ": BULK data read - length = %d,
+data = ",
+ urb->actual_length);
+ for (i = 0; i < urb->actual_length; ++i) {
+ printk ("%.2x ", data[i]);
+ }
+ printk ("\n");
}
- printk ("\n");
}
-#endif
tty = port->tty;
if (urb->actual_length) {
for (i = 0; i < urb->actual_length; ++i) {
if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
- printk ("ARGH ------------ Flip buffer overrun...\n");
+ dbg ("ARGH ------------ Flip buffer overrun...");
break;
}
@@ -755,7 +756,7 @@
if (urb->status) {
- printk ("Overflow in write\n");
+ dbg ("Overflow in write");
dbg ("nonzero write bulk status received: %d", urb->status);
//need to resubmit frame;
@@ -822,8 +823,7 @@
static int __init pl2303_init (void)
{
usb_serial_register (&pl2303_device);
- info(DRIVER_VERSION);
- info(DRIVER_DESC);
+ info(DRIVER_VERSION " : " DRIVER_DESC);
return 0;
}
diff -Nru a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
--- a/drivers/usb/serial/pl2303.h Thu Jun 7 16:17:17 2001
+++ b/drivers/usb/serial/pl2303.h Thu Jun 7 16:17:17 2001
@@ -10,3 +10,6 @@
#define PL2303_VENDOR_ID 0x067b
#define PL2303_PRODUCT_ID 0x2303
+#define ATEN_VENDOR_ID 0x0557
+#define ATEN_PRODUCT_ID 0x2008
+
diff -Nru a/drivers/usb/serial/usbserial.c b/drivers/usb/serial/usbserial.c
--- a/drivers/usb/serial/usbserial.c Thu Jun 7 16:17:17 2001
+++ b/drivers/usb/serial/usbserial.c Thu Jun 7 16:17:17 2001
@@ -1098,21 +1098,24 @@
#if defined(CONFIG_USB_SERIAL_PL2303) || defined(CONFIG_USB_SERIAL_PL2303_MODULE)
/* BEGIN HORRIBLE HACK FOR PL2303 */
/* this is needed due to the looney way its endpoints are set up */
- 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];
- iface_desc = &interface->altsetting[0];
- for (i = 0; i < iface_desc->bNumEndpoints; ++i) {
- endpoint = &iface_desc->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;
+ if (ifnum == 1) {
+ if (((dev->descriptor.idVendor == PL2303_VENDOR_ID) &&
+ (dev->descriptor.idProduct == PL2303_PRODUCT_ID)) ||
+ ((dev->descriptor.idVendor == ATEN_VENDOR_ID) &&
+ (dev->descriptor.idProduct == ATEN_PRODUCT_ID))) {
+ /* check out the endpoints of the other interface*/
+ interface = &dev->actconfig->interface[ifnum ^ 1];
+ iface_desc = &interface->altsetting[0];
+ for (i = 0; i < iface_desc->bNumEndpoints; ++i) {
+ endpoint = &iface_desc->endpoint[i];
+ if ((endpoint->bEndpointAddress & 0x80) &&
+ ((endpoint->bmAttributes & 3) == 0x03)) {
+ /* we found a interrupt in endpoint */
+ dbg("found interrupt in for Prolific device on
+separate interface");
+ interrupt_pipe = HAS;
+ interrupt_in_endpoint[num_interrupt_in] =
+endpoint;
+ ++num_interrupt_in;
+ }
}
}
}