Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Add a quirk for the Apple iPod whose mode sen...



details:   https://anonhg.NetBSD.org/src/rev/bd266a7b588a
branches:  trunk
changeset: 778624:bd266a7b588a
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Apr 06 22:50:39 2012 +0000

description:
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...

diffstat:

 sys/dev/scsipi/scsiconf.c   |  6 ++++--
 sys/dev/scsipi/scsipiconf.h |  3 ++-
 sys/dev/scsipi/sd.c         |  7 +++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diffs (72 lines):

diff -r 818f77316bd8 -r bd266a7b588a sys/dev/scsipi/scsiconf.c
--- a/sys/dev/scsipi/scsiconf.c Fri Apr 06 22:46:15 2012 +0000
+++ b/sys/dev/scsipi/scsiconf.c Fri Apr 06 22:50:39 2012 +0000
@@ -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 @@
 }
 
 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,
diff -r 818f77316bd8 -r bd266a7b588a sys/dev/scsipi/scsipiconf.h
--- a/sys/dev/scsipi/scsipiconf.h       Fri Apr 06 22:46:15 2012 +0000
+++ b/sys/dev/scsipi/scsipiconf.h       Fri Apr 06 22:50:39 2012 +0000
@@ -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 @@
 #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 */
 
 
 /*
diff -r 818f77316bd8 -r bd266a7b588a sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c       Fri Apr 06 22:46:15 2012 +0000
+++ b/sys/dev/scsipi/sd.c       Fri Apr 06 22:50:39 2012 +0000
@@ -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 @@
        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);



Home | Main Index | Thread Index | Old Index