From: "Barry K. Nathan" <barryn@pobox.com>
To: marcelo@conectiva.com.br, greg@kroah.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.4.20-pre10: make PL-2303 hack work again
Date: Sat, 12 Oct 2002 17:42:49 -0700 [thread overview]
Message-ID: <20021013004249.GC17162@ip68-4-86-174.oc.oc.cox.net> (raw)
In-Reply-To: <20021012205604.GB17162@ip68-4-86-174.oc.oc.cox.net>
The following patch allows the PL-2303 hack to work again. It applies
to and has been tested with 2.4.20-pre10. Testing included using an ISDN
"modem" connected to the PL-2303 to do some web browsing and some
downloads (including a gzipped Linux 2.5.42 tarball).
The patch resurrects a sanity check (or so it appears to me) which was
removed in 2.4.20-pre2. However, the new version of the check is
contained within the PL-2303 hack #ifdef's, and it no longer relies on
variables like interrupt_pipe which have been removed from the USB
serial code.
Given that 2.4.19 works with my PL-2303 and 2.4 is supposed to be a
"stable" series, I'd appreciate if this patch (or another which fixes my
problem) could be merged. If this patch needs improvements first, please
let me know.
-Barry K. Nathan <barryn@pobox.com>
diff -ru linux-2.4.20-pre10/drivers/usb/serial/usbserial.c linux-2.4.20-pre10-bkn4/drivers/usb/serial/usbserial.c
--- linux-2.4.20-pre10/drivers/usb/serial/usbserial.c 2002-09-26 02:23:00.000000000 -0700
+++ linux-2.4.20-pre10-bkn4/drivers/usb/serial/usbserial.c 2002-10-12 17:21:00.000000000 -0700
@@ -1182,11 +1182,11 @@
#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 (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))) {
+ 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))) {
+ if (ifnum == 1) {
/* check out the endpoints of the other interface*/
interface = &dev->actconfig->interface[ifnum ^ 1];
iface_desc = &interface->altsetting[0];
@@ -1201,6 +1201,15 @@
}
}
}
+
+ /* Now make sure the PL-2303 is configured correctly.
+ * If not, give up now and hope this hack will work
+ * properly during a later invocation of usb_serial_probe
+ */
+ if (num_bulk_in == 0 || num_bulk_out == 0) {
+ info("PL-2303 hack: descriptors matched but endpoints did not");
+ return NULL;
+ }
}
/* END HORRIBLE HACK FOR PL2303 */
#endif
Only in linux-2.4.20-pre10-bkn4/drivers/usb/serial: usbserial.c~
next prev parent reply other threads:[~2002-10-13 0:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-09 23:36 [BUG] pl2303 oops in 2.4.20-pre10 (and 2.5 too) Barry K. Nathan
2002-10-09 23:53 ` Greg KH
2002-10-11 2:39 ` Barry K. Nathan
[not found] ` <20021011170623.GB4123@kroah.com>
2002-10-12 6:30 ` Barry K. Nathan
2002-10-12 20:56 ` Barry K. Nathan
2002-10-13 0:42 ` Barry K. Nathan [this message]
2002-10-13 1:16 ` [PATCH] 2.4.20-pre10: make PL-2303 hack work again Greg KH
2002-10-13 1:54 ` Barry K. Nathan
2002-10-13 4:30 ` [PATCH/RFC] 2.5.42 partial fix for older pl2303 Barry K. Nathan
2002-10-13 20:25 ` Greg KH
2002-10-14 2:49 ` Barry K. Nathan
2002-10-14 4:17 ` Barry K. Nathan
2002-10-15 5:52 ` Greg KH
2002-10-13 0:49 ` [BUG] pl2303 oops in 2.4.20-pre10 (and 2.5 too) Greg KH
2002-10-13 1:26 ` Barry K. Nathan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021013004249.GC17162@ip68-4-86-174.oc.oc.cox.net \
--to=barryn@pobox.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).