Lines Matching +full:non +full:- +full:removable
1 // SPDX-License-Identifier: GPL-2.0-only
5 * - get rid of some verify_areas and use __copy*user and __get/put_user
35 * ioctl_probe -- return host identification
39 * Return an identifying string at @buffer, if @buffer is non-NULL, filling
49 return -EFAULT; in ioctl_probe()
51 if (host->hostt->info) in ioctl_probe()
52 string = host->hostt->info(host); in ioctl_probe()
54 string = host->hostt->name; in ioctl_probe()
60 return -EFAULT; in ioctl_probe()
109 sdev->lockable = 0; in ioctl_internal_command()
118 if (sdev->removable) in ioctl_internal_command()
122 if (sdev->removable) { in ioctl_internal_command()
123 sdev->changed = 1; in ioctl_internal_command()
127 fallthrough; /* for non-removable media */ in ioctl_internal_command()
147 if (!sdev->removable || !sdev->lockable) in scsi_set_medium_removal()
160 sdev->locked = (state == SCSI_REMOVAL_PREVENT); in scsi_set_medium_removal()
169 * -ENXIO if there isn't a PCI device pointer
177 struct device *dev = scsi_get_device(sdev->host); in scsi_ioctl_get_pci()
181 return -ENXIO; in scsi_ioctl_get_pci()
188 ? -EFAULT: 0; in scsi_ioctl_get_pci()
207 "ioctl, please convert it to SG_IO\n", current->comm); in scsi_ioctl_common()
216 .dev_id = (sdev->id & 0xff) in scsi_ioctl_common()
217 + ((sdev->lun & 0xff) << 8) in scsi_ioctl_common()
218 + ((sdev->channel & 0xff) << 16) in scsi_ioctl_common()
219 + ((sdev->host->host_no & 0xff) << 24), in scsi_ioctl_common()
220 .host_unique_id = sdev->host->unique_id in scsi_ioctl_common()
223 return -EFAULT; in scsi_ioctl_common()
227 return put_user(sdev->host->host_no, (int __user *)arg); in scsi_ioctl_common()
229 return ioctl_probe(sdev->host, arg); in scsi_ioctl_common()
232 return -EACCES; in scsi_ioctl_common()
233 return sg_scsi_ioctl(sdev->request_queue, NULL, 0, arg); in scsi_ioctl_common()
260 return -ENOIOCTLCMD; in scsi_ioctl_common()
264 * scsi_ioctl - Dispatch ioctl to scsi device
277 if (ret != -ENOIOCTLCMD) in scsi_ioctl()
280 if (sdev->host->hostt->ioctl) in scsi_ioctl()
281 return sdev->host->hostt->ioctl(sdev, cmd, arg); in scsi_ioctl()
283 return -EINVAL; in scsi_ioctl()
292 if (ret != -ENOIOCTLCMD) in scsi_compat_ioctl()
295 if (sdev->host->hostt->compat_ioctl) in scsi_compat_ioctl()
296 return sdev->host->hostt->compat_ioctl(sdev, cmd, arg); in scsi_compat_ioctl()
310 if (scsi_host_in_recovery(sdev->host)) in scsi_ioctl_block_when_processing_errors()
311 return -EAGAIN; in scsi_ioctl_block_when_processing_errors()
314 return -ENODEV; in scsi_ioctl_block_when_processing_errors()