/*********************************************************************** 
* NOTICE
* All files contained on this disk are subject to the licensing conditions
* issued by MOTOROLA Inc.
*
* All files are copyright 1993 by MOTOROLA Inc. 
************************************************************************/

/*
 * bisync.h
 * definitions for the BISYNC controllers
 */

/*
 * transmit BD's
 */
#define	T_R	0x8000		/* ready bit */
#define	T_W	0x2000		/* wrap bit */
#define	T_I	0x1000		/* interrupt on completion */
#define	T_L	0x0800		/* last buffer in frame */
#define	T_BCS	0x0400		/* transmit block control sequence */
#define	T_CM	0x0200		/* Continuous Mode - Ready bit is not
				cleared by CP after this BD is closed*/
#define	T_RESET	0x0100		/* reset BCS at start of buffer */
#define T_DLE	0x0080		/* tx DLE before this buffer */
#define	T_TR	0x0040		/* enter transparent mode
					after end of buffer */
#define	T_B	0x0020		/* include in BCS calculation */

#define	BISYNC_T_ERROR	0x000f
#define	T_UN	0x0002		/* tx error: underrun */
#define	T_CT	0x0001		/* tx error: CTS lost */

/*
 * receive BD's
 */
#define	R_E	0x8000		/* buffer empty */
#define	R_W	0x2000		/* wrap bit */
#define	R_I	0x1000		/* interrupt on reception */
#define	R_C	0x0800		/* buffer contains control character */
#define	R_B	0x0400		/* buffer contains BCS */
#define	R_CM	0x0200		/* Continuous Mode - Empty bit is not
				cleared by CP after this BD is closed*/

#define	R_ERROR	0x00ff
#define	R_DPLL	0x0080		/* DPLL Error - missing transition
					in decoding mode */
#define	R_DLE	0x0010		/* unexpected DLE received */
#define	R_PR	0x0008		/* parity error */
#define	R_BCS	0x0004		/* BCS error detected */
#define	R_OV	0x0002		/* receive overrun */
#define	R_CD	0x0001		/* carrier detect lost */

/*
 * bisync interrupts
 */
#define	BISYNC_CLR	0x1000	/* glitch on Rx */
#define	BISYNC_CLT	0x0800	/* glitch on Tx */
#define	BISYNC_DCC	0x0400	/* carrier detect changed */
#define BISYNC_GRA	0x0080	/* graceful stop complete */
#define BISYNC_TXE	0x0010	/* transmission error */
#define	BISYNC_RCHR	0x0008	/* a character was received */
#define	BISYNC_BUSY	0x0004	/* busy */
#define	BISYNC_TX	0x0002	/* transmit buffer */
#define	BISYNC_RX	0x0001	/* receive buffer */
