Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Feb 2018 19:53:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 225932] uplcom Prolific PL2302 doesn't support high baud rates
Message-ID:  <bug-225932-8@https.bugs.freebsd.org/bugzilla/>

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

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225932

            Bug ID: 225932
           Summary: uplcom Prolific PL2302 doesn't support high baud rates
           Product: Base System
           Version: 11.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: gabor.simon75@gmail.com

Created attachment 190665
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=190665&action=edit
proposed patch for high baudrate support

1., Current uplcom module supports only the pre-defined baud rates, because
free baudrate setting requires a divisor calculating formula.

The product page of the vendor refers to the Linux module source as a reference
application (http://lxr.free-electrons.com/source/drivers/usb/serial/pl2303.c),
in which the formula is implemented clearly.

(The baseline frequency constant is about 1/1000 off from the one actually used
by the binary drivers though.)

After porting the formula, the baud rate can be set to any arbitrary value.


2., The current chip type detection is kind of black magic, while the ID values
of the bcdDevice[0] are officially documented in the product datasheets
(http://www.prolific.com.tw/US/ShowProduct.aspx?pcid=41&showlevel=0017-0037-0041)

The current detection could not identify the type HXD chips, so disables the
baud rates above 6 Mbaud, while the chip supports up to 12Mbaud.


3., The current interrupt callback doesn't process neither the
overrun/parity/frame/break error flags, nor the RI and DSR status flags.


As I needed the high bitrates, ported the baudrate formula from the Linux code
, please decide if it is legal or not, there already was a "Determine the chip
type.  This algorithm is taken from Linux." comment in the code.

I also checked the formula against the values used by the binary driver and
corrected the baseline frequency.

Also checked the so-called standard baudrates (that shall work by directly
writing them to dwDTERate register) on a PL2303HX, and removed the non-working
ones.

(For those who want to play with the values: writing 0xf0-s with 8bit no parity
produces one square wave per 10 bits (1 start, 8 data, 1 stop), so measuring
the freqency on TxD gives 1/10th of the actual baud rate :D)

I've attached the patch, the changed file (for an easier review) and the small
freqency test I used.

NOTE: I have only a PL2303HX (bcdDevice[0]==3) at hand now, so it would be
great if someone with other models could test at least the detection code.

-- 
You are receiving this mail because:
You are the assignee for the bug.


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