Re: serial port behaviour changed between 2.0 and 2.2

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Wed May 03 2000 - 15:21:04 EST


On Wed, 3 May 2000, Frank Gevaerts wrote:

> We are implementing a userspace driver to communicate with a serial
> device. The device uses RTS/CTS and DTR/DSR to indicate whether it is
> ready to communicate. In 2.0, the following code used to work, but in 2.2
> the last ioctl() causes read() and write() to be buffered in 16 byte
> blocks, which causes communication to fail.
> We need to be able to read and set the modem control lines without
> affecting buffered/non-buffered mode. How can we do this ?
>
> int portset;
> if(( fd = open("/dev/ttyS1",O_RDWR|O_NONBLOCK)) > 0)
> ioctl(fd,TIOCMGET,&portset);
> portset &=! TIOCM_DSR;
> portset &=! TIOCM_CTS;
> ioctl(fd,TIOCMSET,&portset);
> }
>
>
> Frank Gevaerts
> Formal and Knowledge Systems
> Luikersteenweg 65
> B-3500 Hasselt
> Belgium
>
>
I don't think it ever "worked". The code should read something
like:

       portset &= ~(TIOCM_CTS|TIOCM_DSR);

       i.e., ~ instead of !

Cheers,
Dick Johnson

Penguin : Linux version 2.3.41 on an i686 machine (800.63 BogoMips).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:12 EST