Date: Sat, 14 Aug 2010 17:09:49 -0700 From: Garrett Cooper <gcooper@FreeBSD.org> To: Paul Thornton <prt@prt.org> Cc: Ed Schouten <ed@80386.nl>, freebsd-hackers@freebsd.org Subject: Re: Problem detecting and reacting to serial break Message-ID: <AANLkTi=Nm3W=2CZ5jzutMMuQ_upRXtTrZ9dC%2B4L1iFVC@mail.gmail.com> In-Reply-To: <4C672EE1.60101@prt.org> References: <4C66D2CF.9040408@prt.org> <20100814220929.GI2978@hoeg.nl> <4C672EE1.60101@prt.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 14, 2010 at 5:03 PM, Paul Thornton <prt@prt.org> wrote: > Ed Schouten wrote: >> * Paul Thornton <prt@prt.org> wrote: >>> I'm using 8.0-RELEASE with uftdi and ucom driving the serial port. >> >> Somewhat unrelated question: have you ever tried running the this code >> on 7.x? If so, did it work? > > I've just tried this on 7.2-RELEASE (that was the only 7.x CD I could > find lurking about my desk). > > Something is clearly quite different between 7 and 8 here: > > On 7.2, it doesn't like my tcsetattr: > > [root@test1 /usr/local/src]# ./dmxrx2 > Opened /dev/cuaU0 on file handle 3 > before: c_iflag=3D2106 c_oflag=3D3 c_cflag=3Dcf00 c_lflag=3D400 > tcsetattr: Invalid argument > > No amount of fiddling with the options would make it work, so I used > stty to set the paramaters of /dev/cuaU0.init to what I wanted: > > stty -f /dev/cuaU0.init speed 250000 -icanon -isig -echo cs8 clocal > =A0cstopb cread ignpar -ixany -ixon -ixoff -ignbrk brkint -imaxbel -icrnl > > ... and re-ran with some more debug ... > > [root@test1 /usr/local/src]# ./dmxrx2 > Opened /dev/cuaU0 on file handle 3 > before: c_iflag=3D6 c_oflag=3D3 c_cflag=3Dcf00 c_lflag=3D400 > tcsetattr: Invalid argument > after: c_iflag=3D6 c_oflag=3D3 c_cflag=3D8f00 c_lflag=3D400 > calling read with 513 bytes to go > ^CCaught a signal: 2 > > So I now hang in a blocked read(). > > A quick and dirty test of "hd /dev/cuaU0" gives one line of zeros and > then hangs. =A0Under 8.0, this continually dumps the data coming in as yo= u > might expect it to. > > Were there any significant serial changes between 7.x and 8.0 which > might explain this? =A0I don't have enough understanding of how FreeBSD's > serial internals should work to debug this on my own, but am more than > happy to try all suggestions made. Bits of syscons were largely rewritten between 7.x and 8.x. That's the reason why Ed ask the question :) (he did the rewriting). -Garrett
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=Nm3W=2CZ5jzutMMuQ_upRXtTrZ9dC%2B4L1iFVC>