diff options
author | James Bottomley <jejb@titanic.(none)> | 2005-08-28 12:33:52 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-08-28 12:33:52 -0400 |
commit | ea73a9f23906c374b697cd5b0d64f6dceced63de (patch) | |
tree | c000be3180caccc6d484aad0f82f58d733358622 /drivers/scsi/scsi_ioctl.c | |
parent | 33aa687db90dd8541bd5e9a762eebf880eaee767 (diff) |
[SCSI] convert sd to scsi_execute_req (and update the scsi_execute_req API)
This one removes struct scsi_request entirely from sd. In the process,
I noticed we have no callers of scsi_wait_req who don't immediately
normalise the sense, so I updated the API to make it take a struct
scsi_sense_hdr instead of simply a big sense buffer.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_ioctl.c')
-rw-r--r-- | drivers/scsi/scsi_ioctl.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 5f399c9c68ee..179a767d221d 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c | |||
@@ -90,19 +90,16 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, | |||
90 | { | 90 | { |
91 | int result; | 91 | int result; |
92 | struct scsi_sense_hdr sshdr; | 92 | struct scsi_sense_hdr sshdr; |
93 | char sense[SCSI_SENSE_BUFFERSIZE]; | ||
94 | 93 | ||
95 | SCSI_LOG_IOCTL(1, printk("Trying ioctl with scsi command %d\n", *cmd)); | 94 | SCSI_LOG_IOCTL(1, printk("Trying ioctl with scsi command %d\n", *cmd)); |
96 | 95 | ||
97 | |||
98 | memset(sense, 0, sizeof(*sense)); | ||
99 | result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, | 96 | result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, |
100 | sense, timeout, retries); | 97 | &sshdr, timeout, retries); |
101 | 98 | ||
102 | SCSI_LOG_IOCTL(2, printk("Ioctl returned 0x%x\n", result)); | 99 | SCSI_LOG_IOCTL(2, printk("Ioctl returned 0x%x\n", result)); |
103 | 100 | ||
104 | if ((driver_byte(result) & DRIVER_SENSE) && | 101 | if ((driver_byte(result) & DRIVER_SENSE) && |
105 | (scsi_normalize_sense(sense, sizeof(*sense), &sshdr))) { | 102 | (scsi_sense_valid(&sshdr))) { |
106 | switch (sshdr.sense_key) { | 103 | switch (sshdr.sense_key) { |
107 | case ILLEGAL_REQUEST: | 104 | case ILLEGAL_REQUEST: |
108 | if (cmd[0] == ALLOW_MEDIUM_REMOVAL) | 105 | if (cmd[0] == ALLOW_MEDIUM_REMOVAL) |
@@ -132,7 +129,7 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, | |||
132 | sdev->id, | 129 | sdev->id, |
133 | sdev->lun, | 130 | sdev->lun, |
134 | result); | 131 | result); |
135 | __scsi_print_sense(" ", sense, sizeof(*sense)); | 132 | scsi_print_sense_hdr(" ", &sshdr); |
136 | break; | 133 | break; |
137 | } | 134 | } |
138 | } | 135 | } |
@@ -315,9 +312,9 @@ int scsi_ioctl_send_command(struct scsi_device *sdev, | |||
315 | break; | 312 | break; |
316 | } | 313 | } |
317 | 314 | ||
318 | result = scsi_execute_req(sdev, cmd, data_direction, buf, needed, | 315 | result = scsi_execute(sdev, cmd, data_direction, buf, needed, |
319 | sense, timeout, retries); | 316 | sense, timeout, retries, 0); |
320 | 317 | ||
321 | /* | 318 | /* |
322 | * If there was an error condition, pass the info back to the user. | 319 | * If there was an error condition, pass the info back to the user. |
323 | */ | 320 | */ |