> CVSROOT:      /cvs
> Module name:  src
> Changes by:   d...@cvs.openbsd.org    2021/11/02 03:52:40
>
> Modified files:
>       sys/dev/usb    : uchcom.c 
>
> Log message:
> add handling for parity and character size config.
>
> i wanted to talk modbus to a thing using a uchcom rs485 adapter,
> but i needed even parity enabled to do that which the code didnt
> support. this pulls in the necessary changes from netbsd uchcom.c
> r1.26. it does not pull in the reset changes in 1.26 because netbsd
> r1.28 reverts the reset code back to what we have now.
>
> existing functionality tested by felix kronlage-dammers
> ok patrick@

I'm afraid this commits breaks the following UCHCOM device:

uchcom0 at uhub2 port 1 configuration 1 interface 0 "QinHeng Electronics 
USB-SER!" rev 1.10/2.50 addr 2
uchcom0: CH340

Investigation shows that the LCR register value after reset is 0x56,
which would be TXE, PAREVEN, STOPB and CS7, yet the device is in
traditional 8N1 configuration.

The actual LCR bits are either in a different register or with a
different layout in this device.

Therefore it would make sense to only perform LCR modification on
a known-to-be-working list of devices, which would contain only yours,
to begin with... Or maybe yours is a CH341?

Reply via email to