/* $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

#ident	"$Header: ssm_cb.h 1.4 89/08/07 $"

#ifndef	_SYS_SSM_CB_H_

/*
 * ssm_cb.h
 *	SSM generic console and printer defines and structures
 *	which must be included even when the devices are not
 *	configured because the CB's are always allocated for
 *	these devices.
 */

/* $Log:	ssm_cb.h,v $
 */

/*
 * Hardware related defines
 */
#define	NPRINTDEV	1		/* one printer port per SSM */
#define NCONSDEV	2		/* local/remote console ports */

/*
 * SLIC interrupt bins for sending console/printer 
 * commands to SSM.
 */
#define	PRINT_BIN	0x05		/* bin used to send CB I/O intrs */
#define	CONS_BIN	0x04		/* Bin used to send CB I/O intrs */
#define CONS_CMD	0x80		/* msb set for unique console command */
#define C_ADDR		0x40

/*
 * Vectors for interrupts to SSM
 */
#define PCB_ADDRVEC	0			/* printer CB addr */
#define CONS_ADDRVEC	CONS_CMD | C_ADDR	/* console CB addrs */

/* Number of command blocks per unit */
#define NCBPERPRINT	2		/* printer CB's */
#define	NCBCONSHFT	2		/* Log2(NCBPERCONS) */

/*
 * Important console CB alignments.
 */
#define	CCB_SHSIZ	16		/* Size of shared portion */
#define	CCB_SWSIZ	16		/* Size of s/w-only portion */

/*
 * GENERIC console CB.
 */
struct cons_cb {
	ulong	cb_reserved;		/* Reserved for Sequent use */
	unchar	cb_fill[10];		/* Pad to CCB_SHSIZ bytes */
	unchar	cb_cmd;			/* Command byte */
	unchar	cb_status;		/* Transfer status */

	/* Start of sw-only part */
	ulong	cb_sw[CCB_SWSIZ/sizeof(ulong)];
};

/*
 * Important printer CB sizes.
 */
#define	PCB_SHSIZ	16		/* size of shared portion */
#define	PCB_SWSIZ	16		/* size of s/w-only portion */

/*
 * Generic printer port CB
 */
struct print_cb {
	ulong	cb_reserved;		/* reserved for Sequent use */
	unchar	cb_fill[10];		/* pad to PCB_SHSIZ bytes */
	unchar	cb_cmd;			/* command byte */
	unchar	cb_status;		/* xfer status */

	/* start of sw-only part */
	ulong	cb_sw[PCB_SWSIZ/sizeof(ulong)];
};

#define	_SYS_SSM_CB_H_
#endif	/* _SYS_SSM_CB_H_ */
