summaryrefslogtreecommitdiff
path: root/usr/src/cmd/cdrw
diff options
context:
space:
mode:
authorminht <none@none>2006-01-22 10:31:02 -0800
committerminht <none@none>2006-01-22 10:31:02 -0800
commit5d465cc7e534b484f3541356dd9bea93a2b38507 (patch)
tree510b7a12693e484f02020bf4fb229ac924ead07d /usr/src/cmd/cdrw
parent884be64dd8e3b9a5e39540ec90da0a94008f4eb1 (diff)
downloadillumos-joyent-5d465cc7e534b484f3541356dd9bea93a2b38507.tar.gz
6346283 cdrw -i command fails to write to DVD-RW media on Panasonic DVD drives
6372024 cdrw -c command fails to write to DVD-RW media on Panasonic DVD drives
Diffstat (limited to 'usr/src/cmd/cdrw')
-rw-r--r--usr/src/cmd/cdrw/misc_scsi.c36
-rw-r--r--usr/src/cmd/cdrw/transport.c8
2 files changed, 25 insertions, 19 deletions
diff --git a/usr/src/cmd/cdrw/misc_scsi.c b/usr/src/cmd/cdrw/misc_scsi.c
index 75069a634c..cab78db4d2 100644
--- a/usr/src/cmd/cdrw/misc_scsi.c
+++ b/usr/src/cmd/cdrw/misc_scsi.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -450,21 +450,19 @@ finalize(cd_device *dev)
if (!close_track(dev->d_fd, 0, 1, immediate)) {
/*
- * For DVD-RW close track is not well defined
- * some drives dont like it, others want us
- * to close track before closing the session.
- * NOTE that for MMC specification it is not mandatory
- * to support close track.
+ * For DAO mode which we use for DVD-RW, the latest MMC
+ * specification does not mention close_track. Some
+ * newer drives will return an ILLEGAL INSTRUCTION
+ * which we will ignore. We have also found a Panasonic
+ * drive which will return a MEDIA ERROR. It is safe
+ * to ignore both errors as this is not needed for
+ * these drives.
+ * This is kept for older drives which had needed
+ * us to issue close_track to flush the cache fully.
+ * once we are certain these drives have cleared the
+ * market, this can be removed.
*/
if (device_type == DVD_MINUS) {
- if (!close_track(dev->d_fd, 1, 0, immediate)) {
- return (0);
- } else {
- /* command is already done */
- if (!immediate)
- return (1);
- }
- } else {
return (0);
}
} else {
@@ -955,9 +953,13 @@ write_fini(void)
ASC(rqbuf), ASCQ(rqbuf));
}
- if ((device_type == DVD_MINUS) &&
- (SENSE_KEY(rqbuf) == 5)) {
-
+ /*
+ * Different vendor drives return different
+ * sense error info for CLOSE SESSION command.
+ * The Panasonic drive that we are using is
+ * one such drive.
+ */
+ if (device_type == DVD_MINUS) {
if (verbose) {
(void) printf(
"skipping finalizing\n");
diff --git a/usr/src/cmd/cdrw/transport.c b/usr/src/cmd/cdrw/transport.c
index 56366c34be..48d2466a02 100644
--- a/usr/src/cmd/cdrw/transport.c
+++ b/usr/src/cmd/cdrw/transport.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -171,7 +171,11 @@ uscsi(int fd, struct uscsi_cmd *scmd)
if ((SENSE_KEY(rqbuf) == 2) && (ASC(rqbuf) == 4) &&
(ASCQ(rqbuf) == 8)) {
total_retries++;
- ms_delay(500);
+ if ((device_type != CD_RW) &&
+ (scmd->uscsi_cdb[0] == CLOSE_TRACK_CMD))
+ (void) sleep(3);
+ else
+ ms_delay(500);
continue;
}
/*