summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorrameshc <none@none>2007-05-14 12:28:40 -0700
committerrameshc <none@none>2007-05-14 12:28:40 -0700
commitaec541b55790a680ba9c49d6f6a9aa9892a2e6d1 (patch)
tree71bf8d4c664f2320fb4dca1f5b830b6496125ac1 /usr/src
parent7b69f7103054d99ef88f8d75d5ffded0dd6fb7bc (diff)
downloadillumos-gate-aec541b55790a680ba9c49d6f6a9aa9892a2e6d1.tar.gz
6507472 DVD drive(TS-H492C) in Blade 1500 return illegal sense code against request sense
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/io/scsi/targets/sd.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/usr/src/uts/common/io/scsi/targets/sd.c b/usr/src/uts/common/io/scsi/targets/sd.c
index d9b1a6c2ab..85c94c5a79 100644
--- a/usr/src/uts/common/io/scsi/targets/sd.c
+++ b/usr/src/uts/common/io/scsi/targets/sd.c
@@ -20679,7 +20679,7 @@ sd_media_watch_cb(caddr_t arg, struct scsi_watch_result *resultp)
if (asc == 0x28) {
state = DKIO_INSERTED;
}
- } else {
+ } else if (skey == KEY_NOT_READY) {
/*
* if 02/04/02 means that the host
* should send start command. Explicitly
@@ -20691,23 +20691,31 @@ sd_media_watch_cb(caddr_t arg, struct scsi_watch_result *resultp)
* device to the right state good for
* media access.
*/
- if ((skey == KEY_NOT_READY) &&
- (asc == 0x3a)) {
+ if (asc == 0x3a) {
state = DKIO_EJECTED;
- }
-
- /*
- * If the drivge is busy with an operation
- * or long write, keep the media in an
- * inserted state.
- */
+ } else {
+ /*
+ * If the drive is busy with an
+ * operation or long write, keep the
+ * media in an inserted state.
+ */
- if ((skey == KEY_NOT_READY) &&
- (asc == 0x04) &&
- ((ascq == 0x02) ||
- (ascq == 0x07) ||
- (ascq == 0x08))) {
- state = DKIO_INSERTED;
+ if ((asc == 0x04) &&
+ ((ascq == 0x02) ||
+ (ascq == 0x07) ||
+ (ascq == 0x08))) {
+ state = DKIO_INSERTED;
+ }
+ }
+ } else if (skey == KEY_NO_SENSE) {
+ if ((asc == 0x00) && (ascq == 0x00)) {
+ /*
+ * Sense Data 00/00/00 does not provide
+ * any information about the state of
+ * the media. Ignore it.
+ */
+ mutex_exit(SD_MUTEX(un));
+ return (0);
}
}
}