[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

TTYDEV

Structure for a tty device

Synopsis:

typedef struct ttydev_entry {
	iofunc_attr_t			attr;
	iofunc_mount_t			mount;
	TTYWAIT					*waiting_read;
	TTYWAIT					*waiting_write;
	TTYWAIT					*waiting_drain;
	int						c_cflag;
	int						c_iflag;
	int						c_lflag;
	int						c_oflag;
	volatile unsigned		flags;
	volatile unsigned       xflags;
    int						bcnt;
	int						fwdcnt;
	struct ttydev_entry		*timer;
	int			 			timeout;
	int			 			timeout_reset;
	union {
		int					tmrs;
		struct {
			char			spare_tmr;
			char			tx_tmr;
			char			brk_tmr;
			char			dtr_tmr;
		}	s;
	} 		un;
	pid_t					brkpgrp;
	pid_t			 		huppid;
    cc_t			 		c_cc[NCCS];
	unsigned char		 	fifo;
	unsigned char		 	fwd;
	unsigned char		 	prefix_cnt;
	unsigned char		 	oband_data;
	int			 			highwater;
	int			 			baud;
	struct winsize			winsize;
	TTYBUF	 				obuf;
	TTYBUF	 				ibuf;
	TTYBUF	 				cbuf;
	iofunc_notify_t		 	notify[3];
	struct ttydev_entry		*extra;
	TTYWAIT					*waiting_open;	
	void					*reserved2;		/* reserved for use by io-char */
	int						(*io_devctlext)(resmgr_context_t *ctp, io_devctl_t *msg, iofunc_ocb_t *ocb);
	char			 		name[TTY_NAME_MAX];
	} TTYDEV;

Description:

A character driver shares the TTYDEV structure with the io-char library.

This structure is used to handle devices shared between the driver and io-char.

The members include:

attr
A resource manager attribute
mount
Related to resource manager information
waiting_read
The queue to store blocking clients waiting to read
waiting_write
The queue to store blocking clients waiting to write
waiting_drain
The queue to store blocking clients waiting to drain.
c_cflag
POSIX termios flag describing the hardware control of the terminal
c_iflag
POSIX termios flag describing the basic terminal input control
c_lflag
POSIX termios flag used to control various terminal functions
c_oflag
POSIX termios flag describing the basic terminal output control
flags
The following flags are currently defined:
xflags
OSW_PAGED_OVERRIDE -- override OSW_PAGED to allow transmission of controlled characters when in a software flow control suspend state. This flag is set by io-char and is used and cleared by the driver.
bcnt
Internal to io-char and used to determine the number of bytes needed to notify a read client.
fwdcnt
Internal to io-char and used to determine the number of fwd counts.
timer
Used by io-char.
timeout
Used by io-char.
timeout_reset
Used by io-char.
tmrs
One of several available for io-char to use.
spare_tmr
Spare used only by io-char for drain.
tx_tmr
Enabled by LOSES_TX_INTR. The timer causes tto() to be called to work around some parts that lose transmit interrupts.
brk_tmr
Used only by io-char sending break; calls tto() (TTO_CTRL, dtrchg).
dtr_tmr
Used by io-char to set dtr line i.e. generate SIGHUP calls tto() (TTO_CTRL, dtrchg).
brkpgrp
Used by io-char.
huppid
Used by io-char.
c_cc
POSIX special control-characters.
fifo
Used only by the driver.
fwd
Forward character used by io-char. It's used with fwdcnt to implement forward, described in readcond().
prefix_cnt
For io-char only.
oband_data
Out-of-band data set by the driver in <intr.c>. The application gets it from io-char via a devctl().
highwater
Set by the driver and used by io-char to determine when to invoke flow control. (Make sure this value is LESS than the input buffer size).
baud
The device's baud rate.
winsize
Used only by io-char.
obuf
The output buffer.
ibuf
The input buffer.
cbuf
The canonical buffer.
notify
The notify list. It implements iofunc_notify_trigger() resource manager information. The following arguments are used:
extra
Used for PTYs.
waiting_open
The queue to store blocking clients waiting to open.
io_devctlext
Custom devctl command.
name
The device's name i.e. /dev/ser1

Classification:

QNX Neutrino

See also:

TTYCTRL


[Previous] [Contents] [Index] [Next]