From: 付小明 <fxm16899@163.com>
To: "Peter Maydell" <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re:Re: set qemu support serial crtscts
Date: Thu, 15 Apr 2021 13:38:08 +0800 (CST) [thread overview]
Message-ID: <8865c73.30de.178d409647c.Coremail.fxm16899@163.com> (raw)
In-Reply-To: <CAFEAcA9Ar9AWnUAnDmPJXCPtZHGNujdOoCFZufMctRkX01o+3A@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2392 bytes --]
Hi, Peter and all developers
Yes, I need to describe it clearly.
1、I want make the qemu serial support crtscts
2、Problem: the machine's guest is windows, the machine's host is centos. The qemu emulation pci-serial.
A printer (model is BTP-2001cp)use the serial to print. The machine connect the printer by serial port.
The data printed by the printer is missing some data.You can see picture 1 is lost some data, picture 2 is normal.Because the printer need hardware flow control.
I modify /chardev/char-serial.c to support hardware flow control. Then the data printed by the printer is normal.
The CRTSCTS is (not in POSIX) Enable RTS/CTS (hardware) flow control.
We can acquire some information by "stty -F /dev/ttyS0 -a ". We can set the CRTSCTS by "stty -F /dev/ttyS0 crtscts"
3、I have some question
1) Does the qemu init all pci-serial port crtscts or raw? For example, I make the qemu configure with 4 pci-serial port.
-chardev tty,id=charserial0,path=/dev/ttyS0,logfile=/dev/fdset/4,logappend=on -device pci-serial,chardev=charserial0,id=serial0,bus=pci.0,addr=0x17 -add-fd set=5,fd=28 -chardev tty,id=charserial1,path=/dev/ttyS1,logfile=/dev/fdset/5,logappend=on -device pci-serial,chardev=charserial1,id=serial1,bus=pci.0,addr=0x18 -add-fd set=6,fd=29 -chardev tty,id=charserial2,path=/dev/ttyS2,logfile=/dev/fdset/6,logappend=on -device pci-serial,chardev=charserial2,id=serial2,bus=pci.0,addr=0x19 -add-fd set=7,fd=30 -chardev tty,id=charserial3,path=/dev/ttyS3,logfile=/dev/fdset/7,logappend=on -device pci-serial,chardev=charserial3,id=serial3,bus=pci.0,addr=0x1a
2) if some printer not support (hardware) flow control, we make the qemu support (hardware) flow control, have some bad influence?
.
At 2021-04-14 21:24:20, "Peter Maydell" <peter.maydell@linaro.org> wrote:
>On Wed, 14 Apr 2021 at 14:18, 付小明 <fxm16899@163.com> wrote:
>>
>> HI, I have find qemu serial not support crtscts. This result some
>> machine not communication, because this machine need crtscts
>
>Could you provide more detail, please? For a bug report it
>is useful to know:
> * what you were trying to do
> * what happened
> * what you expected to happen
> * full details like the QEMU command line
> * what guest software you were running
>
>Ideally, the report should have everything we need to be
>able to reproduce the problem ourselves.
>
>thanks
>-- PMM
[-- Attachment #1.2: Type: text/html, Size: 3095 bytes --]
[-- Attachment #2: picture1.jpg --]
[-- Type: image/jpeg, Size: 502210 bytes --]
[-- Attachment #3: picture2.jpg --]
[-- Type: image/jpeg, Size: 5742905 bytes --]
[-- Attachment #4: set_seial_crtscts.patch --]
[-- Type: application/octet-stream, Size: 465 bytes --]
diff --git "a/chardev/char-serial.c" "b/chardev/char-serial.c"
index 7c3d84ae24..40480d45e4 100644
--- "a/chardev/char-serial.c"
+++ "b/chardev/char-serial.c"
@@ -143,6 +143,7 @@ static void tty_serial_init(int fd, int speed,
tty.c_oflag &= ~OPOST;
tty.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG);
tty.c_cflag &= ~(CSIZE | PARENB | PARODD | CRTSCTS | CSTOPB);
+ tty.c_cflag |= CRTSCTS
switch (data_bits) {
default:
case 8:
prev parent reply other threads:[~2021-04-15 13:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 5:03 set qemu support serial crtscts 付小明
2021-04-14 13:24 ` Peter Maydell
2021-04-15 5:38 ` 付小明 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8865c73.30de.178d409647c.Coremail.fxm16899@163.com \
--to=fxm16899@163.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).