scsiconf.c revision 1.111 1 1.111 thorpej /* $NetBSD: scsiconf.c,v 1.111 1998/10/10 01:14:26 thorpej Exp $ */
2 1.14 cgd
3 1.106 mycroft /*-
4 1.106 mycroft * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 1.106 mycroft * All rights reserved.
6 1.106 mycroft *
7 1.106 mycroft * This code is derived from software contributed to The NetBSD Foundation
8 1.111 thorpej * by Charles M. Hannum; Jason R. Thorpe of the Numerical Aerospace
9 1.111 thorpej * Simulation Facility, NASA Ames Research Center.
10 1.12 mycroft *
11 1.12 mycroft * Redistribution and use in source and binary forms, with or without
12 1.12 mycroft * modification, are permitted provided that the following conditions
13 1.12 mycroft * are met:
14 1.12 mycroft * 1. Redistributions of source code must retain the above copyright
15 1.12 mycroft * notice, this list of conditions and the following disclaimer.
16 1.12 mycroft * 2. Redistributions in binary form must reproduce the above copyright
17 1.12 mycroft * notice, this list of conditions and the following disclaimer in the
18 1.12 mycroft * documentation and/or other materials provided with the distribution.
19 1.12 mycroft * 3. All advertising materials mentioning features or use of this software
20 1.12 mycroft * must display the following acknowledgement:
21 1.106 mycroft * This product includes software developed by the NetBSD
22 1.106 mycroft * Foundation, Inc. and its contributors.
23 1.106 mycroft * 4. Neither the name of The NetBSD Foundation nor the names of its
24 1.106 mycroft * contributors may be used to endorse or promote products derived
25 1.106 mycroft * from this software without specific prior written permission.
26 1.12 mycroft *
27 1.106 mycroft * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 1.106 mycroft * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 1.106 mycroft * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 1.106 mycroft * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 1.106 mycroft * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 1.106 mycroft * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 1.106 mycroft * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 1.106 mycroft * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 1.106 mycroft * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 1.106 mycroft * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 1.106 mycroft * POSSIBILITY OF SUCH DAMAGE.
38 1.12 mycroft */
39 1.12 mycroft
40 1.12 mycroft /*
41 1.12 mycroft * Originally written by Julian Elischer (julian (at) tfs.com)
42 1.5 deraadt * for TRW Financial Systems for use under the MACH(2.5) operating system.
43 1.1 cgd *
44 1.1 cgd * TRW Financial Systems, in accordance with their agreement with Carnegie
45 1.1 cgd * Mellon University, makes this software available to CMU to distribute
46 1.1 cgd * or use in any manner that they see fit as long as this message is kept with
47 1.1 cgd * the software. For this reason TFS also grants any other persons or
48 1.1 cgd * organisations permission to use or modify this software.
49 1.1 cgd *
50 1.1 cgd * TFS supplies this software to be publicly redistributed
51 1.1 cgd * on the understanding that TFS is not responsible for the correct
52 1.1 cgd * functioning of this software in any circumstances.
53 1.7 cgd *
54 1.12 mycroft * Ported to run under 386BSD by Julian Elischer (julian (at) tfs.com) Sept 1992
55 1.1 cgd */
56 1.1 cgd
57 1.10 mycroft #include <sys/types.h>
58 1.10 mycroft #include <sys/param.h>
59 1.10 mycroft #include <sys/systm.h>
60 1.12 mycroft #include <sys/malloc.h>
61 1.12 mycroft #include <sys/device.h>
62 1.111 thorpej #include <sys/conf.h>
63 1.10 mycroft
64 1.88 bouyer #include <dev/scsipi/scsi_all.h>
65 1.88 bouyer #include <dev/scsipi/scsipi_all.h>
66 1.88 bouyer #include <dev/scsipi/scsiconf.h>
67 1.92 enami
68 1.88 bouyer #include "locators.h"
69 1.1 cgd
70 1.18 mycroft #if 0
71 1.12 mycroft #if NCALS > 0
72 1.18 mycroft { T_PROCESSOR, T_FIXED, 1,
73 1.18 mycroft 0, 0, 0 },
74 1.12 mycroft #endif /* NCALS */
75 1.1 cgd #if NBLL > 0
76 1.18 mycroft { T_PROCESSOR, T_FIXED, 1,
77 1.12 mycroft "AEG ", "READER ", "V1.0" },
78 1.12 mycroft #endif /* NBLL */
79 1.1 cgd #if NKIL > 0
80 1.18 mycroft { T_SCANNER, T_FIXED, 0,
81 1.18 mycroft "KODAK ", "IL Scanner 900 ", 0 },
82 1.12 mycroft #endif /* NKIL */
83 1.18 mycroft #endif
84 1.12 mycroft
85 1.12 mycroft /*
86 1.12 mycroft * Declarations
87 1.12 mycroft */
88 1.18 mycroft void scsi_probedev __P((struct scsibus_softc *, int, int));
89 1.18 mycroft int scsi_probe_bus __P((int bus, int target, int lun));
90 1.12 mycroft
91 1.88 bouyer struct scsipi_device probe_switch = {
92 1.12 mycroft NULL,
93 1.12 mycroft NULL,
94 1.12 mycroft NULL,
95 1.12 mycroft NULL,
96 1.12 mycroft };
97 1.12 mycroft
98 1.71 cgd int scsibusmatch __P((struct device *, struct cfdata *, void *));
99 1.12 mycroft void scsibusattach __P((struct device *, struct device *, void *));
100 1.71 cgd int scsibussubmatch __P((struct device *, struct cfdata *, void *));
101 1.12 mycroft
102 1.53 thorpej struct cfattach scsibus_ca = {
103 1.53 thorpej sizeof(struct scsibus_softc), scsibusmatch, scsibusattach
104 1.53 thorpej };
105 1.53 thorpej
106 1.94 thorpej extern struct cfdriver scsibus_cd;
107 1.12 mycroft
108 1.61 cgd int scsibusprint __P((void *, const char *));
109 1.51 thorpej
110 1.111 thorpej cdev_decl(scsibus);
111 1.88 bouyer
112 1.12 mycroft int
113 1.62 cgd scsiprint(aux, pnp)
114 1.62 cgd void *aux;
115 1.62 cgd const char *pnp;
116 1.62 cgd {
117 1.88 bouyer struct scsipi_link *l = aux;
118 1.62 cgd
119 1.62 cgd /* only "scsibus"es can attach to "scsi"s; easy. */
120 1.62 cgd if (pnp)
121 1.65 christos printf("scsibus at %s", pnp);
122 1.62 cgd
123 1.62 cgd /* don't print channel if the controller says there can be only one. */
124 1.88 bouyer if (l->scsipi_scsi.channel != SCSI_CHANNEL_ONLY_ONE)
125 1.88 bouyer printf(" channel %d", l->scsipi_scsi.channel);
126 1.62 cgd
127 1.62 cgd return (UNCONF);
128 1.62 cgd }
129 1.62 cgd
130 1.62 cgd int
131 1.71 cgd scsibusmatch(parent, cf, aux)
132 1.62 cgd struct device *parent;
133 1.71 cgd struct cfdata *cf;
134 1.71 cgd void *aux;
135 1.12 mycroft {
136 1.88 bouyer struct scsipi_link *l = aux;
137 1.62 cgd int channel;
138 1.62 cgd
139 1.62 cgd /*
140 1.62 cgd * Allow single-channel controllers to specify their channel
141 1.62 cgd * in a special way, so that it's not printed.
142 1.62 cgd */
143 1.88 bouyer channel = (l->scsipi_scsi.channel != SCSI_CHANNEL_ONLY_ONE) ?
144 1.92 enami l->scsipi_scsi.channel : 0;
145 1.62 cgd
146 1.88 bouyer if (cf->cf_loc[SCSICF_CHANNEL] != channel &&
147 1.92 enami cf->cf_loc[SCSICF_CHANNEL] != SCSICF_CHANNEL_DEFAULT)
148 1.62 cgd return (0);
149 1.12 mycroft
150 1.62 cgd return (1);
151 1.12 mycroft }
152 1.12 mycroft
153 1.12 mycroft /*
154 1.12 mycroft * The routine called by the adapter boards to get all their
155 1.12 mycroft * devices configured in.
156 1.12 mycroft */
157 1.12 mycroft void
158 1.12 mycroft scsibusattach(parent, self, aux)
159 1.88 bouyer struct device *parent, *self;
160 1.88 bouyer void *aux;
161 1.12 mycroft {
162 1.18 mycroft struct scsibus_softc *sb = (struct scsibus_softc *)self;
163 1.88 bouyer struct scsipi_link *sc_link_proto = aux;
164 1.72 thorpej size_t nbytes;
165 1.72 thorpej int i;
166 1.12 mycroft
167 1.88 bouyer sc_link_proto->scsipi_scsi.scsibus = sb->sc_dev.dv_unit;
168 1.88 bouyer sc_link_proto->scsipi_cmd = scsi_scsipi_cmd;
169 1.88 bouyer sc_link_proto->scsipi_interpret_sense = scsi_interpret_sense;
170 1.88 bouyer sc_link_proto->sc_print_addr = scsi_print_addr;
171 1.88 bouyer
172 1.12 mycroft sb->adapter_link = sc_link_proto;
173 1.88 bouyer sb->sc_maxtarget = sc_link_proto->scsipi_scsi.max_target;
174 1.72 thorpej printf(": %d targets\n", sb->sc_maxtarget + 1);
175 1.103 thorpej
176 1.103 thorpej /* Initialize shared data. */
177 1.103 thorpej scsipi_init();
178 1.72 thorpej
179 1.88 bouyer nbytes = sb->sc_maxtarget * sizeof(struct scsipi_link **);
180 1.88 bouyer sb->sc_link = (struct scsipi_link ***)malloc(nbytes, M_DEVBUF,
181 1.92 enami M_NOWAIT);
182 1.72 thorpej if (sb->sc_link == NULL)
183 1.72 thorpej panic("scsibusattach: can't allocate target links");
184 1.72 thorpej
185 1.88 bouyer nbytes = 8 * sizeof(struct scsipi_link *);
186 1.72 thorpej for (i = 0; i <= sb->sc_maxtarget; i++) {
187 1.88 bouyer sb->sc_link[i] = (struct scsipi_link **)malloc(nbytes,
188 1.92 enami M_DEVBUF, M_NOWAIT);
189 1.72 thorpej if (sb->sc_link[i] == NULL)
190 1.72 thorpej panic("scsibusattach: can't allocate lun links");
191 1.73 mycroft bzero(sb->sc_link[i], nbytes);
192 1.72 thorpej }
193 1.12 mycroft
194 1.12 mycroft #if defined(SCSI_DELAY) && SCSI_DELAY > 2
195 1.65 christos printf("%s: waiting for scsi devices to settle\n",
196 1.92 enami sb->sc_dev.dv_xname);
197 1.12 mycroft #else /* SCSI_DELAY > 2 */
198 1.12 mycroft #undef SCSI_DELAY
199 1.12 mycroft #define SCSI_DELAY 2
200 1.12 mycroft #endif /* SCSI_DELAY */
201 1.12 mycroft delay(1000000 * SCSI_DELAY);
202 1.12 mycroft
203 1.12 mycroft scsi_probe_bus(sb->sc_dev.dv_unit, -1, -1);
204 1.12 mycroft }
205 1.12 mycroft
206 1.18 mycroft int
207 1.71 cgd scsibussubmatch(parent, cf, aux)
208 1.18 mycroft struct device *parent;
209 1.71 cgd struct cfdata *cf;
210 1.71 cgd void *aux;
211 1.18 mycroft {
212 1.88 bouyer struct scsipibus_attach_args *sa = aux;
213 1.88 bouyer struct scsipi_link *sc_link = sa->sa_sc_link;
214 1.18 mycroft
215 1.88 bouyer if (cf->cf_loc[SCSIBUSCF_TARGET] != SCSIBUSCF_TARGET_DEFAULT &&
216 1.92 enami cf->cf_loc[SCSIBUSCF_TARGET] != sc_link->scsipi_scsi.target)
217 1.92 enami return (0);
218 1.88 bouyer if (cf->cf_loc[SCSIBUSCF_LUN] != SCSIBUSCF_LUN_DEFAULT &&
219 1.92 enami cf->cf_loc[SCSIBUSCF_LUN] != sc_link->scsipi_scsi.lun)
220 1.92 enami return (0);
221 1.71 cgd return ((*cf->cf_attach->ca_match)(parent, cf, aux));
222 1.18 mycroft }
223 1.18 mycroft
224 1.12 mycroft /*
225 1.12 mycroft * Probe the requested scsi bus. It must be already set up.
226 1.12 mycroft * -1 requests all set up scsi busses.
227 1.18 mycroft * target and lun optionally narrow the search if not -1
228 1.12 mycroft */
229 1.12 mycroft int
230 1.18 mycroft scsi_probe_busses(bus, target, lun)
231 1.18 mycroft int bus, target, lun;
232 1.12 mycroft {
233 1.12 mycroft
234 1.12 mycroft if (bus == -1) {
235 1.53 thorpej for (bus = 0; bus < scsibus_cd.cd_ndevs; bus++)
236 1.53 thorpej if (scsibus_cd.cd_devs[bus])
237 1.18 mycroft scsi_probe_bus(bus, target, lun);
238 1.92 enami return (0);
239 1.92 enami } else
240 1.92 enami return (scsi_probe_bus(bus, target, lun));
241 1.12 mycroft }
242 1.12 mycroft
243 1.12 mycroft /*
244 1.12 mycroft * Probe the requested scsi bus. It must be already set up.
245 1.18 mycroft * target and lun optionally narrow the search if not -1
246 1.12 mycroft */
247 1.12 mycroft int
248 1.18 mycroft scsi_probe_bus(bus, target, lun)
249 1.18 mycroft int bus, target, lun;
250 1.12 mycroft {
251 1.18 mycroft struct scsibus_softc *scsi;
252 1.18 mycroft int maxtarget, mintarget, maxlun, minlun;
253 1.18 mycroft u_int8_t scsi_addr;
254 1.12 mycroft
255 1.53 thorpej if (bus < 0 || bus >= scsibus_cd.cd_ndevs)
256 1.92 enami return (ENXIO);
257 1.53 thorpej scsi = scsibus_cd.cd_devs[bus];
258 1.92 enami if (scsi == NULL)
259 1.92 enami return (ENXIO);
260 1.12 mycroft
261 1.88 bouyer scsi_addr = scsi->adapter_link->scsipi_scsi.adapter_target;
262 1.12 mycroft
263 1.18 mycroft if (target == -1) {
264 1.72 thorpej maxtarget = scsi->sc_maxtarget;
265 1.18 mycroft mintarget = 0;
266 1.12 mycroft } else {
267 1.72 thorpej if (target < 0 || target > scsi->sc_maxtarget)
268 1.92 enami return (EINVAL);
269 1.18 mycroft maxtarget = mintarget = target;
270 1.12 mycroft }
271 1.1 cgd
272 1.12 mycroft if (lun == -1) {
273 1.12 mycroft maxlun = 7;
274 1.12 mycroft minlun = 0;
275 1.12 mycroft } else {
276 1.12 mycroft if (lun < 0 || lun > 7)
277 1.92 enami return (EINVAL);
278 1.12 mycroft maxlun = minlun = lun;
279 1.12 mycroft }
280 1.12 mycroft
281 1.18 mycroft for (target = mintarget; target <= maxtarget; target++) {
282 1.18 mycroft if (target == scsi_addr)
283 1.12 mycroft continue;
284 1.12 mycroft for (lun = minlun; lun <= maxlun; lun++) {
285 1.12 mycroft /*
286 1.18 mycroft * See if there's a device present, and configure it.
287 1.12 mycroft */
288 1.18 mycroft scsi_probedev(scsi, target, lun);
289 1.18 mycroft if ((scsi->moreluns & (1 << target)) == 0)
290 1.18 mycroft break;
291 1.12 mycroft /* otherwise something says we should look further */
292 1.12 mycroft }
293 1.8 deraadt }
294 1.92 enami return (0);
295 1.12 mycroft }
296 1.12 mycroft
297 1.88 bouyer /*
298 1.88 bouyer * Print out autoconfiguration information for a subdevice.
299 1.88 bouyer *
300 1.88 bouyer * This is a slight abuse of 'standard' autoconfiguration semantics,
301 1.88 bouyer * because 'print' functions don't normally print the colon and
302 1.88 bouyer * device information. However, in this case that's better than
303 1.88 bouyer * either printing redundant information before the attach message,
304 1.88 bouyer * or having the device driver call a special function to print out
305 1.88 bouyer * the standard device information.
306 1.88 bouyer */
307 1.88 bouyer int
308 1.88 bouyer scsibusprint(aux, pnp)
309 1.88 bouyer void *aux;
310 1.88 bouyer const char *pnp;
311 1.12 mycroft {
312 1.88 bouyer struct scsipibus_attach_args *sa = aux;
313 1.88 bouyer struct scsipi_inquiry_pattern *inqbuf;
314 1.88 bouyer u_int8_t type;
315 1.88 bouyer char *dtype, *qtype;
316 1.88 bouyer char vendor[33], product[65], revision[17];
317 1.88 bouyer int target, lun;
318 1.88 bouyer
319 1.88 bouyer if (pnp != NULL)
320 1.88 bouyer printf("%s", pnp);
321 1.88 bouyer
322 1.88 bouyer inqbuf = &sa->sa_inqbuf;
323 1.88 bouyer
324 1.88 bouyer target = sa->sa_sc_link->scsipi_scsi.target;
325 1.88 bouyer lun = sa->sa_sc_link->scsipi_scsi.lun;
326 1.88 bouyer
327 1.88 bouyer type = inqbuf->type & SID_TYPE;
328 1.88 bouyer
329 1.88 bouyer /*
330 1.88 bouyer * Figure out basic device type and qualifier.
331 1.88 bouyer */
332 1.88 bouyer dtype = 0;
333 1.88 bouyer switch (inqbuf->type & SID_QUAL) {
334 1.88 bouyer case SID_QUAL_LU_OK:
335 1.88 bouyer qtype = "";
336 1.88 bouyer break;
337 1.88 bouyer
338 1.88 bouyer case SID_QUAL_LU_OFFLINE:
339 1.88 bouyer qtype = " offline";
340 1.88 bouyer break;
341 1.88 bouyer
342 1.88 bouyer case SID_QUAL_RSVD:
343 1.88 bouyer case SID_QUAL_BAD_LU:
344 1.88 bouyer panic("scsibusprint: impossible qualifier");
345 1.12 mycroft
346 1.88 bouyer default:
347 1.88 bouyer qtype = "";
348 1.88 bouyer dtype = "vendor-unique";
349 1.88 bouyer break;
350 1.88 bouyer }
351 1.92 enami if (dtype == 0)
352 1.88 bouyer dtype = scsipi_dtype(type);
353 1.2 deraadt
354 1.104 drochner scsipi_strvis(vendor, 33, inqbuf->vendor, 8);
355 1.104 drochner scsipi_strvis(product, 65, inqbuf->product, 16);
356 1.104 drochner scsipi_strvis(revision, 17, inqbuf->revision, 4);
357 1.88 bouyer
358 1.88 bouyer printf(" targ %d lun %d: <%s, %s, %s> SCSI%d %d/%s %s%s",
359 1.92 enami target, lun, vendor, product, revision,
360 1.92 enami sa->scsipi_info.scsi_version & SID_ANSII, type, dtype,
361 1.92 enami inqbuf->removable ? "removable" : "fixed", qtype);
362 1.88 bouyer
363 1.88 bouyer return (UNCONF);
364 1.12 mycroft }
365 1.1 cgd
366 1.18 mycroft struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = {
367 1.48 christos {{T_CDROM, T_REMOV,
368 1.48 christos "CHINON ", "CD-ROM CDS-431 ", ""}, SDEV_NOLUNS},
369 1.48 christos {{T_CDROM, T_REMOV,
370 1.48 christos "Chinon ", "CD-ROM CDS-525 ", ""}, SDEV_NOLUNS},
371 1.48 christos {{T_CDROM, T_REMOV,
372 1.48 christos "CHINON ", "CD-ROM CDS-535 ", ""}, SDEV_NOLUNS},
373 1.100 thorpej {{T_CDROM, T_REMOV,
374 1.100 thorpej "DEC ", "RRD42 (C) DEC ", ""}, SDEV_NOLUNS},
375 1.48 christos {{T_CDROM, T_REMOV,
376 1.48 christos "DENON ", "DRD-25X ", "V"}, SDEV_NOLUNS},
377 1.83 mycroft {{T_CDROM, T_REMOV,
378 1.83 mycroft "HP ", "C4324/C4325 ", ""}, SDEV_NOLUNS},
379 1.48 christos {{T_CDROM, T_REMOV,
380 1.48 christos "IMS ", "CDD521/10 ", "2.06"}, SDEV_NOLUNS},
381 1.48 christos {{T_CDROM, T_REMOV,
382 1.68 mikel "MATSHITA", "CD-ROM CR-5XX ", "1.0b"}, SDEV_NOLUNS},
383 1.68 mikel {{T_CDROM, T_REMOV,
384 1.88 bouyer "MEDAVIS ", "RENO CD-ROMX2A ", ""}, SDEV_NOLUNS},
385 1.84 perry {{T_CDROM, T_REMOV,
386 1.77 mikel "MEDIAVIS", "CDR-H93MV ", "1.3"}, SDEV_NOLUNS},
387 1.48 christos {{T_CDROM, T_REMOV,
388 1.48 christos "NEC ", "CD-ROM DRIVE:55 ", ""}, SDEV_NOLUNS},
389 1.48 christos {{T_CDROM, T_REMOV,
390 1.48 christos "NEC ", "CD-ROM DRIVE:83 ", ""}, SDEV_NOLUNS},
391 1.48 christos {{T_CDROM, T_REMOV,
392 1.48 christos "NEC ", "CD-ROM DRIVE:84 ", ""}, SDEV_NOLUNS},
393 1.48 christos {{T_CDROM, T_REMOV,
394 1.48 christos "NEC ", "CD-ROM DRIVE:841", ""}, SDEV_NOLUNS},
395 1.70 thorpej {{T_CDROM, T_REMOV,
396 1.70 thorpej "PIONEER ", "CD-ROM DR-124X ", "1.01"}, SDEV_NOLUNS},
397 1.48 christos {{T_CDROM, T_REMOV,
398 1.48 christos "SONY ", "CD-ROM CDU-541 ", ""}, SDEV_NOLUNS},
399 1.48 christos {{T_CDROM, T_REMOV,
400 1.48 christos "SONY ", "CD-ROM CDU-55S ", ""}, SDEV_NOLUNS},
401 1.48 christos {{T_CDROM, T_REMOV,
402 1.48 christos "SONY ", "CD-ROM CDU-8003A", ""}, SDEV_NOLUNS},
403 1.48 christos {{T_CDROM, T_REMOV,
404 1.48 christos "SONY ", "CD-ROM CDU-8012 ", ""}, SDEV_NOLUNS},
405 1.48 christos {{T_CDROM, T_REMOV,
406 1.48 christos "TEAC ", "CD-ROM ", "1.06"}, SDEV_NOLUNS},
407 1.69 explorer {{T_CDROM, T_REMOV,
408 1.69 explorer "TEAC ", "CD-ROM CD-56S ", "1.0B"}, SDEV_NOLUNS},
409 1.48 christos {{T_CDROM, T_REMOV,
410 1.48 christos "TEXEL ", "CD-ROM ", "1.06"}, SDEV_NOLUNS},
411 1.48 christos {{T_CDROM, T_REMOV,
412 1.48 christos "TEXEL ", "CD-ROM DM-XX24 K", "1.10"}, SDEV_NOLUNS},
413 1.89 pk {{T_CDROM, T_REMOV,
414 1.89 pk "TOSHIBA ", "XM-4101TASUNSLCD", "1755"}, SDEV_NOLUNS},
415 1.92 enami {{T_CDROM, T_REMOV,
416 1.92 enami "ShinaKen", "CD-ROM DM-3x1S", "1.04"}, SDEV_NOLUNS},
417 1.98 explorer {{T_CDROM, T_REMOV,
418 1.98 explorer "JVC ", "R2626 ", "1.55"}, SDEV_NOLUNS},
419 1.80 pk {{T_DIRECT, T_FIXED,
420 1.80 pk "MICROP ", "1588-15MBSUN0669", ""}, SDEV_AUTOSAVE},
421 1.110 thorpej {{T_DIRECT, T_FIXED,
422 1.110 thorpej "MICROP ", "2217-15MQ1091501", ""}, SDEV_NOSYNCCACHE},
423 1.55 scottr {{T_OPTICAL, T_REMOV,
424 1.55 scottr "EPSON ", "OMD-5010 ", "3.08"}, SDEV_NOLUNS},
425 1.55 scottr
426 1.50 mycroft {{T_DIRECT, T_FIXED,
427 1.50 mycroft "DEC ", "RZ55 (C) DEC", ""}, SDEV_AUTOSAVE},
428 1.48 christos {{T_DIRECT, T_FIXED,
429 1.78 mycroft "EMULEX ", "MD21/S2 ESDI", "A00"}, SDEV_FORCELUNS|SDEV_AUTOSAVE},
430 1.91 bouyer /* Gives non-media hardware failure in response to start-unit command */
431 1.91 bouyer {{T_DIRECT, T_FIXED,
432 1.91 bouyer "HITACHI", "DK515C", "CP16"}, SDEV_NOSTARTUNIT},
433 1.91 bouyer {{T_DIRECT, T_FIXED,
434 1.91 bouyer "HITACHI", "DK515C", "CP15"}, SDEV_NOSTARTUNIT},
435 1.76 scottr {{T_DIRECT, T_FIXED,
436 1.108 mjacob "HP ", "C372", ""}, SDEV_NOTAG},
437 1.108 mjacob {{T_DIRECT, T_FIXED,
438 1.79 scottr "IBMRAID ", "0662S", ""}, SDEV_AUTOSAVE},
439 1.76 scottr {{T_DIRECT, T_FIXED,
440 1.79 scottr "IBM ", "0663H", ""}, SDEV_AUTOSAVE},
441 1.82 thorpej {{T_DIRECT, T_FIXED,
442 1.96 scottr "IBM", "0664", ""}, SDEV_AUTOSAVE},
443 1.84 perry {{T_DIRECT, T_FIXED,
444 1.96 scottr "IBM ", "H3171-S2", ""}, SDEV_NOLUNS|SDEV_AUTOSAVE},
445 1.96 scottr {{T_DIRECT, T_FIXED,
446 1.96 scottr "IBM ", "KZ-C", ""}, SDEV_AUTOSAVE},
447 1.81 thorpej /* Broken IBM disk */
448 1.81 thorpej {{T_DIRECT, T_FIXED,
449 1.81 thorpej "" , "DFRSS2F", ""}, SDEV_AUTOSAVE},
450 1.87 mjacob {{T_DIRECT, T_REMOV,
451 1.87 mjacob "MPL ", "MC-DISK- ", ""}, SDEV_NOLUNS},
452 1.48 christos {{T_DIRECT, T_FIXED,
453 1.48 christos "MAXTOR ", "XT-3280 ", ""}, SDEV_NOLUNS},
454 1.48 christos {{T_DIRECT, T_FIXED,
455 1.48 christos "MAXTOR ", "XT-4380S ", ""}, SDEV_NOLUNS},
456 1.48 christos {{T_DIRECT, T_FIXED,
457 1.48 christos "MAXTOR ", "MXT-1240S ", ""}, SDEV_NOLUNS},
458 1.48 christos {{T_DIRECT, T_FIXED,
459 1.48 christos "MAXTOR ", "XT-4170S ", ""}, SDEV_NOLUNS},
460 1.48 christos {{T_DIRECT, T_FIXED,
461 1.60 thorpej "MAXTOR ", "XT-8760S", ""}, SDEV_NOLUNS},
462 1.48 christos {{T_DIRECT, T_FIXED,
463 1.48 christos "MAXTOR ", "LXT-213S ", ""}, SDEV_NOLUNS},
464 1.48 christos {{T_DIRECT, T_FIXED,
465 1.48 christos "MAXTOR ", "LXT-213S SUN0207", ""}, SDEV_NOLUNS},
466 1.52 thorpej {{T_DIRECT, T_FIXED,
467 1.52 thorpej "MAXTOR ", "LXT-200S ", ""}, SDEV_NOLUNS},
468 1.48 christos {{T_DIRECT, T_FIXED,
469 1.90 mjacob "MEGADRV ", "EV1000", ""}, SDEV_NOMODESENSE},
470 1.90 mjacob {{T_DIRECT, T_FIXED,
471 1.48 christos "MST ", "SnapLink ", ""}, SDEV_NOLUNS},
472 1.54 hpeyerl {{T_DIRECT, T_FIXED,
473 1.54 hpeyerl "NEC ", "D3847 ", "0307"}, SDEV_NOLUNS},
474 1.96 scottr {{T_DIRECT, T_FIXED,
475 1.96 scottr "QUANTUM ", "ELS85S ", ""}, SDEV_AUTOSAVE},
476 1.48 christos {{T_DIRECT, T_FIXED,
477 1.48 christos "QUANTUM ", "LPS525S ", ""}, SDEV_NOLUNS},
478 1.48 christos {{T_DIRECT, T_FIXED,
479 1.48 christos "QUANTUM ", "P105S 910-10-94x", ""}, SDEV_NOLUNS},
480 1.48 christos {{T_DIRECT, T_FIXED,
481 1.48 christos "QUANTUM ", "PD1225S ", ""}, SDEV_NOLUNS},
482 1.48 christos {{T_DIRECT, T_FIXED,
483 1.48 christos "QUANTUM ", "PD210S SUN0207", ""}, SDEV_NOLUNS},
484 1.48 christos {{T_DIRECT, T_FIXED,
485 1.48 christos "RODIME ", "RO3000S ", ""}, SDEV_NOLUNS},
486 1.75 scottr {{T_DIRECT, T_FIXED,
487 1.75 scottr "SEAGATE ", "ST125N ", ""}, SDEV_NOLUNS},
488 1.48 christos {{T_DIRECT, T_FIXED,
489 1.48 christos "SEAGATE ", "ST157N ", ""}, SDEV_NOLUNS},
490 1.48 christos {{T_DIRECT, T_FIXED,
491 1.48 christos "SEAGATE ", "ST296 ", ""}, SDEV_NOLUNS},
492 1.48 christos {{T_DIRECT, T_FIXED,
493 1.48 christos "SEAGATE ", "ST296N ", ""}, SDEV_NOLUNS},
494 1.86 mjacob {{T_DIRECT, T_FIXED,
495 1.97 mjacob "SEAGATE ", "ST19171FC", ""}, SDEV_NOMODESENSE},
496 1.90 mjacob {{T_DIRECT, T_FIXED,
497 1.90 mjacob "SEAGATE ", "ST34501FC ", ""}, SDEV_NOMODESENSE},
498 1.48 christos {{T_DIRECT, T_FIXED,
499 1.48 christos "TOSHIBA ", "MK538FB ", "6027"}, SDEV_NOLUNS},
500 1.58 christos {{T_DIRECT, T_REMOV,
501 1.58 christos "iomega", "jaz 1GB", ""}, SDEV_NOMODESENSE},
502 1.59 explorer {{T_DIRECT, T_REMOV,
503 1.67 matthias "IOMEGA", "ZIP 100", ""}, SDEV_NOMODESENSE},
504 1.85 explorer /* Letting the motor run kills floppy drives and disks quite fast. */
505 1.67 matthias {{T_DIRECT, T_REMOV,
506 1.67 matthias "TEAC", "FC-1", ""}, SDEV_NOSTARTUNIT},
507 1.18 mycroft
508 1.37 cgd /* XXX: QIC-36 tape behind Emulex adapter. Very broken. */
509 1.48 christos {{T_SEQUENTIAL, T_REMOV,
510 1.48 christos " ", " ", " "}, SDEV_NOLUNS},
511 1.48 christos {{T_SEQUENTIAL, T_REMOV,
512 1.48 christos "CALIPER ", "CP150 ", ""}, SDEV_NOLUNS},
513 1.48 christos {{T_SEQUENTIAL, T_REMOV,
514 1.48 christos "EXABYTE ", "EXB-8200 ", ""}, SDEV_NOLUNS},
515 1.48 christos {{T_SEQUENTIAL, T_REMOV,
516 1.87 mjacob "SONY ", "GY-10C ", ""}, SDEV_NOLUNS},
517 1.87 mjacob {{T_SEQUENTIAL, T_REMOV,
518 1.48 christos "SONY ", "SDT-2000 ", "2.09"}, SDEV_NOLUNS},
519 1.48 christos {{T_SEQUENTIAL, T_REMOV,
520 1.108 mjacob "SONY ", "SDT-5000 ", "3."}, SDEV_NOSYNC|SDEV_NOWIDE},
521 1.48 christos {{T_SEQUENTIAL, T_REMOV,
522 1.48 christos "SONY ", "SDT-5200 ", "3."}, SDEV_NOLUNS},
523 1.48 christos {{T_SEQUENTIAL, T_REMOV,
524 1.48 christos "TANDBERG", " TDC 3600 ", ""}, SDEV_NOLUNS},
525 1.47 pk /* Following entry reported as a Tandberg 3600; ref. PR1933 */
526 1.48 christos {{T_SEQUENTIAL, T_REMOV,
527 1.48 christos "ARCHIVE ", "VIPER 150 21247", ""}, SDEV_NOLUNS},
528 1.91 bouyer /* Following entry for a Cipher ST150S; ref. PR4171 */
529 1.91 bouyer {{T_SEQUENTIAL, T_REMOV,
530 1.91 bouyer "ARCHIVE ", "VIPER 1500 21247", "2.2G"}, SDEV_NOLUNS},
531 1.80 pk {{T_SEQUENTIAL, T_REMOV,
532 1.80 pk "ARCHIVE ", "Python 28454-XXX", ""}, SDEV_NOLUNS},
533 1.48 christos {{T_SEQUENTIAL, T_REMOV,
534 1.48 christos "WANGTEK ", "5099ES SCSI", ""}, SDEV_NOLUNS},
535 1.48 christos {{T_SEQUENTIAL, T_REMOV,
536 1.48 christos "WANGTEK ", "5150ES SCSI", ""}, SDEV_NOLUNS},
537 1.48 christos {{T_SEQUENTIAL, T_REMOV,
538 1.108 mjacob "WangDAT ", "Model 1300 ", "02.4"}, SDEV_NOSYNC|SDEV_NOWIDE},
539 1.48 christos {{T_SEQUENTIAL, T_REMOV,
540 1.108 mjacob "WangDAT ", "Model 2600 ", "01.7"}, SDEV_NOSYNC|SDEV_NOWIDE},
541 1.48 christos {{T_SEQUENTIAL, T_REMOV,
542 1.108 mjacob "WangDAT ", "Model 3200 ", "02.2"}, SDEV_NOSYNC|SDEV_NOWIDE},
543 1.87 mjacob
544 1.101 bouyer {{T_SCANNER, T_FIXED,
545 1.101 bouyer "RICOH ", "IS60 ", "1R08"}, SDEV_NOLUNS},
546 1.99 thorpej {{T_SCANNER, T_FIXED,
547 1.99 thorpej "UMAX ", "Astra 1200S ", "V2.9"}, SDEV_NOLUNS},
548 1.102 fvdl {{T_SCANNER, T_FIXED,
549 1.102 fvdl "UMAX ", "Astra 1220S ", "V1.2"}, SDEV_NOLUNS},
550 1.85 explorer {{T_SCANNER, T_FIXED,
551 1.85 explorer "UMAX ", "UMAX S-6E ", "V2.0"}, SDEV_NOLUNS},
552 1.95 mikel {{T_SCANNER, T_FIXED,
553 1.95 mikel "UMAX ", "UMAX S-12 ", "V2.1"}, SDEV_NOLUNS},
554 1.87 mjacob
555 1.87 mjacob {{T_PROCESSOR, T_FIXED,
556 1.87 mjacob "LITRONIC", "PCMCIA ", ""}, SDEV_NOLUNS},
557 1.109 thorpej
558 1.109 thorpej {{T_CHANGER, T_REMOV,
559 1.109 thorpej "SONY ", "CDL1100 ", ""}, SDEV_NOLUNS},
560 1.18 mycroft };
561 1.18 mycroft
562 1.12 mycroft /*
563 1.95 mikel * given a target and lun, ask the device what
564 1.12 mycroft * it is, and find the correct driver table
565 1.12 mycroft * entry.
566 1.12 mycroft */
567 1.18 mycroft void
568 1.18 mycroft scsi_probedev(scsi, target, lun)
569 1.18 mycroft struct scsibus_softc *scsi;
570 1.18 mycroft int target, lun;
571 1.18 mycroft {
572 1.88 bouyer struct scsipi_link *sc_link;
573 1.88 bouyer static struct scsipi_inquiry_data inqbuf;
574 1.18 mycroft struct scsi_quirk_inquiry_pattern *finger;
575 1.51 thorpej int checkdtype, priority;
576 1.88 bouyer struct scsipibus_attach_args sa;
577 1.18 mycroft struct cfdata *cf;
578 1.18 mycroft
579 1.18 mycroft /* Skip this slot if it is already attached. */
580 1.92 enami if (scsi->sc_link[target][lun] != NULL)
581 1.18 mycroft return;
582 1.18 mycroft
583 1.18 mycroft sc_link = malloc(sizeof(*sc_link), M_DEVBUF, M_NOWAIT);
584 1.18 mycroft *sc_link = *scsi->adapter_link;
585 1.88 bouyer sc_link->scsipi_scsi.target = target;
586 1.88 bouyer sc_link->scsipi_scsi.lun = lun;
587 1.18 mycroft sc_link->device = &probe_switch;
588 1.12 mycroft
589 1.12 mycroft /*
590 1.12 mycroft * Ask the device what it is
591 1.12 mycroft */
592 1.88 bouyer #if defined(SCSIDEBUG) && DEBUGTYPE == BUS_SCSI
593 1.18 mycroft if (target == DEBUGTARGET && lun == DEBUGLUN)
594 1.12 mycroft sc_link->flags |= DEBUGLEVEL;
595 1.23 mycroft #endif /* SCSIDEBUG */
596 1.2 deraadt
597 1.88 bouyer (void) scsipi_test_unit_ready(sc_link,
598 1.92 enami SCSI_AUTOCONF | SCSI_IGNORE_ILLEGAL_REQUEST |
599 1.92 enami SCSI_IGNORE_NOT_READY | SCSI_IGNORE_MEDIA_CHANGE);
600 1.18 mycroft
601 1.23 mycroft #ifdef SCSI_2_DEF
602 1.12 mycroft /* some devices need to be told to go to SCSI2 */
603 1.12 mycroft /* However some just explode if you tell them this.. leave it out */
604 1.18 mycroft scsi_change_def(sc_link, SCSI_AUTOCONF | SCSI_SILENT);
605 1.18 mycroft #endif /* SCSI_2_DEF */
606 1.18 mycroft
607 1.18 mycroft /* Now go ask the device all about itself. */
608 1.18 mycroft bzero(&inqbuf, sizeof(inqbuf));
609 1.88 bouyer if (scsipi_inquire(sc_link, &inqbuf, SCSI_AUTOCONF) != 0)
610 1.18 mycroft goto bad;
611 1.18 mycroft
612 1.18 mycroft {
613 1.18 mycroft int len = inqbuf.additional_length;
614 1.20 mycroft while (len < 3)
615 1.20 mycroft inqbuf.unused[len++] = '\0';
616 1.20 mycroft while (len < 3 + 28)
617 1.20 mycroft inqbuf.unused[len++] = ' ';
618 1.18 mycroft }
619 1.18 mycroft
620 1.88 bouyer sa.sa_sc_link = sc_link;
621 1.88 bouyer sa.sa_inqbuf.type = inqbuf.device;
622 1.88 bouyer sa.sa_inqbuf.removable = inqbuf.dev_qual2 & SID_REMOVABLE ?
623 1.92 enami T_REMOV : T_FIXED;
624 1.88 bouyer sa.sa_inqbuf.vendor = inqbuf.vendor;
625 1.88 bouyer sa.sa_inqbuf.product = inqbuf.product;
626 1.88 bouyer sa.sa_inqbuf.revision = inqbuf.revision;
627 1.88 bouyer sa.scsipi_info.scsi_version = inqbuf.version;
628 1.88 bouyer
629 1.92 enami finger = (struct scsi_quirk_inquiry_pattern *)scsipi_inqmatch(
630 1.92 enami &sa.sa_inqbuf, (caddr_t)scsi_quirk_patterns,
631 1.92 enami sizeof(scsi_quirk_patterns)/sizeof(scsi_quirk_patterns[0]),
632 1.92 enami sizeof(scsi_quirk_patterns[0]), &priority);
633 1.108 mjacob
634 1.108 mjacob /*
635 1.108 mjacob * Based upon the inquiry flags we got back, and if we're
636 1.108 mjacob * at SCSI-2 or better, set some limiting quirks.
637 1.108 mjacob */
638 1.108 mjacob if ((inqbuf.version & SID_ANSII) >= 2) {
639 1.108 mjacob if ((inqbuf.flags & SID_CmdQue) == 0)
640 1.108 mjacob sc_link->quirks |= SDEV_NOTAG;
641 1.108 mjacob if ((inqbuf.flags & SID_Sync) == 0)
642 1.108 mjacob sc_link->quirks |= SDEV_NOSYNC;
643 1.108 mjacob if ((inqbuf.flags & SID_WBus16) == 0)
644 1.108 mjacob sc_link->quirks |= SDEV_NOWIDE;
645 1.108 mjacob }
646 1.108 mjacob /*
647 1.108 mjacob * Now apply any quirks from the table.
648 1.108 mjacob */
649 1.18 mycroft if (priority != 0)
650 1.18 mycroft sc_link->quirks |= finger->quirks;
651 1.36 cgd if ((inqbuf.version & SID_ANSII) == 0 &&
652 1.92 enami (sc_link->quirks & SDEV_FORCELUNS) == 0)
653 1.18 mycroft sc_link->quirks |= SDEV_NOLUNS;
654 1.88 bouyer sc_link->scsipi_scsi.scsi_version = inqbuf.version;
655 1.12 mycroft
656 1.18 mycroft if ((sc_link->quirks & SDEV_NOLUNS) == 0)
657 1.18 mycroft scsi->moreluns |= (1 << target);
658 1.12 mycroft
659 1.12 mycroft /*
660 1.12 mycroft * note what BASIC type of device it is
661 1.12 mycroft */
662 1.51 thorpej if ((inqbuf.dev_qual2 & SID_REMOVABLE) != 0)
663 1.18 mycroft sc_link->flags |= SDEV_REMOVABLE;
664 1.12 mycroft
665 1.12 mycroft /*
666 1.12 mycroft * Any device qualifier that has the top bit set (qualifier&4 != 0)
667 1.12 mycroft * is vendor specific and won't match in this switch.
668 1.51 thorpej * All we do here is throw out bad/negative responses.
669 1.12 mycroft */
670 1.51 thorpej checkdtype = 0;
671 1.18 mycroft switch (inqbuf.device & SID_QUAL) {
672 1.12 mycroft case SID_QUAL_LU_OK:
673 1.12 mycroft case SID_QUAL_LU_OFFLINE:
674 1.51 thorpej checkdtype = 1;
675 1.2 deraadt break;
676 1.12 mycroft
677 1.12 mycroft case SID_QUAL_RSVD:
678 1.12 mycroft case SID_QUAL_BAD_LU:
679 1.18 mycroft goto bad;
680 1.12 mycroft
681 1.2 deraadt default:
682 1.2 deraadt break;
683 1.2 deraadt }
684 1.92 enami if (checkdtype)
685 1.51 thorpej switch (inqbuf.device & SID_TYPE) {
686 1.2 deraadt case T_DIRECT:
687 1.2 deraadt case T_SEQUENTIAL:
688 1.2 deraadt case T_PRINTER:
689 1.2 deraadt case T_PROCESSOR:
690 1.93 thorpej case T_WORM:
691 1.18 mycroft case T_CDROM:
692 1.2 deraadt case T_SCANNER:
693 1.2 deraadt case T_OPTICAL:
694 1.2 deraadt case T_CHANGER:
695 1.2 deraadt case T_COMM:
696 1.93 thorpej case T_IT8_1:
697 1.93 thorpej case T_IT8_2:
698 1.93 thorpej case T_STORARRAY:
699 1.93 thorpej case T_ENCLOSURE:
700 1.51 thorpej default:
701 1.2 deraadt break;
702 1.12 mycroft case T_NODEVICE:
703 1.18 mycroft goto bad;
704 1.1 cgd }
705 1.2 deraadt
706 1.92 enami if ((cf = config_search(scsibussubmatch, (struct device *)scsi,
707 1.92 enami &sa)) != NULL) {
708 1.41 pk scsi->sc_link[target][lun] = sc_link;
709 1.51 thorpej config_attach((struct device *)scsi, cf, &sa, scsibusprint);
710 1.51 thorpej } else {
711 1.51 thorpej scsibusprint(&sa, scsi->sc_dev.dv_xname);
712 1.65 christos printf(" not configured\n");
713 1.18 mycroft goto bad;
714 1.51 thorpej }
715 1.18 mycroft
716 1.18 mycroft return;
717 1.12 mycroft
718 1.18 mycroft bad:
719 1.18 mycroft free(sc_link, M_DEVBUF);
720 1.18 mycroft return;
721 1.111 thorpej }
722 1.111 thorpej
723 1.111 thorpej /****** Entry points for user control of the SCSI bus. ******/
724 1.111 thorpej
725 1.111 thorpej int
726 1.111 thorpej scsibusopen(dev, flag, fmt, p)
727 1.111 thorpej dev_t dev;
728 1.111 thorpej int flag, fmt;
729 1.111 thorpej struct proc *p;
730 1.111 thorpej {
731 1.111 thorpej struct scsibus_softc *sc;
732 1.111 thorpej struct scsipi_link *sc_link;
733 1.111 thorpej int unit = minor(dev);
734 1.111 thorpej
735 1.111 thorpej if (unit >= scsibus_cd.cd_ndevs ||
736 1.111 thorpej (sc = scsibus_cd.cd_devs[unit]) == NULL)
737 1.111 thorpej return (ENXIO);
738 1.111 thorpej
739 1.111 thorpej sc_link = sc->adapter_link;
740 1.111 thorpej
741 1.111 thorpej if (sc_link->flags & SDEV_OPEN)
742 1.111 thorpej return (EBUSY);
743 1.111 thorpej
744 1.111 thorpej sc_link->flags |= SDEV_OPEN;
745 1.111 thorpej
746 1.111 thorpej return (0);
747 1.111 thorpej }
748 1.111 thorpej
749 1.111 thorpej int
750 1.111 thorpej scsibusclose(dev, flag, fmt, p)
751 1.111 thorpej dev_t dev;
752 1.111 thorpej int flag, fmt;
753 1.111 thorpej struct proc *p;
754 1.111 thorpej {
755 1.111 thorpej struct scsibus_softc *sc = scsibus_cd.cd_devs[minor(dev)];
756 1.111 thorpej struct scsipi_link *sc_link = sc->adapter_link;
757 1.111 thorpej
758 1.111 thorpej sc_link->flags &= ~SDEV_OPEN;
759 1.111 thorpej
760 1.111 thorpej return (0);
761 1.111 thorpej }
762 1.111 thorpej
763 1.111 thorpej int
764 1.111 thorpej scsibusioctl(dev, cmd, addr, flag, p)
765 1.111 thorpej dev_t dev;
766 1.111 thorpej u_long cmd;
767 1.111 thorpej caddr_t addr;
768 1.111 thorpej int flag;
769 1.111 thorpej struct proc *p;
770 1.111 thorpej {
771 1.111 thorpej #if 0
772 1.111 thorpej struct scsibus_softc *sc = scsibus_cd.cd_devs[minor(dev)];
773 1.111 thorpej struct scsipi_link *sc_link = sc->adapter_link;
774 1.111 thorpej #endif
775 1.111 thorpej int error;
776 1.111 thorpej
777 1.111 thorpej switch (cmd) {
778 1.111 thorpej default:
779 1.111 thorpej error = ENOTTY;
780 1.111 thorpej }
781 1.111 thorpej
782 1.111 thorpej return (error);
783 1.1 cgd }
784