tto()

Give output buffer data to hardware

Synopsis:

#include <sys/io-char.h>
int tto( TTYDEV * dev,
         int action,
         int arg );

Arguments:

dev
A pointer to the driver's TTYDEV structure.
action
One of:
  • TTO_CTRL — Set the characteristics of the port (i.e., control RS-232 modem lines).
  • TTO_DATA — Output transmit data if tto() is called directly from the interrupt handler, or if io-char's write handler calls down to initiate a transfer.
  • TTO_EVENT — Call into tto() at thread time to transmit data. The interrupt handle can return this event rather than calling tto() directly.
  • TTO_LINESTATUS — Request line status. Returns the status of the modem status and modem control registers when
  • TTO_STTY — Receive an stty() command.
arg

A data value that has different meanings for different actions. Passes flags that modify the action.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The tto() function takes data from io-char's output buffer and gives it to the hardware. The function also deals with stty commands through calling ser_stty() and provides line control and line status information.
Note:
You must implement the tto() function in the driver.

Returns:

The modem status and modem control if called with TTO_LINESTATUS. Otherwise, returns 0.

Page updated: