qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* set qemu support serial crtscts
@ 2021-04-14  5:03 付小明
  2021-04-14 13:24 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: 付小明 @ 2021-04-14  5:03 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 126 bytes --]

HI, I have find qemu serial not support crtscts. This result some machine not communication, because this machine need crtscts

[-- Attachment #1.2: Type: text/html, Size: 289 bytes --]

[-- Attachment #2: 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:

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: set qemu support serial crtscts
  2021-04-14  5:03 set qemu support serial crtscts 付小明
@ 2021-04-14 13:24 ` Peter Maydell
  2021-04-15  5:38   ` 付小明
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2021-04-14 13:24 UTC (permalink / raw)
  To: 付小明; +Cc: QEMU Developers

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:Re: set qemu support serial crtscts
  2021-04-14 13:24 ` Peter Maydell
@ 2021-04-15  5:38   ` 付小明
  0 siblings, 0 replies; 3+ messages in thread
From: 付小明 @ 2021-04-15  5:38 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers


[-- 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:

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-15 13:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14  5:03 set qemu support serial crtscts 付小明
2021-04-14 13:24 ` Peter Maydell
2021-04-15  5:38   ` 付小明

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).