summaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
authorMartin Peschke <mp3@de.ibm.com>2008-03-27 14:21:55 +0100
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 19:19:03 +0200
commitc15450e33d198334291d50b5a95337c6b90cdab0 (patch)
treecabb41b4c3f441beba520aabb4d28007b6c86718 /drivers/s390/scsi
parent[SCSI] scsi_debug: fix lba and data length calculation bugs (diff)
downloadlinux-c15450e33d198334291d50b5a95337c6b90cdab0.tar.xz
linux-c15450e33d198334291d50b5a95337c6b90cdab0.zip
[SCSI] zfcp: Introduce a helper function that dumps hex data to a zfcp trace.
Signed-off-by: Martin Peschke <mp3@de.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 701046c9bb33..0faadb0cda24 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -31,6 +31,24 @@ MODULE_PARM_DESC(dbfsize,
#define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER
+static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len,
+ int level, char *from, int from_len)
+{
+ int offset;
+ struct zfcp_dbf_dump *dump = to;
+ int room = to_len - sizeof(*dump);
+
+ for (offset = 0; offset < from_len; offset += dump->size) {
+ memset(to, 0, to_len);
+ strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE);
+ dump->total_size = from_len;
+ dump->offset = offset;
+ dump->size = min(from_len - offset, room);
+ memcpy(dump->data, from + offset, dump->size);
+ debug_event(dbf, level, dump, dump->size);
+ }
+}
+
static int
zfcp_dbf_stck(char *out_buf, const char *label, unsigned long long stck)
{