|
37 | 37 | * @host: host to identify
|
38 | 38 | * @buffer: userspace buffer for identification
|
39 | 39 | *
|
40 |
| - * Return an identifying string at @buffer, if @buffer is non-NULL, filling |
41 |
| - * to the length stored at * (int *) @buffer. |
| 40 | + * Return: |
| 41 | + * * if successful, %1 and an identifying string at @buffer, if @buffer |
| 42 | + * is non-NULL, filling to the length stored at * (int *) @buffer. |
| 43 | + * * <0 error code on failure. |
42 | 44 | */
|
43 | 45 | static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)
|
44 | 46 | {
|
@@ -121,6 +123,16 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
|
121 | 123 | return result;
|
122 | 124 | }
|
123 | 125 |
|
| 126 | +/** |
| 127 | + * scsi_set_medium_removal() - send command to allow or prevent medium removal |
| 128 | + * @sdev: target scsi device |
| 129 | + * @state: removal state to set (prevent or allow) |
| 130 | + * |
| 131 | + * Returns: |
| 132 | + * * %0 if @sdev is not removable or not lockable or successful. |
| 133 | + * * non-%0 is a SCSI result code if > 0 or kernel error code if < 0. |
| 134 | + * * Sets @sdev->locked to the new state on success. |
| 135 | + */ |
124 | 136 | int scsi_set_medium_removal(struct scsi_device *sdev, char state)
|
125 | 137 | {
|
126 | 138 | char scsi_cmd[MAX_COMMAND_SIZE];
|
@@ -242,11 +254,15 @@ static int scsi_send_start_stop(struct scsi_device *sdev, int data)
|
242 | 254 | NORMAL_RETRIES);
|
243 | 255 | }
|
244 | 256 |
|
245 |
| -/* |
246 |
| - * Check if the given command is allowed. |
| 257 | +/** |
| 258 | + * scsi_cmd_allowed() - Check if the given command is allowed. |
| 259 | + * @cmd: SCSI command to check |
| 260 | + * @open_for_write: is the file / block device opened for writing? |
247 | 261 | *
|
248 | 262 | * Only a subset of commands are allowed for unprivileged users. Commands used
|
249 | 263 | * to format the media, update the firmware, etc. are not permitted.
|
| 264 | + * |
| 265 | + * Return: %true if the cmd is allowed, otherwise @false. |
250 | 266 | */
|
251 | 267 | bool scsi_cmd_allowed(unsigned char *cmd, bool open_for_write)
|
252 | 268 | {
|
@@ -859,6 +875,8 @@ static int scsi_ioctl_sg_io(struct scsi_device *sdev, bool open_for_write,
|
859 | 875 | * Description: The scsi_ioctl() function differs from most ioctls in that it
|
860 | 876 | * does not take a major/minor number as the dev field. Rather, it takes
|
861 | 877 | * a pointer to a &struct scsi_device.
|
| 878 | + * |
| 879 | + * Return: varies depending on the @cmd |
862 | 880 | */
|
863 | 881 | int scsi_ioctl(struct scsi_device *sdev, bool open_for_write, int cmd,
|
864 | 882 | void __user *arg)
|
@@ -941,8 +959,15 @@ int scsi_ioctl(struct scsi_device *sdev, bool open_for_write, int cmd,
|
941 | 959 | }
|
942 | 960 | EXPORT_SYMBOL(scsi_ioctl);
|
943 | 961 |
|
944 |
| -/* |
| 962 | +/** |
| 963 | + * scsi_ioctl_block_when_processing_errors - prevent commands from being queued |
| 964 | + * @sdev: target scsi device |
| 965 | + * @cmd: which ioctl is it |
| 966 | + * @ndelay: no delay (non-blocking) |
| 967 | + * |
945 | 968 | * We can process a reset even when a device isn't fully operable.
|
| 969 | + * |
| 970 | + * Return: %0 on success, <0 error code. |
946 | 971 | */
|
947 | 972 | int scsi_ioctl_block_when_processing_errors(struct scsi_device *sdev, int cmd,
|
948 | 973 | bool ndelay)
|
|
0 commit comments