diff options
Diffstat (limited to 'drivers/scsi/scsi_ioctl.c')
-rw-r--r-- | drivers/scsi/scsi_ioctl.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 32293f451669..28b19ef26309 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c | |||
@@ -174,10 +174,15 @@ static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg) | |||
174 | } | 174 | } |
175 | 175 | ||
176 | 176 | ||
177 | /* | 177 | /** |
178 | * the scsi_ioctl() function differs from most ioctls in that it does | 178 | * scsi_ioctl - Dispatch ioctl to scsi device |
179 | * not take a major/minor number as the dev field. Rather, it takes | 179 | * @sdev: scsi device receiving ioctl |
180 | * a pointer to a scsi_devices[] element, a structure. | 180 | * @cmd: which ioctl is it |
181 | * @arg: data associated with ioctl | ||
182 | * | ||
183 | * Description: The scsi_ioctl() function differs from most ioctls in that it | ||
184 | * does not take a major/minor number as the dev field. Rather, it takes | ||
185 | * a pointer to a &struct scsi_device. | ||
181 | */ | 186 | */ |
182 | int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | 187 | int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) |
183 | { | 188 | { |
@@ -239,7 +244,7 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | |||
239 | return scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW); | 244 | return scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW); |
240 | case SCSI_IOCTL_TEST_UNIT_READY: | 245 | case SCSI_IOCTL_TEST_UNIT_READY: |
241 | return scsi_test_unit_ready(sdev, IOCTL_NORMAL_TIMEOUT, | 246 | return scsi_test_unit_ready(sdev, IOCTL_NORMAL_TIMEOUT, |
242 | NORMAL_RETRIES); | 247 | NORMAL_RETRIES, NULL); |
243 | case SCSI_IOCTL_START_UNIT: | 248 | case SCSI_IOCTL_START_UNIT: |
244 | scsi_cmd[0] = START_STOP; | 249 | scsi_cmd[0] = START_STOP; |
245 | scsi_cmd[1] = 0; | 250 | scsi_cmd[1] = 0; |
@@ -264,9 +269,12 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | |||
264 | } | 269 | } |
265 | EXPORT_SYMBOL(scsi_ioctl); | 270 | EXPORT_SYMBOL(scsi_ioctl); |
266 | 271 | ||
267 | /* | 272 | /** |
268 | * the scsi_nonblock_ioctl() function is designed for ioctls which may | 273 | * scsi_nonblock_ioctl() - Handle SG_SCSI_RESET |
269 | * be executed even if the device is in recovery. | 274 | * @sdev: scsi device receiving ioctl |
275 | * @cmd: Must be SC_SCSI_RESET | ||
276 | * @arg: pointer to int containing SG_SCSI_RESET_{DEVICE,BUS,HOST} | ||
277 | * @filp: either NULL or a &struct file which must have the O_NONBLOCK flag. | ||
270 | */ | 278 | */ |
271 | int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, | 279 | int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, |
272 | void __user *arg, struct file *filp) | 280 | void __user *arg, struct file *filp) |
@@ -276,7 +284,7 @@ int scsi_nonblockable_ioctl(struct scsi_device *sdev, int cmd, | |||
276 | /* The first set of iocts may be executed even if we're doing | 284 | /* The first set of iocts may be executed even if we're doing |
277 | * error processing, as long as the device was opened | 285 | * error processing, as long as the device was opened |
278 | * non-blocking */ | 286 | * non-blocking */ |
279 | if (filp && filp->f_flags & O_NONBLOCK) { | 287 | if (filp && (filp->f_flags & O_NONBLOCK)) { |
280 | if (scsi_host_in_recovery(sdev->host)) | 288 | if (scsi_host_in_recovery(sdev->host)) |
281 | return -ENODEV; | 289 | return -ENODEV; |
282 | } else if (!scsi_block_when_processing_errors(sdev)) | 290 | } else if (!scsi_block_when_processing_errors(sdev)) |