Reintroduce the NODOORLOCK quirk. Helps with PR kern/23875.

This commit is contained in:
mlelstv 2008-05-11 05:17:23 +00:00
parent a4002c76a9
commit 42e9b7252f
2 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsipi_base.c,v 1.147 2008/04/28 20:23:57 martin Exp $ */ /* $NetBSD: scsipi_base.c,v 1.148 2008/05/11 05:17:23 mlelstv Exp $ */
/*- /*-
* Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.147 2008/04/28 20:23:57 martin Exp $"); __KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.148 2008/05/11 05:17:23 mlelstv Exp $");
#include "opt_scsi.h" #include "opt_scsi.h"
@ -1150,6 +1150,9 @@ scsipi_prevent(struct scsipi_periph *periph, int type, int flags)
{ {
struct scsi_prevent_allow_medium_removal cmd; struct scsi_prevent_allow_medium_removal cmd;
if (periph->periph_quirks & PQUIRK_NODOORLOCK)
return 0;
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.opcode = SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL; cmd.opcode = SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL;
cmd.how = type; cmd.how = type;

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsipiconf.h,v 1.111 2008/04/28 20:23:58 martin Exp $ */ /* $NetBSD: scsipiconf.h,v 1.112 2008/05/11 05:17:23 mlelstv Exp $ */
/*- /*-
* Copyright (c) 1998, 1999, 2000, 2004 The NetBSD Foundation, Inc. * Copyright (c) 1998, 1999, 2000, 2004 The NetBSD Foundation, Inc.
@ -440,6 +440,7 @@ struct scsipi_periph {
#define PQUIRK_LITTLETOC 0x00000400 /* audio TOC is little-endian */ #define PQUIRK_LITTLETOC 0x00000400 /* audio TOC is little-endian */
#define PQUIRK_NOCAPACITY 0x00000800 /* no READ CD CAPACITY */ #define PQUIRK_NOCAPACITY 0x00000800 /* no READ CD CAPACITY */
#define PQUIRK_NOTUR 0x00001000 /* no TEST UNIT READY */ #define PQUIRK_NOTUR 0x00001000 /* no TEST UNIT READY */
#define PQUIRK_NODOORLOCK 0x00002000 /* can't lock door */
#define PQUIRK_NOSENSE 0x00004000 /* can't REQUEST SENSE */ #define PQUIRK_NOSENSE 0x00004000 /* can't REQUEST SENSE */
#define PQUIRK_ONLYBIG 0x00008000 /* only use SCSI_{R,W}_BIG */ #define PQUIRK_ONLYBIG 0x00008000 /* only use SCSI_{R,W}_BIG */
#define PQUIRK_NOBIGMODESENSE 0x00040000 /* has no big mode-sense op */ #define PQUIRK_NOBIGMODESENSE 0x00040000 /* has no big mode-sense op */