umass_scsipi.c revision 1.16 1 /* $NetBSD: umass_scsipi.c,v 1.16 2003/09/13 03:16:49 mycroft Exp $ */
2
3 /*
4 * Copyright (c) 2001, 2003 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart (at) augustsson.net) at
9 * Carlstedt Research & Technology and by Charles M. Hamnnum.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the NetBSD
22 * Foundation, Inc. and its contributors.
23 * 4. Neither the name of The NetBSD Foundation nor the names of its
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40 #include <sys/cdefs.h>
41 __KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.16 2003/09/13 03:16:49 mycroft Exp $");
42
43 #include "atapibus.h"
44 #include "scsibus.h"
45
46 #include <sys/param.h>
47 #include <sys/systm.h>
48 #include <sys/kernel.h>
49 #include <sys/conf.h>
50 #include <sys/buf.h>
51 #include <sys/device.h>
52 #include <sys/ioctl.h>
53 #include <sys/malloc.h>
54
55 /* SCSI & ATAPI */
56 #include <sys/scsiio.h>
57 #include <dev/scsipi/scsi_all.h>
58 #include <dev/scsipi/scsipi_all.h>
59 #include <dev/scsipi/scsiconf.h>
60
61 #include <dev/scsipi/atapiconf.h>
62
63 #include <dev/scsipi/scsipi_disk.h>
64 #include <dev/scsipi/scsi_disk.h>
65 #include <dev/scsipi/scsi_changer.h>
66
67 #include <dev/scsipi/atapi_disk.h>
68
69 #include <sys/disk.h> /* XXX */
70 #include <dev/scsipi/sdvar.h> /* XXX */
71
72 /* USB */
73 #include <dev/usb/usb.h>
74 #include <dev/usb/usbdi.h>
75 #include <dev/usb/usbdi_util.h>
76 #include <dev/usb/usbdevs.h>
77
78 #include <dev/usb/umassvar.h>
79 #include <dev/usb/umass_scsipi.h>
80
81 struct umass_scsipi_softc {
82 struct umassbus_softc base;
83
84 struct atapi_adapter sc_atapi_adapter;
85 #define sc_adapter sc_atapi_adapter._generic
86 struct scsipi_channel sc_channel;
87 usbd_status sc_sync_status;
88 struct scsipi_sense sc_sense_cmd;
89 };
90
91
92 #define SHORT_INQUIRY_LENGTH 36 /* XXX */
93
94 #define UMASS_ATAPI_DRIVE 0
95
96 Static void umass_scsipi_request(struct scsipi_channel *,
97 scsipi_adapter_req_t, void *);
98 Static void umass_scsipi_minphys(struct buf *bp);
99 Static int umass_scsipi_ioctl(struct scsipi_channel *, u_long,
100 caddr_t, int, usb_proc_ptr );
101 Static int umass_scsipi_getgeom(struct scsipi_periph *periph,
102 struct disk_parms *, u_long sectors);
103
104 Static void umass_scsipi_cb(struct umass_softc *sc, void *priv,
105 int residue, int status);
106 Static void umass_scsipi_sense_cb(struct umass_softc *sc, void *priv,
107 int residue, int status);
108
109 Static struct umass_scsipi_softc *umass_scsipi_setup(struct umass_softc *sc);
110
111 Static int scsipiprint(void *aux, const char *pnp);
112
113 #if NATAPIBUS > 0
114 Static void umass_atapi_probe_device(struct atapibus_softc *, int);
115
116 const struct scsipi_bustype umass_atapi_bustype = {
117 SCSIPI_BUSTYPE_ATAPI,
118 atapi_scsipi_cmd,
119 atapi_interpret_sense,
120 atapi_print_addr,
121 scsi_kill_pending,
122 };
123 #endif
124
125
126 #if NSCSIBUS > 0
127 int
128 umass_scsi_attach(struct umass_softc *sc)
129 {
130 struct umass_scsipi_softc *scbus;
131
132 scbus = umass_scsipi_setup(sc);
133
134 scbus->sc_channel.chan_bustype = &scsi_bustype;
135 scbus->sc_channel.chan_ntargets = 2;
136 scbus->sc_channel.chan_nluns = sc->maxlun + 1;
137 scbus->sc_channel.chan_id = scbus->sc_channel.chan_ntargets - 1;
138 DPRINTF(UDMASS_USB, ("%s: umass_attach_bus: SCSI\n",
139 USBDEVNAME(sc->sc_dev)));
140
141 sc->sc_refcnt++;
142 scbus->base.sc_child =
143 config_found(&sc->sc_dev, &scbus->sc_channel, scsipiprint);
144 if (--sc->sc_refcnt < 0)
145 usb_detach_wakeup(USBDEV(sc->sc_dev));
146
147 return (0);
148 }
149 #endif
150
151 #if NATAPIBUS > 0
152 int
153 umass_atapi_attach(struct umass_softc *sc)
154 {
155 struct umass_scsipi_softc *scbus;
156
157 scbus = umass_scsipi_setup(sc);
158 scbus->sc_atapi_adapter.atapi_probe_device = umass_atapi_probe_device;
159
160 scbus->sc_channel.chan_bustype = &umass_atapi_bustype;
161 scbus->sc_channel.chan_ntargets = 2;
162 scbus->sc_channel.chan_nluns = 1;
163
164 scbus->sc_channel.chan_defquirks |= sc->sc_busquirks;
165 DPRINTF(UDMASS_USB, ("%s: umass_attach_bus: ATAPI\n",
166 USBDEVNAME(sc->sc_dev)));
167
168 sc->sc_refcnt++;
169 scbus->base.sc_child =
170 config_found(&sc->sc_dev, &scbus->sc_channel, scsipiprint);
171 if (--sc->sc_refcnt < 0)
172 usb_detach_wakeup(USBDEV(sc->sc_dev));
173
174 return (0);
175 }
176 #endif
177
178 Static struct umass_scsipi_softc *
179 umass_scsipi_setup(struct umass_softc *sc)
180 {
181 struct umass_scsipi_softc *scbus;
182
183 scbus = malloc(sizeof *scbus, M_DEVBUF, M_WAITOK | M_ZERO);
184 sc->bus = &scbus->base;
185
186 /* Only use big commands for USB SCSI devices. */
187 sc->sc_busquirks |= PQUIRK_ONLYBIG;
188
189 /* Fill in the adapter. */
190 memset(&scbus->sc_adapter, 0, sizeof(scbus->sc_adapter));
191 scbus->sc_adapter.adapt_dev = &sc->sc_dev;
192 scbus->sc_adapter.adapt_nchannels = 1;
193 scbus->sc_adapter.adapt_request = umass_scsipi_request;
194 scbus->sc_adapter.adapt_minphys = umass_scsipi_minphys;
195 scbus->sc_adapter.adapt_ioctl = umass_scsipi_ioctl;
196 scbus->sc_adapter.adapt_getgeom = umass_scsipi_getgeom;
197
198 /* Fill in the channel. */
199 memset(&scbus->sc_channel, 0, sizeof(scbus->sc_channel));
200 scbus->sc_channel.chan_adapter = &scbus->sc_adapter;
201 scbus->sc_channel.chan_channel = 0;
202 scbus->sc_channel.chan_flags = SCSIPI_CHAN_OPENINGS | SCSIPI_CHAN_NOSETTLE;
203 scbus->sc_channel.chan_openings = 1;
204 scbus->sc_channel.chan_max_periph = 1;
205 scbus->sc_channel.chan_defquirks |= sc->sc_busquirks;
206
207 return (scbus);
208 }
209
210 Static int
211 scsipiprint(void *aux, const char *pnp)
212 {
213 struct scsipi_channel *chan = aux;
214
215 if (chan->chan_bustype->bustype_type == SCSIPI_BUSTYPE_SCSI) {
216 #if NSCSIBUS > 0
217 return (scsiprint(aux, pnp));
218 #else
219 if (pnp)
220 aprint_normal("scsibus at %s", pnp);
221 return (UNCONF);
222 #endif
223 } else {
224 #if NATAPIBUS > 0
225 return (atapiprint(aux, pnp));
226 #else
227 if (pnp)
228 aprint_normal("atapibus at %s", pnp);
229 return (UNCONF);
230 #endif
231 }
232 }
233
234 Static void
235 umass_scsipi_request(struct scsipi_channel *chan,
236 scsipi_adapter_req_t req, void *arg)
237 {
238 struct scsipi_adapter *adapt = chan->chan_adapter;
239 struct scsipi_periph *periph;
240 struct scsipi_xfer *xs;
241 struct umass_softc *sc = (void *)adapt->adapt_dev;
242 struct umass_scsipi_softc *scbus = (struct umass_scsipi_softc *)sc->bus;
243 struct scsipi_generic *cmd;
244 int cmdlen;
245 int dir;
246 #ifdef UMASS_DEBUG
247 microtime(&sc->tv);
248 #endif
249 switch(req) {
250 case ADAPTER_REQ_RUN_XFER:
251 xs = arg;
252 periph = xs->xs_periph;
253 DIF(UDMASS_UPPER, periph->periph_dbflags |= SCSIPI_DEBUG_FLAGS);
254
255 DPRINTF(UDMASS_CMD, ("%s: umass_scsi_cmd: at %lu.%06lu: %d:%d "
256 "xs=%p cmd=0x%02x datalen=%d (quirks=0x%x, poll=%d)\n",
257 USBDEVNAME(sc->sc_dev), sc->tv.tv_sec, sc->tv.tv_usec,
258 periph->periph_target, periph->periph_lun,
259 xs, xs->cmd->opcode, xs->datalen,
260 periph->periph_quirks, xs->xs_control & XS_CTL_POLL));
261 #if defined(USB_DEBUG) && defined(SCSIPI_DEBUG)
262 if (umassdebug & UDMASS_SCSI)
263 show_scsipi_xs(xs);
264 else if (umassdebug & ~UDMASS_CMD)
265 show_scsipi_cmd(xs);
266 #endif
267
268 if (sc->sc_dying) {
269 xs->error = XS_DRIVER_STUFFUP;
270 goto done;
271 }
272
273 #ifdef UMASS_DEBUG
274 if (chan->chan_bustype->bustype_type == SCSIPI_BUSTYPE_ATAPI ?
275 periph->periph_target != UMASS_ATAPI_DRIVE :
276 periph->periph_target == chan->chan_id) {
277 DPRINTF(UDMASS_SCSI, ("%s: wrong SCSI ID %d\n",
278 USBDEVNAME(sc->sc_dev),
279 periph->periph_target));
280 xs->error = XS_DRIVER_STUFFUP;
281 goto done;
282 }
283 #endif
284
285 cmd = xs->cmd;
286 cmdlen = xs->cmdlen;
287
288 dir = DIR_NONE;
289 if (xs->datalen) {
290 switch (xs->xs_control &
291 (XS_CTL_DATA_IN | XS_CTL_DATA_OUT)) {
292 case XS_CTL_DATA_IN:
293 dir = DIR_IN;
294 break;
295 case XS_CTL_DATA_OUT:
296 dir = DIR_OUT;
297 break;
298 }
299 }
300
301 if (xs->datalen > UMASS_MAX_TRANSFER_SIZE) {
302 printf("umass_cmd: large datalen, %d\n", xs->datalen);
303 xs->error = XS_DRIVER_STUFFUP;
304 goto done;
305 }
306
307 if (xs->xs_control & XS_CTL_POLL) {
308 /* Use sync transfer. XXX Broken! */
309 DPRINTF(UDMASS_SCSI,
310 ("umass_scsi_cmd: sync dir=%d\n", dir));
311 sc->sc_xfer_flags = USBD_SYNCHRONOUS;
312 scbus->sc_sync_status = USBD_INVAL;
313 sc->sc_methods->wire_xfer(sc, periph->periph_lun, cmd,
314 cmdlen, xs->data,
315 xs->datalen, dir,
316 xs->timeout, 0, xs);
317 sc->sc_xfer_flags = 0;
318 DPRINTF(UDMASS_SCSI, ("umass_scsi_cmd: done err=%d\n",
319 scbus->sc_sync_status));
320 switch (scbus->sc_sync_status) {
321 case USBD_NORMAL_COMPLETION:
322 xs->error = XS_NOERROR;
323 break;
324 case USBD_TIMEOUT:
325 xs->error = XS_TIMEOUT;
326 break;
327 default:
328 xs->error = XS_DRIVER_STUFFUP;
329 break;
330 }
331 goto done;
332 } else {
333 DPRINTF(UDMASS_SCSI,
334 ("umass_scsi_cmd: async dir=%d, cmdlen=%d"
335 " datalen=%d\n",
336 dir, cmdlen, xs->datalen));
337 sc->sc_methods->wire_xfer(sc, periph->periph_lun, cmd,
338 cmdlen, xs->data,
339 xs->datalen, dir,
340 xs->timeout,
341 umass_scsipi_cb, xs);
342 return;
343 }
344
345 /* Return if command finishes early. */
346 done:
347 scsipi_done(xs);
348 return;
349 default:
350 /* Not supported, nothing to do. */
351 ;
352 }
353 }
354
355 Static void
356 umass_scsipi_minphys(struct buf *bp)
357 {
358 #ifdef DIAGNOSTIC
359 if (bp->b_bcount <= 0) {
360 printf("umass_scsipi_minphys count(%ld) <= 0\n",
361 bp->b_bcount);
362 bp->b_bcount = UMASS_MAX_TRANSFER_SIZE;
363 }
364 #endif
365 if (bp->b_bcount > UMASS_MAX_TRANSFER_SIZE)
366 bp->b_bcount = UMASS_MAX_TRANSFER_SIZE;
367 minphys(bp);
368 }
369
370 int
371 umass_scsipi_ioctl(struct scsipi_channel *chan, u_long cmd, caddr_t arg,
372 int flag, usb_proc_ptr p)
373 {
374 /*struct umass_softc *sc = link->adapter_softc;*/
375 /*struct umass_scsipi_softc *scbus = sc->bus;*/
376
377 switch (cmd) {
378 #if 0
379 case SCBUSIORESET:
380 ccb->ccb_h.status = CAM_REQ_INPROG;
381 umass_reset(sc, umass_cam_cb, (void *) ccb);
382 return (0);
383 #endif
384 default:
385 return (ENOTTY);
386 }
387 }
388
389 Static int
390 umass_scsipi_getgeom(struct scsipi_periph *periph, struct disk_parms *dp,
391 u_long sectors)
392 {
393 struct umass_softc *sc =
394 (void *)periph->periph_channel->chan_adapter->adapt_dev;
395
396 /* If it's not a floppy, we don't know what to do. */
397 if (sc->sc_cmd != UMASS_CPROTO_UFI)
398 return (0);
399
400 switch (sectors) {
401 case 1440:
402 /* Most likely a single density 3.5" floppy. */
403 dp->heads = 2;
404 dp->sectors = 9;
405 dp->cyls = 80;
406 return (1);
407 case 2880:
408 /* Most likely a double density 3.5" floppy. */
409 dp->heads = 2;
410 dp->sectors = 18;
411 dp->cyls = 80;
412 return (1);
413 default:
414 return (0);
415 }
416 }
417
418 Static void
419 umass_scsipi_cb(struct umass_softc *sc, void *priv, int residue, int status)
420 {
421 struct umass_scsipi_softc *scbus = (struct umass_scsipi_softc *)sc->bus;
422 struct scsipi_xfer *xs = priv;
423 struct scsipi_periph *periph = xs->xs_periph;
424 int cmdlen;
425 int s;
426 #ifdef UMASS_DEBUG
427 struct timeval tv;
428 u_int delta;
429 microtime(&tv);
430 delta = (tv.tv_sec - sc->tv.tv_sec) * 1000000 + tv.tv_usec - sc->tv.tv_usec;
431 #endif
432
433 DPRINTF(UDMASS_CMD,("umass_scsipi_cb: at %lu.%06lu, delta=%u: xs=%p residue=%d"
434 " status=%d\n", tv.tv_sec, tv.tv_usec, delta, xs, residue, status));
435
436 xs->resid = residue;
437
438 switch (status) {
439 case STATUS_CMD_OK:
440 xs->error = XS_NOERROR;
441 break;
442
443 case STATUS_CMD_UNKNOWN:
444 /* we can't issue REQUEST SENSE */
445 if (xs->xs_periph->periph_quirks & PQUIRK_NOSENSE) {
446 /*
447 * If no residue and no other USB error,
448 * command succeeded.
449 */
450 if (residue == 0) {
451 xs->error = XS_NOERROR;
452 break;
453 }
454
455 /*
456 * Some devices return a short INQUIRY
457 * response, omitting response data from the
458 * "vendor specific data" on...
459 */
460 if (xs->cmd->opcode == INQUIRY &&
461 residue < xs->datalen) {
462 xs->error = XS_NOERROR;
463 break;
464 }
465
466 xs->error = XS_DRIVER_STUFFUP;
467 break;
468 }
469 /* FALLTHROUGH */
470 case STATUS_CMD_FAILED:
471 /* fetch sense data */
472 sc->sc_sense = 1;
473 memset(&scbus->sc_sense_cmd, 0, sizeof(scbus->sc_sense_cmd));
474 scbus->sc_sense_cmd.opcode = REQUEST_SENSE;
475 scbus->sc_sense_cmd.byte2 = periph->periph_lun <<
476 SCSI_CMD_LUN_SHIFT;
477 scbus->sc_sense_cmd.length = sizeof(xs->sense);
478
479 cmdlen = sizeof(scbus->sc_sense_cmd);
480 if (sc->sc_cmd == UMASS_CPROTO_UFI) /* XXX */
481 cmdlen = UFI_COMMAND_LENGTH;
482 sc->sc_methods->wire_xfer(sc, periph->periph_lun,
483 &scbus->sc_sense_cmd, cmdlen,
484 &xs->sense, sizeof(xs->sense),
485 DIR_IN, xs->timeout,
486 umass_scsipi_sense_cb, xs);
487 return;
488
489 case STATUS_WIRE_FAILED:
490 xs->error = XS_RESET;
491 break;
492
493 default:
494 panic("%s: Unknown status %d in umass_scsipi_cb",
495 USBDEVNAME(sc->sc_dev), status);
496 }
497
498 DPRINTF(UDMASS_CMD,("umass_scsipi_cb: at %lu.%06lu: return xs->error="
499 "%d, xs->xs_status=0x%x xs->resid=%d\n",
500 tv.tv_sec, tv.tv_usec,
501 xs->error, xs->xs_status, xs->resid));
502
503 s = splbio();
504 scsipi_done(xs);
505 splx(s);
506 }
507
508 /*
509 * Finalise a completed autosense operation
510 */
511 Static void
512 umass_scsipi_sense_cb(struct umass_softc *sc, void *priv, int residue,
513 int status)
514 {
515 struct scsipi_xfer *xs = priv;
516 int s;
517
518 DPRINTF(UDMASS_CMD,("umass_scsipi_sense_cb: xs=%p residue=%d "
519 "status=%d\n", xs, residue, status));
520
521 sc->sc_sense = 0;
522 switch (status) {
523 case STATUS_CMD_OK:
524 case STATUS_CMD_UNKNOWN:
525 /* getting sense data succeeded */
526 if (residue == 0 || residue == 14)/* XXX */
527 xs->error = XS_SENSE;
528 else
529 xs->error = XS_SHORTSENSE;
530 break;
531 default:
532 DPRINTF(UDMASS_SCSI, ("%s: Autosense failed, status %d\n",
533 USBDEVNAME(sc->sc_dev), status));
534 xs->error = XS_DRIVER_STUFFUP;
535 break;
536 }
537
538 xs->xs_status |= XS_STS_DONE;
539
540 DPRINTF(UDMASS_CMD,("umass_scsipi_sense_cb: return xs->error=%d, "
541 "xs->xs_status=0x%x xs->resid=%d\n", xs->error, xs->xs_status,
542 xs->resid));
543
544 s = splbio();
545 scsipi_done(xs);
546 splx(s);
547 }
548
549 #if NATAPIBUS > 0
550 Static void
551 umass_atapi_probe_device(struct atapibus_softc *atapi, int target)
552 {
553 struct scsipi_channel *chan = atapi->sc_channel;
554 struct scsipi_periph *periph;
555 struct scsipibus_attach_args sa;
556 char vendor[33], product[65], revision[17];
557 struct scsipi_inquiry_data inqbuf;
558
559 DPRINTF(UDMASS_SCSI,("umass_atapi_probe_device: atapi=%p target=%d\n",
560 atapi, target));
561
562 if (target != UMASS_ATAPI_DRIVE) /* only probe drive 0 */
563 return;
564
565 /* skip if already attached */
566 if (scsipi_lookup_periph(chan, target, 0) != NULL)
567 return;
568
569 periph = scsipi_alloc_periph(M_NOWAIT);
570 if (periph == NULL) {
571 printf("%s: can't allocate link for drive %d\n",
572 atapi->sc_dev.dv_xname, target);
573 return;
574 }
575
576 DIF(UDMASS_UPPER, periph->periph_dbflags |= 1); /* XXX 1 */
577 periph->periph_channel = chan;
578 periph->periph_switch = &atapi_probe_periphsw;
579 periph->periph_target = target;
580 periph->periph_quirks = chan->chan_defquirks;
581
582 DPRINTF(UDMASS_SCSI, ("umass_atapi_probe_device: doing inquiry\n"));
583 /* Now go ask the device all about itself. */
584 memset(&inqbuf, 0, sizeof(inqbuf));
585 if (scsipi_inquire(periph, &inqbuf,
586 XS_CTL_DISCOVERY | XS_CTL_DATA_ONSTACK) != 0) {
587 DPRINTF(UDMASS_SCSI, ("umass_atapi_probe_device: "
588 "scsipi_inquire failed\n"));
589 free(periph, M_DEVBUF);
590 return;
591 }
592
593 scsipi_strvis(vendor, 33, inqbuf.vendor, 8);
594 scsipi_strvis(product, 65, inqbuf.product, 16);
595 scsipi_strvis(revision, 17, inqbuf.revision, 4);
596
597 sa.sa_periph = periph;
598 sa.sa_inqbuf.type = inqbuf.device;
599 sa.sa_inqbuf.removable = inqbuf.dev_qual2 & SID_REMOVABLE ?
600 T_REMOV : T_FIXED;
601 if (sa.sa_inqbuf.removable)
602 periph->periph_flags |= PERIPH_REMOVABLE;
603 sa.sa_inqbuf.vendor = vendor;
604 sa.sa_inqbuf.product = product;
605 sa.sa_inqbuf.revision = revision;
606 sa.sa_inqptr = NULL;
607
608 DPRINTF(UDMASS_SCSI, ("umass_atapi_probedev: doing atapi_probedev on "
609 "'%s' '%s' '%s'\n", vendor, product, revision));
610 atapi_probe_device(atapi, target, periph, &sa);
611 /* atapi_probe_device() frees the periph when there is no device.*/
612 }
613 #endif
614