Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Mar 1997 16:46:19 +1030 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        swallace@ece.uci.edu (Steven Wallace)
Cc:        bugs@freebsd.org, current@freebsd.org
Subject:   Re: serial driver
Message-ID:  <199703070616.QAA19997@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199703070548.VAA20665@newport.ece.uci.edu> from Steven Wallace at "Mar 6, 97 09:48:09 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Steven Wallace stands accused of saying:
> 
> When receiving data, it goes into a buffer until it is read by read(), right?

Sort of 8)

> Well, I am losing data because after DTR is dropped, up to 16 bytes sent
> BEFORE DTR are lost or destroyed, so read() is not picking this up.
> Even though DTR is dropped, that does not mean all data received in any
> buffer is not valid at this point, but only data received AFTER.
> So even if a read() call is actually called after DTR is dropped,
> it should still return any remaining bytes.

Er, DTR is dropped by you closing the device.  You can't read from the
device after you've closed it.  There is a configurable pause after
closing the device before DTR is actually dropped in order to allow data
to be flushed.

(You can drop DTR with an ioctl, but that's different, and data is not
lost).

> Note:  As a result, up to 16 bytes can be lost.  I have a 16550A chip
> so the driver might not be reading remaining bytes in its buffer.
> I am using 2.2R.

I think you mean DCD.  It is not possible to tell whether the bytes
came into the FIFO before or after the line status changed.  The
receive FIFO is emptied in the sio interrupt handler before the modem
status is checked, so I would guess that if you were to try reading in
your HUP handler (providing you had changed your controlling tty) you
would find the data that you were looking for.  Bruce would have a more
authoratative answer here.

Without more details and a simple example application, I can't be sure
that I understand you.

> Steven

-- 
]] Mike Smith, Software Engineer        msmith@gsoft.com.au             [[
]] Genesis Software                     genesis@gsoft.com.au            [[
]] High-speed data acquisition and      (GSM mobile)     0411-222-496   [[
]] realtime instrument control.         (ph)          +61-8-8267-3493   [[
]] Unix hardware collector.             "Where are your PEZ?" The Tick  [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703070616.QAA19997>