/* $Id: htytty.h,v 2.4 91/10/31 16:53:09 annette Exp $ */
/****************************************************************/
/* htytty.h														*/
/****************************************************************/
/*																*/
/*                 Confidential Information                     */
/*      Limited Distribution to Authorized Persons Only         */
/*     Created 1986 and Protected as an Unpublished Work        */
/*          Under the U.S. Copyright Act of 1976.               */
/*         Copyright (c) 1986, Systech Corporation          	*/
/*                  All Rights Reserved                         */
/*																*/
/*	THIS SOFTWARE IS LICENSED BY AND IS THE	CONFIDENTIAL AND 	*/
/*	PROPRIETARY PROPERTY OF SYSTECH COMPUTER CORPORATION AND 	*/
/*	MAY NOT, WITHOUT THE PRIOR WRITTEN CONSENT OF SYSTECH 		*/
/*	COMPUTER CORPORATION, BE REPRODUCED, USED OR DISCLOSED 		*/
/*	EXCEPT IN ACCORDANCE WITH A SYSTECH COMPUTER CORPORATION 	*/
/*	SOFTWARE LICENSE AGREEMENT.									*/
/****************************************************************/
/*																*/
/* There is one htty data structure associated with each defined*/
/* HPS channel.													*/
/*																*/
/* In the standard tty state field, the value 0x400 is defined  */
/* as TACT.  We use this value to mean receiver enabled.		*/
/*																*/
/* In the standard tty state field, the value 0x800 is defined	*/
/* as CLESC.  We use this value to mean close in progress.		*/
/* 9-11-86 jl													*/
/*																*/
/* Added the TOACT and RTO bits.  TOACT is used as the TACT bit	*/
/* in the standard tty sate, but we use this for RCVENB.		*/
/* TACT uses the standard state TTIOW bit.						*/
/*																*/
/****************************************************************/

#define DCEPORT		0x0001	/* DCE device if set, DTE device if not set */
/*      WOPEN		0x0002	defined in tty.h	*/
/*      ISOPEN		0x0004	defined in tty.h	*/
/*      CARR_ON		0x0010	defined in tty.h	*/
/*      CREAD		0x0080	defined in termio.h */
#define RCVENB		0x0400
#define WCLOSE		0x0800
/*      RTO			0x1000	defined in tty.h	*/
#define TOACT		0x2000

/*	bits for t_lstate	*/
#define	LS_ONLIST		1


struct htty
{
    short	  hpschan;			/* HPS channel number associated with tty	*/
    char 	  ibuf[256];
    short	  ibuf_cnt;
    char     *ibuf_iptr;
    char     *ibuf_optr;
    int		(*t_proc)();
    struct htyctrl 	*htp;		/* Pointer to associated host adapter D/S    */
    struct htty	*t_link;		/* link to  next channel on linked list of
								 * channel waiting for mwrite buffer
								 */
#ifdef EISA
	struct proc  *t_selrd;
	struct proc  *t_selwr;
    ushort	      t_rdagain;
#endif
    ushort	t_iflag;
    ushort	t_oflag;
    ushort	t_cflag;
    ushort	t_lflag;
    short	t_mosig;			/* Contains the modem signals				*/
    short	t_flshi;			/* Indicates the current flush status		*/
    short	t_state;
    short	t_lstate;			/* state of channel on linked list waiting
								 * for mwrite buffer
								 */
    short	t_pgrp;				/* Contains the process group				*/
    char	t_lpdev;			/* Indicates if device is an line printer	*/
    bit8	t_indent;			/* Spaces to indent (line printers only)	*/
    bit8	t_nchars;			/* Number of characters per line (lps only)	*/
    bit8	t_nlines;			/* Number of lines per page ( lps only )	*/
    bit8	t_pflags;			/* line printer flag						*/
    char	t_sleeps;			/* Indicates if sleeping on modem signals	*/
#ifdef EISA
	char          t_selfl;
#endif
#ifdef NCCS
    unsigned char t_cc[NCCS];
#else
    unsigned char t_cc[NCC];
#endif
};

/* Bits for t_lpdev	*/
#define NOT_LP		0x00		/* Zero if it's a terminal				*/
#define SERIAL		0x01		/* A serial printer is special			*/ 
#define PARALLEL	0x02		/* Indicates a parallel printer			*/
#define LPDOWN		0x80		/* set if line printer is down			*/

/* Bits for testing evchar in the interrupt service routine	*/
/* evchar is used to determine the status of the printer	*/
#define STARTED 	A_RTS		/* On indicates parallel printer is started	*/
#define STOPPED		A_CD		/* Off indicates parallel printer is stopped*/
#define ONLINE		A_ONLINE	/* On indicates parallel printer is online	*/

#ifdef EISA
/*
 *	Bits for t_selfl
 */
#define	SELRD_COLLISION	0x01
#define	SELWR_COLLISION	0x02
#endif

/*
 * MODIFICATION HISTORY:
 *
 * $Log:	htytty.h,v $
 * Revision 1.1.2.1  92/06/24  13:53:45  marker
 * Branch RISCOS_5_01_2_FIXES off of trunk.
 * 
 * Revision 2.4  91/10/31  16:53:09  annette
 * Added #ifdef NCCS for systems which don't support posix and NCCS.
 * INTERNAL
 * 
 * Revision 2.3  91/09/16  15:31:39  leynette
 * Changed definition of t_cc array to NCCS for POSIX compliance.  It was NCC.
 * ENHANCEMENT
 * 
 * Revision 2.2  91/01/10  20:40:13  dave
 * Update header.
 * COSMETIC
 * 
 */
