/* $Id: htyctrl.h,v 2.3 91/09/03 16:52:42 annette Exp $ */
/****************************************************************/
/* htyctrl.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.									*/
/****************************************************************/
/*																*/
/* This header file is used in the Unix System V HPS driver		*/
/* hty.c.  There is an htyctrl data structure for each host		*/
/* adapter.  Most of the htyctrl D/S is for managing the multi-	*/
/* channel reads and writes associated with each board.			*/
/*																*/
/****************************************************************/

struct htybctrl
{
	char buf_avail[NUMEXTRA];		/* flags = TRUE if IOCB bufs are avail	*/
	IOCB_BUF *iocb_buf[NUMEXTRA];	/* Extra iocb pool pointers				*/
};

struct htyctrl
{
	short	flags;			/* flag for waiting or not						*/
	char rdactive;			/* flag: multi-channel read active. This can	*/
							/* be in one of three states:					*/
							/*	0 = not active								*/
							/*	1 = read issued to board					*/
							/*	2 = read completed, pending					*/
	char wractive;			/* flag: status for multi-channel write bufs	*/
							/*	bit 0 = 1 if write buffer 0 is busy			*/
							/*	bit 1 = 1 if write buffer 1 is busy			*/
	int first_time;			/* set to FALSE when first channel is opened	*/
	char in_init;			/* flag: initialization in progress				*/
	char sleeps;			/* flag: process sleeping on various events		*/
	int tmract;				/* write timer active flag						*/
	int  woff;				/* current offset into multi-chan write buf		*/
	char *rbuf;				/* Multi channel read buffer pointer			*/
	char *wbuf;				/* Multi channel write buffer pointer			*/
	A_IOCB *riocb;			/* Multi channel read IOCB pointer				*/
	A_IOCB *wiocb;			/* Multi channel write IOCB pointer				*/
	struct hpsctrl *hpp;	/* pointer to HPS (raw) control structure		*/
	struct htybctrl *hbp;	/* pointer to buffer control structure			*/
	struct htty *wwait_hd;  /* head of waiting channel queue				*/
	struct htty *wwait_tl;	/* tail of waiting channel queue				*/
	char has_grp;			/* the TCS can handle the SET/GET group cmds	*/
	short	hty_nlines;		/* number of channels used on this controller	*/
};

/* bit for flags field */
#define	WAITING	1			/* waiting for write to complete	*/
#define	FEW		2			/* few char traffic 				*/

#ifdef EISA
typedef struct
{
	short loww;
	short highw;
} hpswm;
#endif

/*
 * MODIFICATION HISTORY:
 *
 * $Log:	htyctrl.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.3  91/09/03  16:52:42  annette
 * No changes made.
 * INTERNAL
 * ,.
 * 
 * Revision 2.2  91/01/10  20:40:07  dave
 * Update header.
 * COSMETIC
 * 
 */
