Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2008 16:32:17 -0500
From:      Alec Kloss <alec-keyword-freebsd.befd64@SetFilePointer.com>
To:        Andrei Kolu <antik@bsd.ee>
Cc:        freebsd-stable@freebsd.org, freebsd-usb@freebsd.org
Subject:   Re: USB to RS232  converter problem (prolific chip)
Message-ID:  <20080405213217.GD2207@hamlet.SetFilePointer.com>
In-Reply-To: <200804052236.49472.antik@bsd.ee>
References:  <200804052236.49472.antik@bsd.ee>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080405213217.GD2207>