From: Mike Christie <michaelc@cs.wisc.edu>
To: linux-scsi@vger.kernel.org
Subject: [PATCH] export print_sense_internal
Date: Wed, 05 Jan 2005 11:39:01 -0800 [thread overview]
Message-ID: <41DC4255.7050109@cs.wisc.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
Currently, we have scsi_print_sense and
scsi_print_req_sense, but the linux-iscsi
driver receives async messages from
a target that may contain SCSI sense data
and these messages are not tied to any
specific command. So that we can use the
scsi-ml sense printing capabilities the
attached patch exports exports
print_sense_internal and renames it to
__scsi_print_sense.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Oh yeah we are working to gettting the driver
in mainline so there will be a user of the
the interface soon (I hope soon).
[-- Attachment #2: scsi-print.sense.patch --]
[-- Type: text/x-patch, Size: 2569 bytes --]
diff -aurp scsi-misc-2.6.orig/drivers/scsi/constants.c scsi-misc-2.6.sense/drivers/scsi/constants.c
--- scsi-misc-2.6.orig/drivers/scsi/constants.c 2005-01-05 03:14:48.000000000 -0800
+++ scsi-misc-2.6.sense/drivers/scsi/constants.c 2005-01-05 03:25:05.394602699 -0800
@@ -1156,17 +1156,14 @@ scsi_show_extd_sense(unsigned char asc,
}
/* Print sense information */
-static void
-print_sense_internal(const char *devclass,
- const unsigned char *sense_buffer,
- int sense_len,
- struct request *req)
+void
+__scsi_print_sense(const char *name, const unsigned char *sense_buffer,
+ int sense_len)
{
int k, num, res;
unsigned int info;
const char *error;
const char *sense_txt;
- const char *name = req->rq_disk ? req->rq_disk->disk_name : devclass;
struct scsi_sense_hdr ssh;
res = scsi_normalize_sense(sense_buffer, sense_len, &ssh);
@@ -1254,18 +1251,25 @@ print_sense_internal(const char *devclas
printk("\n");
}
}
+EXPORT_SYMBOL(__scsi_print_sense);
void scsi_print_sense(const char *devclass, struct scsi_cmnd *cmd)
{
- print_sense_internal(devclass, cmd->sense_buffer,
- SCSI_SENSE_BUFFERSIZE, cmd->request);
+ const char *name = devclass;
+
+ if (cmd->request->rq_disk)
+ name = cmd->request->rq_disk->disk_name;
+ __scsi_print_sense(name, cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE);
}
EXPORT_SYMBOL(scsi_print_sense);
void scsi_print_req_sense(const char *devclass, struct scsi_request *sreq)
{
- print_sense_internal(devclass, sreq->sr_sense_buffer,
- SCSI_SENSE_BUFFERSIZE, sreq->sr_request);
+ const char *name = devclass;
+
+ if (sreq->sr_request->rq_disk)
+ name = sreq->sr_request->rq_disk->disk_name;
+ __scsi_print_sense(name, sreq->sr_sense_buffer, SCSI_SENSE_BUFFERSIZE);
}
EXPORT_SYMBOL(scsi_print_req_sense);
diff -aurp scsi-misc-2.6.orig/include/scsi/scsi_dbg.h scsi-misc-2.6.sense/include/scsi/scsi_dbg.h
--- scsi-misc-2.6.orig/include/scsi/scsi_dbg.h 2005-01-05 03:14:48.000000000 -0800
+++ scsi-misc-2.6.sense/include/scsi/scsi_dbg.h 2005-01-05 03:11:58.000000000 -0800
@@ -8,6 +8,9 @@ extern void scsi_print_command(struct sc
extern void __scsi_print_command(unsigned char *);
extern void scsi_print_sense(const char *, struct scsi_cmnd *);
extern void scsi_print_req_sense(const char *, struct scsi_request *);
+extern void __scsi_print_sense(const char *name,
+ const unsigned char *sense_buffer,
+ int sense_len);
extern void scsi_print_driverbyte(int);
extern void scsi_print_hostbyte(int);
extern void scsi_print_status(unsigned char);
reply other threads:[~2005-01-05 19:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41DC4255.7050109@cs.wisc.edu \
--to=michaelc@cs.wisc.edu \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox