BSD 4_4 release
[unix-history] / usr / src / sys / news3400 / sio / scc.h
CommitLineData
af5295ff 1/*
ad787160
C
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
af5295ff
KM
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Sony Corp. and Kazumasa Utashiro of Software Research Associates, Inc.
7 *
c0567266
KB
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
af5295ff
KM
35 *
36 * from: $Hdr: scc.h,v 4.300 91/06/09 06:44:56 root Rel41 $ SONY
37 *
ad787160 38 * @(#)scc.h 8.1 (Berkeley) 6/11/93
af5295ff
KM
39 */
40
af5295ff 41#ifdef news3400
af5295ff 42#define splscc spl4
2b435e14 43#endif
af5295ff
KM
44
45#define SCCWAIT DELAY(2)
af5295ff
KM
46
47#define SCC_REMOTE0 0
48#define SCC_REMOTE1 1
49#define SCC_REMOTE2 2
50#define SCC_REMOTE3 3
51#define SCC_REMOTE4 4
52#define SCC_REMOTE5 5
53#define SCC_REMOTE6 6
54#define SCC_REMOTE7 7
55#define SCC_REMOTE8 8
56#define SCC_REMOTE9 9
57
58#define SCCVEC0 64
59#define SCCVEC1 (SCCVEC0+16)
60#define SCCVEC2 (SCCVEC0+32)
61#define SCCVEC3 (SCCVEC0+48)
62#define SCCVEC4 (SCCVEC0+64)
63
64/*
65 * SCC channel control block
66 */
67typedef struct scc_dma {
68 char *dma_addr;
69 int dma_count;
70} Scc_dma;
71
72typedef struct scc_channel {
73 int scc_status; /* channel status */
74 int scc_param; /* channel parameter */
75 struct scc_reg *scc_port; /* port address */
76 char *scc_init; /* initialize data */
77 int scc_vec; /* interrupt vector */
78 Scc_dma x_dma;
79 Scc_dma r_dma;
80} Scc_channel;
81
82/*
83 * SCC channel status
84 */
85#define OACTIVE 0x00000001 /* transmit in progress */
86#define OSTOP 0x00000002 /* output stop request */
87#define OFLUSH 0x00000004 /* output flush request */
88#define OBUSY 0x00000008 /* output in use */
89#define LINE_BREAK 0x00000010 /* line break interrupt */
90#define ENABLE 0x00000020 /* receiver enable */
91#define CHAN_ACTIVE 0x80000000 /* channel active */
92
93/*
94 * SCC channel usage
95 */
96#define SCC_MOUSE 0
97#define SCC_KEYBOARD 1