Re: XON/XOFF communication problem

From: Grant Edwards (grante_at_visi.com)
Date: 10/22/03


Date: 22 Oct 2003 15:57:18 GMT

In article <slrnbpd1j4.su.vek@station02.ohout.pharmapartners.nl>, Villy Kruse wrote:
>
>>Over the past few years, I've spent a lot of time reading the
>>Linux tty layer and serial driver code, and I wouldn't be a bit
>>surprised if Xon/Xoff just didn't work right in all
>>situations...
>
> Or more likely, there is a latency between receiving xoff and the flow of
> characters actualy stops. Expecialy if you have a uart with a FIFO then
> the content of the FIFO will be transmitted even after X-OFF is received.
> The X-OFF may also need to tranverse through the receive FIFO hefore it
> is acted on.

Exactly. It may take up to 10ms for Linux to stop sending after an XOFF is
received since that's handled by the tty layer, and the normal mode of
operation is (or at least used to be) to buffer up received bytes and push
them up to the tty layer once every tick (10ms). At 115.2K, that's 115
bytes of data -- the terminal may not be able to tolerate receiving that
much data after it sends an XOFF. You might be able to improve things by
setting the low latency option on the port using setserial (do a "man
setserial"). I know that will improve XOFF response time with some drivers,
since it will shove bytes up to the tty layer on every rx interrupt, but I
don't remember if the 16x50 driver does that or not.

Some nicer UARTs (e.g. 16850) handle XON/XOFF in hardware -- if you're using
one of those (and the driver is well-written), XON/XOFF should work at any
baud rate.

At first serial ports seem fairly simple...

-- 
Grant Edwards                   grante             Yow!  Where's th' DAFFY
                                  at               DUCK EXHIBIT??
                               visi.com            


Relevant Pages

  • Re: [announce][draft4] HVCS for inclusion in 2.6 tree
    ... On Thu, 2004-07-29 at 12:41, Jeff Garzik wrote: ... The TTY layer uses wait_queues so wake_up_interruptibleis the method ... the hypervisor & hvcs driver are available for further data writes. ...
    (Linux-Kernel)
  • Re: xPC Serial Communication Problems
    ... We're using the serial ports that come on the CPU ... The older serial block you're using uses the kernel resident driver ... Is the receiving machine executing at the 'same' 50 ms rate? ... does it wait until there are at least 15 characters in the ...
    (comp.soft-sys.matlab)
  • Re: Trouble w/ Receiving Faxes (MS Fax software)
    ... reliably transmit or receive faxes. ... receiving faxes) since getting my XPS 420 last month. ... You using the WinXP native driver or the Dell XP driver for the modem? ...
    (alt.sys.pc-clone.dell)
  • Re: Trouble w/ Receiving Faxes (MS Fax software)
    ... transmit or receive faxes. ... receiving faxes) since getting my XPS 420 last month. ... You using the WinXP native driver or the Dell XP driver for the modem? ...
    (alt.sys.pc-clone.dell)
  • Cisco response to Cisco VPN Client under XP
    ... users to disable driver signing. ... the response I received. ... Ian Kayne ... After receiving ...
    (Vuln-Dev)