Module Name:    src
Committed By:   christos
Date:           Fri Apr  6 22:50:40 UTC 2012

Modified Files:
        src/sys/dev/scsipi: scsiconf.c scsipiconf.h sd.c

Log Message:
Add a quirk for the Apple iPod whose mode sense commands fails with not ready.
Seems to work just fine if we send a start command first...


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/dev/scsipi/scsiconf.c
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/scsipi/scsipiconf.h
cvs rdiff -u -r1.296 -r1.297 src/sys/dev/scsipi/sd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/scsiconf.c
diff -u src/sys/dev/scsipi/scsiconf.c:1.264 src/sys/dev/scsipi/scsiconf.c:1.265
--- src/sys/dev/scsipi/scsiconf.c:1.264	Sun Mar 11 22:44:16 2012
+++ src/sys/dev/scsipi/scsiconf.c	Fri Apr  6 18:50:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsiconf.c,v 1.264 2012/03/12 02:44:16 mrg Exp $	*/
+/*	$NetBSD: scsiconf.c,v 1.265 2012/04/06 22:50:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.264 2012/03/12 02:44:16 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.265 2012/04/06 22:50:39 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -445,6 +445,8 @@ scsibusprint(void *aux, const char *pnp)
 }
 
 static const struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = {
+	{{T_DIRECT, T_REMOV,
+	 "Apple   ", "iPod            ", ""},	  PQUIRK_START},
 	{{T_CDROM, T_REMOV,
 	 "CHINON  ", "CD-ROM CDS-431  ", ""},     PQUIRK_NOLUNS},
 	{{T_CDROM, T_REMOV,

Index: src/sys/dev/scsipi/scsipiconf.h
diff -u src/sys/dev/scsipi/scsipiconf.h:1.118 src/sys/dev/scsipi/scsipiconf.h:1.119
--- src/sys/dev/scsipi/scsipiconf.h:1.118	Sun Jun  6 21:41:39 2010
+++ src/sys/dev/scsipi/scsipiconf.h	Fri Apr  6 18:50:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipiconf.h,v 1.118 2010/06/07 01:41:39 pgoyette Exp $	*/
+/*	$NetBSD: scsipiconf.h,v 1.119 2012/04/06 22:50:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -452,6 +452,7 @@ struct scsipi_periph {
 #define PQUIRK_CAP_SYNC		0x00080000	/* SCSI device with ST sync op*/
 #define PQUIRK_CAP_WIDE16	0x00100000	/* SCSI device with ST wide op*/
 #define PQUIRK_CAP_NODT		0x00200000	/* signals DT, but can't. */
+#define PQUIRK_START		0x00400000	/* needs start before tur */
 
 
 /*

Index: src/sys/dev/scsipi/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.296 src/sys/dev/scsipi/sd.c:1.297
--- src/sys/dev/scsipi/sd.c:1.296	Thu Feb  2 14:43:06 2012
+++ src/sys/dev/scsipi/sd.c	Fri Apr  6 18:50:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.296 2012/02/02 19:43:06 tls Exp $	*/
+/*	$NetBSD: sd.c,v 1.297 2012/04/06 22:50:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.296 2012/02/02 19:43:06 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.297 2012/04/06 22:50:39 christos Exp $");
 
 #include "opt_scsi.h"
 
@@ -264,6 +264,9 @@ sdattach(device_t parent, device_t self,
 	aprint_naive("\n");
 	aprint_normal("\n");
 
+	if (periph->periph_quirks & PQUIRK_START)
+		(void)scsipi_start(periph, SSS_START, XS_CTL_SILENT);
+
 	error = scsipi_test_unit_ready(periph,
 	    XS_CTL_DISCOVERY | XS_CTL_IGNORE_ILLEGAL_REQUEST |
 	    XS_CTL_IGNORE_MEDIA_CHANGE | XS_CTL_SILENT_NODEV);

Reply via email to