xref: /csrg-svn/sys/news3400/sio/scc.h (revision 63314)
153905Smckusick /*
2*63314Sbostic  * Copyright (c) 1992, 1993
3*63314Sbostic  *	The Regents of the University of California.  All rights reserved.
453905Smckusick  *
553905Smckusick  * This code is derived from software contributed to Berkeley by
653905Smckusick  * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
753905Smckusick  *
853905Smckusick  * %sccs.include.redist.c%
953905Smckusick  *
1053905Smckusick  * from: $Hdr: scc.h,v 4.300 91/06/09 06:44:56 root Rel41 $ SONY
1153905Smckusick  *
12*63314Sbostic  *	@(#)scc.h	8.1 (Berkeley) 06/11/93
1353905Smckusick  */
1453905Smckusick 
1553905Smckusick #ifdef news3400
1653905Smckusick #define	splscc		spl4
1758639Sutashiro #endif
1853905Smckusick 
1953905Smckusick #define	SCCWAIT		DELAY(2)
2053905Smckusick 
2153905Smckusick #define SCC_REMOTE0	0
2253905Smckusick #define SCC_REMOTE1	1
2353905Smckusick #define SCC_REMOTE2	2
2453905Smckusick #define SCC_REMOTE3	3
2553905Smckusick #define SCC_REMOTE4	4
2653905Smckusick #define SCC_REMOTE5	5
2753905Smckusick #define SCC_REMOTE6	6
2853905Smckusick #define SCC_REMOTE7	7
2953905Smckusick #define SCC_REMOTE8	8
3053905Smckusick #define SCC_REMOTE9	9
3153905Smckusick 
3253905Smckusick #define	SCCVEC0		64
3353905Smckusick #define	SCCVEC1		(SCCVEC0+16)
3453905Smckusick #define SCCVEC2		(SCCVEC0+32)
3553905Smckusick #define SCCVEC3		(SCCVEC0+48)
3653905Smckusick #define SCCVEC4		(SCCVEC0+64)
3753905Smckusick 
3853905Smckusick /*
3953905Smckusick  *	SCC channel control block
4053905Smckusick  */
4153905Smckusick typedef struct scc_dma {
4253905Smckusick 	char	*dma_addr;
4353905Smckusick 	int	dma_count;
4453905Smckusick } Scc_dma;
4553905Smckusick 
4653905Smckusick typedef struct scc_channel {
4753905Smckusick 	int	scc_status;		/* channel status		*/
4853905Smckusick 	int	scc_param;		/* channel parameter		*/
4953905Smckusick 	struct	scc_reg	*scc_port;	/* port address			*/
5053905Smckusick 	char	*scc_init;		/* initialize data		*/
5153905Smckusick 	int	scc_vec;		/* interrupt vector		*/
5253905Smckusick 	Scc_dma	x_dma;
5353905Smckusick 	Scc_dma	r_dma;
5453905Smckusick } Scc_channel;
5553905Smckusick 
5653905Smckusick /*
5753905Smckusick  *	SCC channel status
5853905Smckusick  */
5953905Smckusick #define	OACTIVE		0x00000001	/* transmit in progress	*/
6053905Smckusick #define	OSTOP		0x00000002	/* output stop request	*/
6153905Smckusick #define	OFLUSH		0x00000004	/* output flush request	*/
6253905Smckusick #define	OBUSY		0x00000008	/* output in use	*/
6353905Smckusick #define LINE_BREAK	0x00000010	/* line break interrupt	*/
6453905Smckusick #define	ENABLE		0x00000020	/* receiver enable	*/
6553905Smckusick #define	CHAN_ACTIVE	0x80000000	/* channel active	*/
6653905Smckusick 
6753905Smckusick /*
6853905Smckusick  *	SCC channel usage
6953905Smckusick  */
7053905Smckusick #define	SCC_MOUSE	0
7153905Smckusick #define	SCC_KEYBOARD	1
72