DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

proc(D2oddi)


proc -- process device-dependent operations in a TTY driver

Synopsis

   void prefixproc (struct tty *tp, int cmd);

Description

The proc( ) entry point routine is called by the TTY subsystem to process various device-dependent operations. This routine is required for a character driver that accesses the tty or linesw structures.

Arguments


tp
pointer to a tty structure

cmd
an operation that the proc( ) routine performs. Typically, the driver encodes a case statement for each comand with code to perform the operations one of the following commands:

T_BLOCK
send command to the terminal controller to stop input because the input queue has reached the high-water mark (buffer is full). This condition should OR (enable) the TBLOCK flag into the t_state member of the tty structure.

T_BREAK
send a break to a TTY device. Typically, this command is not handled in the proc( ) routine; instead, it is handled in the ioctl(D2oddi) routine.

T_DISCONNECT
send a command to the terminal controller to request that it disconnect a terminal device (tell it to drop carrier).

T_INPUT
prepare a TTY device to receive input.

T_OUTPUT
initiate output to the device if the device is not busy or if output has not been suspended.

T_PARM
change parameters in the tty structure of a particular device. If the device is intelligent enough to use the tty structure information, the driver's proc( ) routine is called to update the device to the new parameters. The shell layers sxt device driver's ioctl( ) routine calls the proc( ) routine of the device with T_PARM when the tty structure has been changed.

T_RESUME
Send command to the terminal controller to indicate that terminal output should be resumed because a <Ctrl>-q character has been received. The TTSTOP bit in the t_state member of the tty structure should be cleared. Note that if IXANY is set in the c_iflag member of the termio structure, any character can cause the terminal to resume. See termio(M) for more information about the IXANY bit.

T_RFLUSH
Send command to terminal controller to flush terminal input queue. If t_state is set to TBLOCK, call the T_UNBLOCK section of the proc( ) routine.

T_SUSPEND
Send a character to the terminal controller to suspend output to the terminal because a <Ctrl>-s character has been received. The driver's proc( ) routine should set the TTSTOP bit in the t_state member of the tty structure.

T_SWTCH
Switch between context layers on the shl(C) driver. This condition is only used with the shell layers driver. Typically, this section of code changes control to channel 0 and wakes up any processes sleeping on the SWTCH character (t_cc[VSWTCH]) being input by the terminal device, as in the following example:
   &t_link->chans[0]
The line discipline's ttin( ) routine checks to see if an input character is equal to t_cc[VSWTCH] (normally <Ctrl>-z) and, if so, calls ttyflush(D3oddi) to flush the input and output buffers (if NOFLSH is not true) in the t_lflag member), and then calls the device driver's proc( ) routine with the command flag T_SWTCH set.

T_TIME
Notifies the driver that delay timing has completed for an event such as a BREAK or a carriage return.

T_UNBLOCK
Allows further input when the input queue has gone below the high water mark. The driver developer resets the TTXOFF and TBLOCK bits in the t_state member when T_UNBLOCK is used.

T_WFLUSH
Clears the transmit buffer characters.

Return values

None

Usage

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

This routine is not supported for DDI drivers, which implement serial devices with STREAMS drivers.

External dependencies

The proc( ) routine is only used in character drivers that access the TTY subsystem, indicated by a t in the second column of the mdevice(F) file.

References

ttiocom(D3oddi), tty(D3oddi)

``TTY devices'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005