[PATCH v2 0/2] MR9968: serial: Fixed maximum baud rate for devices >115200 baud.
This fix is necessary to allow for applications that use GetCommProperties() where the hardware device uses a baud rate >115200. Without, these devices and applications are non-functional. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59290 -- v2: serial: Added BAUD_128K as a valid SettableBaud for end-devices using it. https://gitlab.winehq.org/wine/wine/-/merge_requests/9968
From: Myles Gray <winehq.x4aeq@simplelogin.com> This fix is necessary to allow for applications that use GetCommProperties() where the hardware device uses a baud rate >115200. Without, these devices and applications are non-functional. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59290 --- dlls/ntdll/unix/serial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/serial.c b/dlls/ntdll/unix/serial.c index 7a79dd0ac6a..23946d4ff5d 100644 --- a/dlls/ntdll/unix/serial.c +++ b/dlls/ntdll/unix/serial.c @@ -376,14 +376,14 @@ static NTSTATUS get_properties(int fd, SERIAL_COMMPROP *prop) prop->ServiceMask = SP_SERIALCOMM; prop->MaxTxQueue = 4096; prop->MaxRxQueue = 4096; - prop->MaxBaud = BAUD_115200; + prop->MaxBaud = BAUD_USER; prop->ProvSubType = PST_RS232; prop->ProvCapabilities = PCF_DTRDSR | PCF_PARITY_CHECK | PCF_RTSCTS | PCF_TOTALTIMEOUTS | PCF_INTTIMEOUTS; prop->SettableParams = SP_BAUD | SP_DATABITS | SP_HANDSHAKING | SP_PARITY | SP_PARITY_CHECK | SP_STOPBITS ; prop->SettableBaud = BAUD_075 | BAUD_110 | BAUD_134_5 | BAUD_150 | BAUD_300 | BAUD_600 | BAUD_1200 | BAUD_1800 | BAUD_2400 | BAUD_4800 | - BAUD_9600 | BAUD_19200 | BAUD_38400 | BAUD_57600 | BAUD_115200 ; + BAUD_9600 | BAUD_19200 | BAUD_38400 | BAUD_57600 | BAUD_115200 | BAUD_USER ; prop->SettableData = DATABITS_5 | DATABITS_6 | DATABITS_7 | DATABITS_8 ; prop->SettableStopParity = STOPBITS_10 | STOPBITS_15 | STOPBITS_20 | PARITY_NONE | PARITY_ODD |PARITY_EVEN | PARITY_MARK | PARITY_SPACE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9968
From: Myles Gray <winehq.x4aeq@simplelogin.com> --- dlls/ntdll/unix/serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/serial.c b/dlls/ntdll/unix/serial.c index 23946d4ff5d..a8585bbced9 100644 --- a/dlls/ntdll/unix/serial.c +++ b/dlls/ntdll/unix/serial.c @@ -383,7 +383,7 @@ static NTSTATUS get_properties(int fd, SERIAL_COMMPROP *prop) SP_PARITY | SP_PARITY_CHECK | SP_STOPBITS ; prop->SettableBaud = BAUD_075 | BAUD_110 | BAUD_134_5 | BAUD_150 | BAUD_300 | BAUD_600 | BAUD_1200 | BAUD_1800 | BAUD_2400 | BAUD_4800 | - BAUD_9600 | BAUD_19200 | BAUD_38400 | BAUD_57600 | BAUD_115200 | BAUD_USER ; + BAUD_9600 | BAUD_19200 | BAUD_38400 | BAUD_57600 | BAUD_115200 | BAUD_128K | BAUD_USER ; prop->SettableData = DATABITS_5 | DATABITS_6 | DATABITS_7 | DATABITS_8 ; prop->SettableStopParity = STOPBITS_10 | STOPBITS_15 | STOPBITS_20 | PARITY_NONE | PARITY_ODD |PARITY_EVEN | PARITY_MARK | PARITY_SPACE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9968
Hi @magnix, thanks for submitting. I don't know this area very well. I think @zfigura or @julliard are better suited as reviewers here. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9968#note_128356
I think Alex is the resident serial expert, so hopefully he can review this. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9968#note_128397
Alex Henrie (@alexhenrie) commented about dlls/ntdll/unix/serial.c:
prop->ServiceMask = SP_SERIALCOMM; prop->MaxTxQueue = 4096; prop->MaxRxQueue = 4096; - prop->MaxBaud = BAUD_115200; + prop->MaxBaud = BAUD_USER; prop->ProvSubType = PST_RS232; prop->ProvCapabilities = PCF_DTRDSR | PCF_PARITY_CHECK | PCF_RTSCTS | PCF_TOTALTIMEOUTS | PCF_INTTIMEOUTS; prop->SettableParams = SP_BAUD | SP_DATABITS | SP_HANDSHAKING | SP_PARITY | SP_PARITY_CHECK | SP_STOPBITS ; prop->SettableBaud = BAUD_075 | BAUD_110 | BAUD_134_5 | BAUD_150 | BAUD_300 | BAUD_600 | BAUD_1200 | BAUD_1800 | BAUD_2400 | BAUD_4800 | - BAUD_9600 | BAUD_19200 | BAUD_38400 | BAUD_57600 | BAUD_115200 ; + BAUD_9600 | BAUD_19200 | BAUD_38400 | BAUD_57600 | BAUD_115200 | BAUD_128K | BAUD_USER ;
It would be a good idea to add BAUD_7200, BAUD_14400, and BAUD_56K at the same time, and keep the lines wrapped to about 100 characters. I did a quick test and real Windows does report that my motherboard's PC serial port supports every baud rate up to BAUD_115200 including BAUD_USER and that its max baud is BAUD_USER. (The only baud that I am missing is BAUD_128K which I don't think my hardware supports, but it doesn't hurt to include that one too as you proposed.) Great work! My suggestion would be to squash your two commits together, add the three other missing baud rates, and retitle the commit something like "ntdll: Report all possible serial baud rates." The first word of the commit message is almost always the name of the DLL that you are changing, and the second word is almost always a verb in the imperative mood. Finally, be nice and wrap your commit message to 72 characters per line :-) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9968#note_128408
participants (5)
-
Alex Henrie (@alexhenrie) -
Austin English (@austin987) -
Elizabeth Figura (@zfigura) -
Myles Gray -
Myles Gray (@magnix)