qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:Re:Re: qemu not support serial crtscts


From: 付小明
Subject: Re:Re:Re: qemu not support serial crtscts
Date: Wed, 16 Mar 2022 19:19:26 +0800 (CST)


cc other dear

 I need your help!  I am looking forward your reply
Xiaoming Fu



At 2022-03-16 19:07:01, "付小明" <fxm16899@163.com> wrote:

the function relation is 
serial_ioport_write(serial.c) -> serial_update_parameters(serial.c) -> qemu_chr_fe_ioctl(serial.c) -> tty_serial_ioctl(char-serial.c) -> tty_serial_init(char-serial.c)

in  tty_serial_init:  tty.c_cflag &= ~(CSIZE | PARENB | PARODD | CRTSCTS | CSTOPB);   is set no hardware flow control(-crtscts)
 tty.c_cflag  |= CRTSCTS  is set hardware fow control(crtscts)


2、the app in the guest set  the speed, parity,data_bits,stop_bits, qemu can get them by  the function serial_update_parameters.  But qemu can not get the hardware flow control of the guest set。
3、I find some knowledge. Hardware flow control is RTS/CTS . We can see MCR. 

So I try  code like this :

if ((s->mcr & 0x02) && (s->mcr & 0x01) && ((~(s->msr)) & 0x10)) {

        up_crtscts = 1;

    } else {

        up_crtscts = 0;

    }

But RTS is no right. Because the RTS is enable when set hardware flow control  and not set  hardware flow control .This is may a qemu  bug
I think the RTS is enable when set hardware flow control ; the RTS is not enable when not set hardware flow control. 

I need your help! I am looking forward your reply!

在 2022-03-16 18:32:59,"Dr. David Alan Gilbert" <dgilbert@redhat.com> 写道: >* 付小明 (fxm16899@163.com) wrote: >> hi all >> information >> -chardev tty,id=charserial0,path=/dev/ttyS0 -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 -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 -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 -device pci-serial,chardev=charserial3,id=serial3,bus=pci.0,addr=0x1a > >Hi, > It's a while since I tried it; I think I would try adding debug to >see if char-serial.c tty_serial_ioctl is called. > >Dave > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> At 2022-03-16 14:38:47, "付小明" <fxm16899@163.com> wrote: >> >> >> >> >> HI ,ALL >> Nice to meet you! I need your help. I find a bug in qemu. qemu not support serial hardware flow control >> 1、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. >> This is a bug: >> 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 >> because qemu not support serial hardware flow control。 >> 2、Problem: the machine's guest is linux, the machine's host is centos.qemu not support serial hardware flow control >> in the guest , use the serial hardware flow control by minicom. I find the guest serial stty -F /dev/ttyS0 -a is crtscts. But host the serial stty -F /dev/ttyS0 -a is -crtscts. >> >> >> I need your help! I am looking forward your reply >> >> >> >> >> Xiaoming Fu >> >> >> -------- Forwarding messages -------- >> From: "付小明" <fxm16899@163.com> >> Date: 2022-03-15 10:11:11 >> To: "Peter Maydell" <peter.maydell@linaro.org> >> Cc: "QEMU Developers" <qemu-devel@nongnu.org> >> Subject: Re:Re: set qemu support serial crtscts >> >> 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. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> 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 >> >> >> >> >> >> >> >> >> >> >> >> > > > >-- >Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


 



 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]