aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/constants.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic.(none)>2005-08-28 12:33:52 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-08-28 12:33:52 -0400
commitea73a9f23906c374b697cd5b0d64f6dceced63de (patch)
treec000be3180caccc6d484aad0f82f58d733358622 /drivers/scsi/constants.c
parent33aa687db90dd8541bd5e9a762eebf880eaee767 (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/constants.c')
-rw-r--r--drivers/scsi/constants.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 0d58d3538bd..f6be2c1c394 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -1156,6 +1156,31 @@ scsi_show_extd_sense(unsigned char asc, unsigned char ascq)
1156 } 1156 }
1157} 1157}
1158 1158
1159void
1160scsi_print_sense_hdr(const char *name, struct scsi_sense_hdr *sshdr)
1161{
1162 const char *sense_txt;
1163 /* An example of deferred is when an earlier write to disk cache
1164 * succeeded, but now the disk discovers that it cannot write the
1165 * data to the magnetic media.
1166 */
1167 const char *error = scsi_sense_is_deferred(sshdr) ?
1168 "<<DEFERRED>>" : "Current";
1169 printk(KERN_INFO "%s: %s", name, error);
1170 if (sshdr->response_code >= 0x72)
1171 printk(" [descriptor]");
1172
1173 sense_txt = scsi_sense_key_string(sshdr->sense_key);
1174 if (sense_txt)
1175 printk(": sense key: %s\n", sense_txt);
1176 else
1177 printk(": sense key=0x%x\n", sshdr->sense_key);
1178 printk(KERN_INFO " ");
1179 scsi_show_extd_sense(sshdr->asc, sshdr->ascq);
1180 printk("\n");
1181}
1182EXPORT_SYMBOL(scsi_print_sense_hdr);
1183
1159/* Print sense information */ 1184/* Print sense information */
1160void 1185void
1161__scsi_print_sense(const char *name, const unsigned char *sense_buffer, 1186__scsi_print_sense(const char *name, const unsigned char *sense_buffer,
@@ -1163,8 +1188,6 @@ __scsi_print_sense(const char *name, const unsigned char *sense_buffer,
1163{ 1188{
1164 int k, num, res; 1189 int k, num, res;
1165 unsigned int info; 1190 unsigned int info;
1166 const char *error;
1167 const char *sense_txt;
1168 struct scsi_sense_hdr ssh; 1191 struct scsi_sense_hdr ssh;
1169 1192
1170 res = scsi_normalize_sense(sense_buffer, sense_len, &ssh); 1193 res = scsi_normalize_sense(sense_buffer, sense_len, &ssh);
@@ -1182,26 +1205,7 @@ __scsi_print_sense(const char *name, const unsigned char *sense_buffer,
1182 printk("\n"); 1205 printk("\n");
1183 return; 1206 return;
1184 } 1207 }
1185 1208 scsi_print_sense_hdr(name, &ssh);
1186 /* An example of deferred is when an earlier write to disk cache
1187 * succeeded, but now the disk discovers that it cannot write the
1188 * data to the magnetic media.
1189 */
1190 error = scsi_sense_is_deferred(&ssh) ?
1191 "<<DEFERRED>>" : "Current";
1192 printk(KERN_INFO "%s: %s", name, error);
1193 if (ssh.response_code >= 0x72)
1194 printk(" [descriptor]");
1195
1196 sense_txt = scsi_sense_key_string(ssh.sense_key);
1197 if (sense_txt)
1198 printk(": sense key: %s\n", sense_txt);
1199 else
1200 printk(": sense key=0x%x\n", ssh.sense_key);
1201 printk(KERN_INFO " ");
1202 scsi_show_extd_sense(ssh.asc, ssh.ascq);
1203 printk("\n");
1204
1205 if (ssh.response_code < 0x72) { 1209 if (ssh.response_code < 0x72) {
1206 /* only decode extras for "fixed" format now */ 1210 /* only decode extras for "fixed" format now */
1207 char buff[80]; 1211 char buff[80];