Recently, a new chip revision of the PL2303 USB-to-serial converter, PL2303HXN, appeared on the market. This family includes 6 variants, PL2303GC (0x23a3), PL2303GB (0x23b3), PL2303GT (0x23c3), PL2303GL (0x23d3), PL2303GE (0x23e3), and PL2303GS (0x23f3).
This commit adds support of these new chips. Changes includes:
0. Overall, the new PL2303HXN is very similar to PL2303HX. Very little change is needed.
- PL2303HXN uses a different bRequest, UPLCOM_SET_REQUEST_PL2303HXN (0x80) to set registers, the previous UPLCOM_SET_REQUEST (0x01) cannot be used. Coincidentally, this fact allows us to distinguish PL2303HXN from PL2303HX by issuing an old-style UPLCOM_SET_REQUEST on a status register and checking for an error.
- PL2303HXN uses different registers to set and clear RTS/CTS.
- The previous initialization sequences, uplcom_reset() and uplcom_pl2303_init() are no longer needed.
- In addition, PL2303HXN uses a different command to perform the "upstream data pipe" reset.
- Like PL2303HX, PL2303HXN supports baud rates up to 12Mb.
Code changes in this commit were obtained from straight from OpenBSD's uplcom.c with almost no modification, the list of chip names and USB PIDs was obtained from Linux.
This is my first patch to FreeBSD. I have no idea on how to pick a reviewer, so I just selected two based on the historical commit logs. Apologize if it's not appropriate.