Source-Changes-HG archive

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

[src/trunk]: src/sys Add support for SCSI MMC feature 0x0024: hardware assist...



details:   https://anonhg.NetBSD.org/src/rev/c9a593db471a
branches:  trunk
changeset: 587995:c9a593db471a
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Sat Feb 04 21:26:15 2006 +0000

description:
Add support for SCSI MMC feature 0x0024: hardware assisted defect
management to be passed in mmc_discinfo's device capabilities.

When a device reports support for this the hardware will automatically
remap sectors on read- or write-errors. CD-MRW, DVD+MRW, DVD-RAM and BR-RE
support these.

diffstat:

 sys/dev/scsipi/cd.c |  7 +++++--
 sys/sys/cdio.h      |  5 +++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (51 lines):

diff -r 4f035d6a2475 -r c9a593db471a sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c       Sat Feb 04 21:23:43 2006 +0000
+++ b/sys/dev/scsipi/cd.c       Sat Feb 04 21:26:15 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd.c,v 1.238 2006/02/02 14:48:02 reinoud Exp $ */
+/*     $NetBSD: cd.c,v 1.239 2006/02/04 21:26:15 reinoud Exp $ */
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.238 2006/02/02 14:48:02 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.239 2006/02/04 21:26:15 reinoud Exp $");
 
 #include "rnd.h"
 
@@ -2646,6 +2646,9 @@
                flags |= MMC_CAP_RECORDABLE;
                flags |= MMC_CAP_FORMATTABLE;
                break;
+       case 0x0024 :
+               flags |= MMC_CAP_HW_DEFECTFREE;
+               break;
        case 0x0025 :   /* write once */
                flags |= MMC_CAP_RECORDABLE;
                break;
diff -r 4f035d6a2475 -r c9a593db471a sys/sys/cdio.h
--- a/sys/sys/cdio.h    Sat Feb 04 21:23:43 2006 +0000
+++ b/sys/sys/cdio.h    Sat Feb 04 21:26:15 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdio.h,v 1.24 2006/02/02 14:48:02 reinoud Exp $        */
+/*     $NetBSD: cdio.h,v 1.25 2006/02/04 21:26:15 reinoud Exp $        */
 
 #ifndef _SYS_CDIO_H_
 #define _SYS_CDIO_H_
@@ -311,11 +311,12 @@
 #define MMC_CAP_STRICTOVERWRITE        (1 <<  8)  /* only writes a packet at a time */
 #define MMC_CAP_PSEUDOOVERWRITE (1 <<  9)  /* overwrite through replacement  */
 #define MMC_CAP_ZEROLINKBLK    (1 << 10)  /* zero link block length capable */
+#define MMC_CAP_HW_DEFECTFREE  (1 << 11)  /* hardware defect management     */
 
 #define MMC_CAP_FLAGBITS \
     "\10\1SEQUENTIAL\2RECORDABLE\3ERASABLE\4BLANKABLE\5FORMATTABLE" \
     "\6REWRITABLE\7MRW\10PACKET\11STRICTOVERWRITE\12PSEUDOOVERWRITE" \
-    "\13ZEROLINKBLK"
+    "\13ZEROLINKBLK\14HW_DEFECTFREE"
 
 #define MMC_STATE_EMPTY                0
 #define MMC_STATE_INCOMPLETE   1



Home | Main Index | Thread Index | Old Index