diff options
author | Niels Provos <provos@cvs.openbsd.org> | 1997-06-06 23:43:08 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 1997-06-06 23:43:08 +0000 |
commit | c4a883279839da670509484d948e7af46e555e67 (patch) | |
tree | b33ae26d64f4220cbd67597fd129d76f569f18c0 /sys/dev | |
parent | fbb5843c4cdd0d57e21121b1267fcf794cf1a4be (diff) |
not all atapi cdroms can lock the door. todo: autodetect
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/atapi/atapiconf.c | 17 | ||||
-rw-r--r-- | sys/dev/atapi/atapilink.h | 3 |
2 files changed, 13 insertions, 7 deletions
diff --git a/sys/dev/atapi/atapiconf.c b/sys/dev/atapi/atapiconf.c index efe377df068..b3049bbd685 100644 --- a/sys/dev/atapi/atapiconf.c +++ b/sys/dev/atapi/atapiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atapiconf.c,v 1.12 1996/11/23 21:46:29 kstailey Exp $ */ +/* $OpenBSD: atapiconf.c,v 1.13 1997/06/06 23:43:06 provos Exp $ */ /* * Copyright (c) 1996 Manuel Bouyer. All rights reserved. @@ -99,6 +99,8 @@ struct atapi_quirk_inquiry_pattern atapi_quirk_inquiry_patterns[] = { {ATAPI_DEVICE_TYPE_DAD, ATAPI_REMOVABLE, "NEC CD-ROM DRIVE:260", "3.04", AQUIRK_CDROM}, /* NEC Multispin 2Vi */ + {ATAPI_DEVICE_TYPE_CD, ATAPI_REMOVABLE, + "UJDCD8730", "1.14", AQUIRK_NODOORLOCK}, /* Acer Notelight 370 */ {0, 0, NULL, NULL, 0} /* The End */ }; @@ -568,12 +570,15 @@ atapi_prevent(ad_link, how) ATAPI_DEBUG_FCTN_PRINT(("atapi_prevent: ")); - bzero(&cmd, sizeof(cmd)); - cmd.opcode = ATAPI_PREVENT_ALLOW_MEDIUM_REMOVAL; - cmd.how = how & 0xff; - - ret = atapi_exec_cmd(ad_link, &cmd, sizeof(cmd), 0,0,0,0); + if (ad_link->quirks & AQUIRK_NODOORLOCK) + ret = 0; + else { + bzero(&cmd, sizeof(cmd)); + cmd.opcode = ATAPI_PREVENT_ALLOW_MEDIUM_REMOVAL; + cmd.how = how & 0xff; + ret = atapi_exec_cmd(ad_link, &cmd, sizeof(cmd), 0,0,0,0); + } ATAPI_DEBUG_FCTN_PRINT(("ret %d\n", ret)); return ret; diff --git a/sys/dev/atapi/atapilink.h b/sys/dev/atapi/atapilink.h index b3eb0d68b89..3ada476e06d 100644 --- a/sys/dev/atapi/atapilink.h +++ b/sys/dev/atapi/atapilink.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atapilink.h,v 1.8 1996/09/11 07:22:05 downsj Exp $ */ +/* $OpenBSD: atapilink.h,v 1.9 1997/06/06 23:43:07 provos Exp $ */ /* * Copyright (c) 1996 Manuel Bouyer. All rights reserved. @@ -153,6 +153,7 @@ struct at_dev_link { #define AQUIRK_CDROM 0x01 /* device is a CD-ROM */ #define AQUIRK_LITTLETOC 0x02 /* Audio TOC uses wrong byte order */ #define AQUIRK_NOCAPACITY 0x04 /* no READ_CD_CAPACITY command */ +#define AQUIRK_NODOORLOCK 0x08 /* can't lock the door */ void (*start) __P((void *)); /* device start routine */ int (*done) __P((void *)); /* device done routine */ }; |