FreeBSD/Linux Kernel Cross Reference
sys/sqtsec/co.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991 Carnegie Mellon University
4 * Copyright (c) 1991 Sequent Computer Systems
5 * All Rights Reserved.
6 *
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
12 *
13 * CARNEGIE MELLON AND SEQUENT COMPUTER SYSTEMS ALLOW FREE USE OF
14 * THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON AND
15 * SEQUENT COMPUTER SYSTEMS DISCLAIM ANY LIABILITY OF ANY KIND FOR
16 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 *
18 * Carnegie Mellon requests users of this software to return to
19 *
20 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
24 *
25 * any improvements or extensions that they make and grant Carnegie Mellon
26 * the rights to redistribute these changes.
27 */
28
29 /*
30 * HISTORY
31 * $Log: co.h,v $
32 * Revision 2.4 93/03/10 11:30:35 danner
33 * u_long -> u_int
34 * [93/03/10 danner]
35 *
36 * Revision 2.3 91/07/31 18:06:27 dbg
37 * Changed copyright.
38 * [91/07/31 dbg]
39 *
40 * Revision 2.2 91/05/08 13:05:01 dbg
41 * Added volatile declarations.
42 * [91/03/25 dbg]
43 *
44 * Added output buffer since Mach kernel circular buffers are not
45 * within SCED-addressable space (lowest 4 Meg).
46 * [90/12/18 dbg]
47 *
48 * Adapted for pure kernel.
49 * [90/09/24 dbg]
50 *
51 */
52
53 /*
54 * $Header: co.h,v 2.4 93/03/10 11:30:35 danner Exp $
55 */
56
57 /*
58 * co.h
59 * Info passed between the SCSI/Ether console driver and the
60 * binary config file.
61 *
62 * binary config table for the console driver. There is one entry in
63 * the co_bin_config[] table for each controller in the system.
64 */
65
66 /*
67 * Revision 1.1 89/07/05 13:20:12 kak
68 * Initial revision
69 *
70 */
71 #ifndef _SQTSEC_CO_H_
72 #define _SQTSEC_CO_H_
73
74 #include <sys/types.h>
75 #include <device/tty.h>
76
77 #include <sqt/mutex.h>
78 #include <sqtsec/sec.h>
79
80 struct co_bin_config {
81 gate_t cobc_gate;
82 };
83
84 /*
85 * Console state.
86 * There is one such structure for each tty device (minor device) on
87 * each SCSI/Ether controller.
88 *
89 * The local and remote console devices are always minor devices 0
90 * and 1, regardless of where they appear on the bus. This is
91 * guaranteed at config time.
92 *
93 * Mutex notes:
94 * We could lock the input and output sides separately.
95 * But, this would probably not be a big win. So, use one
96 * lock for all state information.
97 */
98
99 /*
100 * throw together a structure containing the size of the program queue
101 * and its state.
102 */
103
104 struct sec_pq {
105 struct sec_progq *sq_progq;
106 u_short sq_size;
107 };
108
109 #define CBSIZE 64 /* size of input buffer */
110
111 struct co_state {
112 struct tty ss_tty;
113 u_char ss_alive;
114 u_char ss_initted;
115 /* input state */
116 volatile
117 int is_status;
118 struct sec_dev *is_sd;
119 struct sec_pq is_reqq;
120 struct sec_pq is_doneq;
121 u_int is_ovc; /* count number of overflow errors */
122 u_int is_parc; /* count number of parity errors */
123 char is_buffer[CBSIZE];
124 u_char is_restart_read; /* restart read flag */
125 u_char is_initted;
126 /* output state */
127 volatile
128 int os_status;
129 struct sec_dev *os_sd;
130 struct sec_pq os_reqq;
131 struct sec_pq os_doneq;
132 struct sec_smode os_smode;
133 sema_t os_busy_wait;
134 u_char os_busy_flag;
135 u_char os_initted;
136 #ifdef MACH_KERNEL
137 char os_buffer[CBSIZE];
138 #endif /* MACH_KERNEL */
139
140 };
141
142 #define CM_BAUD sm_un.sm_cons.cm_baud
143 #define CM_FLAGS sm_un.sm_cons.cm_flags
144
145 #ifdef KERNEL
146 extern struct co_bin_config co_bin_config[];
147 extern int co_bin_config_count;
148 #ifdef DEBUG
149 extern int co_debug;
150 #endif DEBUG
151 #endif KERNEL
152
153 #ifdef DEBUG
154 extern char gc_last;
155 #define DBGCHAR ('f'&037)
156 #endif DEBUG
157
158 #endif /* _SQTSEC_CO_H_ */
Cache object: 9efea50c5dc589573302cac17dfd879c
|