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.
This commit is contained in:
reinoud 2006-02-04 21:26:15 +00:00
parent 708fa89a18
commit c0dbf19c1e
2 changed files with 8 additions and 4 deletions

View File

@ -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 @@ mmc_process_feature(struct mmc_discinfo *mmc_discinfo,
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;

View File

@ -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 @@ struct mmc_discinfo {
#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