aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_ioctl.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@SteelEye.com>2007-12-02 12:10:40 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:50 -0500
commit001aac257cf8adbe90cdcba6e07f8d12dfc8fa6b (patch)
tree0eb6294049245e05f47fdb76e3f878c78c015d88 /drivers/scsi/scsi_ioctl.c
parent4a03d90e35bc5273d27301fa669d4b2103196f94 (diff)
[SCSI] sd,sr: add early detection of medium not present
The current scsi_test_unit_ready() is updated to return sense code information (in struct scsi_sense_hdr). The sd and sr drivers are changed to interpret the sense code return asc 0x3a as no media and adjust the device status accordingly. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_ioctl.c')
-rw-r--r--drivers/scsi/scsi_ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 83e144716901..28b19ef26309 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -244,7 +244,7 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
244 return scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW); 244 return scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW);
245 case SCSI_IOCTL_TEST_UNIT_READY: 245 case SCSI_IOCTL_TEST_UNIT_READY:
246 return scsi_test_unit_ready(sdev, IOCTL_NORMAL_TIMEOUT, 246 return scsi_test_unit_ready(sdev, IOCTL_NORMAL_TIMEOUT,
247 NORMAL_RETRIES); 247 NORMAL_RETRIES, NULL);
248 case SCSI_IOCTL_START_UNIT: 248 case SCSI_IOCTL_START_UNIT:
249 scsi_cmd[0] = START_STOP; 249 scsi_cmd[0] = START_STOP;
250 scsi_cmd[1] = 0; 250 scsi_cmd[1] = 0;