FreeBSD/Linux Kernel Cross Reference
sys/sqt/ioconf.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: ioconf.h,v $
32 * Revision 2.4 93/03/11 14:05:29 danner
33 * u_long -> u_int
34 * [93/03/09 danner]
35 *
36 * Revision 2.3 91/07/31 18:02:11 dbg
37 * Changed copyright.
38 * [91/07/31 dbg]
39 *
40 * Revision 2.2 91/05/08 12:57:07 dbg
41 * Adapted for pure Mach kernel.
42 * [91/04/26 14:53:25 dbg]
43 *
44 */
45
46 /*
47 * $Header: ioconf.h,v 2.4 93/03/11 14:05:29 danner Exp $
48 *
49 * ioconf.h
50 * IO Configuration Definitions.
51 *
52 */
53
54 /*
55 * Revision 1.1 89/07/05 13:15:33 kak
56 * Initial revision
57 *
58 */
59
60 #ifndef _SQT_IOCONF_H_
61 #define _SQT_IOCONF_H_
62
63 #include <sys/types.h>
64
65 /*
66 * MBAd device configuration structure(s).
67 */
68
69 /*
70 * An array of mbad_conf's constitutes the configuration of MBAd
71 * drivers and devices.
72 */
73
74 struct mbad_conf {
75 struct mbad_driver *mc_driver; /* -> per-driver data */
76 int mc_nent; /* # entries in mbad_dev[] */
77 struct mbad_dev *mc_dev; /* array describing related HW */
78 };
79
80 /*
81 * Each driver includes one or more mbad_driver struct's in its source
82 * to define its characteristics.
83 */
84
85 struct mbad_driver {
86 char *mbd_name; /* name, eg "xb" (no digit) */
87 int mbd_cflags; /* per-driver flags (below) */
88 int (*mbd_probe)(); /* probe procedure */
89 int (*mbd_boot)(); /* boot procedure */
90 int (*mbd_intr)(); /* intr procedure */
91 };
92
93 /*
94 * mbad_conf entry points at array of mbad_dev's; each mbad_dev structure
95 * describes a single MBAd board.
96 *
97 * After probing, driver boot procedure is called with a pointer to an
98 * array of these.
99 */
100
101 struct mbad_dev {
102 int md_idx; /* mbad index; -1 == wildcard */
103 u_int md_csr; /* command/status register */
104 u_int md_flags; /* flags (arbitrary) */
105 u_short md_mapwant; /* # map registers needed */
106 u_char md_bin; /* interrupt bin # */
107 u_char md_level; /* multibus interrupt level */
108 /*
109 * The remaining fields are filled in when the configure() runs.
110 * Initial implementation copies md_mapwant to md_nmaps.
111 * md_vector of 1st mbad_dev in a set defines "base" vector.
112 */
113 struct mb_desc *md_desc; /* -> host mb_desc structure */
114 u_short md_basemap; /* 1st map register allocated */
115 u_short md_nmaps; /* # maps allocated */
116 u_char md_vector; /* assigned interrupt vector */
117 u_char md_alive; /* is alive? */
118 };
119
120 /*
121 * MBAd per-driver configuration flags (mbd_cflags).
122 *
123 * If no device on a MBAd uses c-list, then c-list is not mapped in the
124 * MBAd, allowing more map registers to be used by other drivers.
125 *
126 * MBD_MONOP assigns a directed interrupt to the particular level (directed
127 * to the booting processor) and insures the handling processor can't be
128 * taken off-line.
129 *
130 * For MBD_HAS{INTR,PROBE,BOOT} the corresponding proc pointer is valid only
131 * if the bit is on. If !MBD_HASPROBE, we assume the thing is alive.
132 */
133
134 #define MBD_CLIST 0x00000001 /* uses c-list */
135 #define MBD_MONOP 0x00000002 /* runs mono-processor */
136 #define MBD_HASINTR 0x00000004 /* has interrupt proc */
137 #define MBD_HASPROBE 0x00000008 /* has probe procedure */
138 #define MBD_HASBOOT 0x00000010 /* has boot procedure */
139
140 #define MBD_TYPICAL (MBD_HASINTR|MBD_HASPROBE|MBD_HASBOOT)
141
142 /*
143 * Structure passed to MBAd device's probe routine.
144 */
145
146 struct mbad_probe {
147 struct mb_desc *mp_desc; /* pointer to MBAd descriptor */
148 u_int mp_csr; /* command/status address */
149 u_int mp_flags; /* copy of md_flags */
150 };
151
152 /*
153 * Drivers boot procedure is called as follows:
154 *
155 * XXboot(nXX, md)
156 * int nXX;
157 * struct mbad_dev *md;
158 *
159 * `nXX' is the # of "XX" entries (contiguously) in the mbad_dev[] table,
160 * and includes all XX's even those not alive. `md' is a pointer to the
161 * first "XX" entry in the mbad_dev[] array. The configuration utilities
162 * insure that all entries for a particular driver are contiguous in the
163 * mbad_dev[] table. The 'md_vector' in the 1st mbad_dev[] entry is the
164 * 1st of the (contiguous) set for XX's (if XX's were configured to all
165 * interrupt in same bin).
166 */
167
168 /*
169 * Pseudo-device configuration structure(s).
170 */
171
172 struct pseudo_dev {
173 char *pd_name; /* name (eg, "pty") */
174 u_int pd_flags; /* flags (arbitrary) */
175 int (*pd_boot)(); /* boot procedure */
176 };
177
178 /*
179 * Configuration data declarations.
180 *
181 * The mbad_conf and pseudo_dev arrays are terminated by an entry with a
182 * zero "name" pointer.
183 *
184 * These are generated in ioconf.c by configuration utilities.
185 */
186
187 extern struct mbad_conf mbad_conf[]; /* mbad configuration */
188 extern struct pseudo_dev pseudo_dev[]; /* pseudo-devices */
189 extern u_int MBAd_IOwindow; /* 1/4Meg for IO window */
190 extern int bin_intr[]; /* # intrs/bin needed for IO */
191
192 /*
193 * Description of an scsi device.
194 */
195
196 /*
197 * An array of sec_conf's constitutes the configuration of scsi/ether
198 * drivers and devices.
199 */
200
201 struct sec_conf {
202 struct sec_driver *sec_driver; /* -> per-driver data */
203 int sec_nent; /* # entries in sec_dev[] */
204 struct sec_dev *sec_dev; /* array describing related HW */
205 };
206
207 /*
208 * Each driver includes one or more sec_driver struct's in its source
209 * to define its characteristics.
210 * The probe procedure is called on a per device basis.
211 * The boot procedure is called on a per device driver basis.
212 * The interrupt procedure is used to initialize interupt vectors.
213 */
214
215 struct sec_driver {
216 char *sed_name; /* name, eg "sd" (no digit) */
217 u_char sed_base_chan; /* SEC base channel number */
218 int sed_cflags; /* per-driver flags (below) */
219 int (*sed_probe)(); /* probe procedure */
220 int (*sed_boot)(); /* boot procedure */
221 int (*sed_intr)(); /* intr procedure */
222 };
223
224 #define SED_HASINTR 0x00000001 /* has interrupt procedure */
225 #define SED_HASPROBE 0x00000002 /* has probe procedure */
226 #define SED_HASBOOT 0x00000004 /* has boot procedure */
227 #define SED_IS_SCSI 0x00000008 /* control devs on the scsi bus */
228 #define SED_MONOP 0x00000010 /* runs monoprocessor */
229
230 #define SED_TYPICAL (SED_HASINTR|SED_HASPROBE|SED_HASBOOT)
231
232 /*
233 * sec_conf entry points at array of sec_dev's; each sec_dev structure
234 * describes a single device on the scsi/ether board(s).
235 *
236 * After probing, driver boot procedure is called with a pointer to an
237 * array of these.
238 */
239 struct sec_dev {
240 u_int sd_flags; /* flags (arbitrary) */
241 u_char sd_bin; /* interrupt bin number */
242 short sd_req_size; /* size of the request queue */
243 short sd_doneq_size; /* size of the done queue */
244 /*
245 * The remaining fields are filled in when the configure() routine runs.
246 * sd_vector of first sec_dev in a set defines "base" vector.
247 */
248 short sd_sec_idx; /* sec index; -1 == wildcard */
249 short sd_target; /* target number */
250 short sd_unit; /* unit number */
251 struct sec_desc *sd_desc; /* host controller descriptor */
252 u_char sd_chan; /* channel number to interrupt */
253 u_char sd_vector; /* assigned interrupt vector */
254 u_char sd_destslic; /* id or group id to interrupt */
255 u_char sd_alive; /* is the device alive? */
256 struct sec_cib *sd_cib; /* device info cib */
257 struct sec_progq *sd_requestq; /* device input q location */
258 struct sec_progq *sd_doneq; /* device output q location */
259 };
260
261 /*
262 * Structure passed to Sec device's probe routine.
263 */
264
265 struct sec_probe {
266 struct sec_desc *secp_desc; /* SEC controller descriptor */
267 struct sec_powerup *secp_puq; /* command/status queues, etc. */
268 short secp_target; /* target number */
269 short secp_unit; /* unit number */
270 u_char secp_chan; /* channel number to interrupt */
271 u_int secp_flags; /* copy of sec_flags */
272 };
273
274 /*
275 * One of these exists per active SCSI/Ether Controller.
276 * Filled in by conf_scsi().
277 */
278 struct sec_desc {
279 u_int sec_diag_flags; /* flags from powerup */
280 short sec_target_no; /* host adapter target # */
281 u_char sec_slicaddr; /* slic address of SEC */
282 u_char sec_ether_addr[6]; /* ether address */
283 u_char sec_is_cons; /* is this the console? */
284 struct sec_powerup *sec_powerup; /* initial powerup queues */
285 u_short sec_version; /* firmware version */
286 };
287
288 /*
289 * table of entry points for b8k controller software
290 */
291
292 struct cntlrs {
293 int (*conf_b8k)(); /* to probe controllers */
294 int (*probe_b8k_devs)(); /* probe devices on controlles */
295 int (*b8k_map)(); /* initialize controller mappings */
296 };
297
298 #ifdef KERNEL
299 extern struct sec_desc *SEC_desc; /* array alloc'd by conf_scsi */
300 extern int NSEC; /* # SEC's to map at boot */
301 extern u_int SECvec; /* bit-vector of existing SEC's */
302 extern struct sec_conf sec_conf[]; /* descriptions set up by config(1) */
303
304 extern struct cntlrs b8k_cntlrs[]; /* table of controller functions */
305 #endif KERNEL
306
307 #endif _SQT_IOCONF_H_
Cache object: baacdfac52840fc6686b482f3da84f2a
|