Page MenuHomeFreeBSD

Prolific PL2302 support for high baud rates on HXD chips
ClosedPublic

Authored by gabor.simon75_gmail.com on Aug 9 2018, 9:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 25 2024, 8:37 AM
Unknown Object (File)
Jan 21 2024, 2:50 PM
Unknown Object (File)
Jan 21 2024, 2:49 PM
Unknown Object (File)
Jan 13 2024, 5:37 AM
Unknown Object (File)
Jan 13 2024, 5:37 AM
Unknown Object (File)
Jan 13 2024, 2:54 AM
Unknown Object (File)
Dec 20 2023, 1:22 AM
Unknown Object (File)
Nov 9 2023, 9:21 AM

Details

Summary

Added support for formula-based arbitrary baud rates (in contrast with the
current fixed values) which enables use of rates above 1 Mbps.
Improved the detection of HXD chips, and the status flag handling as well.
For details see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225932

Test Plan

Setting 8 data bits with no parity and writing an endless stream of 0xf0-s
produces 5 high bits followed by 5 low ones, that is, a square wave at a
frequency 1/10 of the baud rate, which can be measured even by a handheld
multimeter.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/usb/serial/uplcom.c
382 ↗(On Diff #46447)

bcdDevice is a 16-bit field. Can you use:

UGETW(dd->bcdDevice)

and update the case values to include the most significant byte as well, likely:

case 3 -> case 0x103 I guess, for example

410 ↗(On Diff #46447)

style:

"case XXX:" should be indented like "switch" keyword.

Fixed bcdDevice detection, fixed indentation style

gabor.simon75_gmail.com added inline comments.
sys/dev/usb/serial/uplcom.c
382 ↗(On Diff #46447)

Done, and extra thx for pointing out a bug: I was checking the 0th (low) byte of bcdDevice instead of the 1st (high) one.

The changes look good to me.

This revision is now accepted and ready to land.Aug 11 2018, 1:21 PM
sys/dev/usb/serial/uplcom.c
382 ↗(On Diff #46447)

And the lower one should be zero I guess.

gabor.simon75_gmail.com added inline comments.
sys/dev/usb/serial/uplcom.c
382 ↗(On Diff #46447)

Definitely :), the specifications contain explicitely 0x300, 0x400 and 0x500.

Since we're at 13-current now, can this be landed?

This revision was automatically updated to reflect the committed changes.