From owner-freebsd-stable@FreeBSD.ORG Sat Apr 5 21:59:00 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07F4A10656C8 for ; Sat, 5 Apr 2008 21:59:00 +0000 (UTC) (envelope-from alec-keyword-freebsd.befd64@SetFilePointer.com) Received: from hamlet.setfilepointer.com (hamlet.SetFilePointer.com [63.224.10.2]) by mx1.freebsd.org (Postfix) with SMTP id 978B98FC27 for ; Sat, 5 Apr 2008 21:58:59 +0000 (UTC) (envelope-from alec-keyword-freebsd.befd64@SetFilePointer.com) Received: (qmail 94108 invoked by uid 4250); 5 Apr 2008 16:32:17 -0500 Received: by hamlet.SetFilePointer.com (tmda-sendmail, from uid 4250); Sat, 05 Apr 2008 16:32:17 -0500 Date: Sat, 5 Apr 2008 16:32:17 -0500 To: Andrei Kolu Message-ID: <20080405213217.GD2207@hamlet.SetFilePointer.com> References: <200804052236.49472.antik@bsd.ee> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="idY8LE8SD6/8DnRI" Content-Disposition: inline In-Reply-To: <200804052236.49472.antik@bsd.ee> User-Agent: Mutt/1.4.2.3i X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alec Kloss X-Primary-Address: alec@SetFilePointer.com Cc: freebsd-stable@freebsd.org, freebsd-usb@freebsd.org Subject: Re: USB to RS232 converter problem (prolific chip) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Apr 2008 21:59:00 -0000 --idY8LE8SD6/8DnRI Content-Type: multipart/mixed; boundary="TybLhxa8M7aNoW+V" Content-Disposition: inline --TybLhxa8M7aNoW+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The the attached patch, also available at http://setfilepointer.com/pub/src:sys:dev:usb:uplcom.c.patch might help. I've needed it to make uplcom stuff work. --=20 Alec Kloss alec@SetFilePointer.com IM: angryspamhater@yahoo.com PGP key at http://pgp.mit.edu:11371/pks/lookup?op=3Dget&search=3D0xA241980E "No Bunny!" -- Simon, from Frisky Dingo --TybLhxa8M7aNoW+V Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="src:sys:dev:usb:uplcom.c.patch" Content-Transfer-Encoding: quoted-printable --- src/sys/dev/usb/uplcom.c.orig Thu Nov 2 13:20:51 2006 +++ src/sys/dev/usb/uplcom.c Thu Nov 2 14:21:19 2006 @@ -154,6 +154,7 @@ =20 #define TYPE_PL2303 0 #define TYPE_PL2303X 1 +#define TYPE_PL2303HX 2 =20 struct uplcom_softc { struct ucom_softc sc_ucom; @@ -233,6 +234,9 @@ { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_RSAQ3, -1, TYPE_PL2303X }, /* PLANEX USB-RS232 URS-03 */ { USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC232A, -1, TYPE_PL2303 }, + /* AJK */ + { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2303, + 0x400, TYPE_PL2303HX }, /* ST Lab USB-SERIAL-4 */ { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2303, 0x300, TYPE_PL2303X }, @@ -381,10 +385,17 @@ =20 #ifdef USB_DEBUG /* print the chip type */ - if (sc->sc_chiptype =3D=3D TYPE_PL2303X) { + switch (sc->sc_chiptype) + { + case TYPE_PL2303HX: + DPRINTF(("uplcom_attach: chiptype 2303HX\n")); + break; + case TYPE_PL2303X: DPRINTF(("uplcom_attach: chiptype 2303X\n")); - } else { + break; + default: DPRINTF(("uplcom_attach: chiptype 2303\n")); + break; } #endif =20 @@ -609,7 +620,9 @@ { UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8383, 0, 0 }, { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0, 1, 0 }, { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 1, 0, 0 }, - { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x44, 0 } + { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 2, 0x44, 0 }, + { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 8, 0, 0 }, + { UT_WRITE_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 9, 0, 0 }, }; #define N_PL2302X_INIT (sizeof(pl2303x)/sizeof(pl2303x[0])) =20 @@ -735,10 +748,18 @@ req.bmRequestType =3D UT_WRITE_VENDOR_DEVICE; req.bRequest =3D UPLCOM_SET_REQUEST; USETW(req.wValue, 0); - if (sc->sc_chiptype =3D=3D TYPE_PL2303X) + switch (sc->sc_chiptype) + { + case TYPE_PL2303HX: USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); - else + break; + case TYPE_PL2303X: + USETW(req.wIndex, UPLCOM_SET_CRTSCTS_PL2303X); + break; + default: USETW(req.wIndex, UPLCOM_SET_CRTSCTS); + break; + } USETW(req.wLength, 0); =20 err =3D usbd_do_request(sc->sc_ucom.sc_udev, &req, 0); @@ -886,7 +907,8 @@ } } =20 - if (sc->sc_chiptype =3D=3D TYPE_PL2303X) + if (sc->sc_chiptype =3D=3D TYPE_PL2303X || + sc->sc_chiptype =3D=3D TYPE_PL2303HX) return (uplcom_pl2303x_init(sc)); =20 return (0); --TybLhxa8M7aNoW+V-- --idY8LE8SD6/8DnRI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFH9+/h2s33paJBmA4RApppAJwP6jkiQY7sUIsneNX7Vx2G75uqCQCfajNY D/KDIKcE4L6JZ77IhlGJSp8= =VGh+ -----END PGP SIGNATURE----- --idY8LE8SD6/8DnRI--