diff options
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 18 |
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, | |||
31 | 31 | ||
32 | #define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER | 32 | #define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER |
33 | 33 | ||
34 | static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len, | ||
35 | int level, char *from, int from_len) | ||
36 | { | ||
37 | int offset; | ||
38 | struct zfcp_dbf_dump *dump = to; | ||
39 | int room = to_len - sizeof(*dump); | ||
40 | |||
41 | for (offset = 0; offset < from_len; offset += dump->size) { | ||
42 | memset(to, 0, to_len); | ||
43 | strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE); | ||
44 | dump->total_size = from_len; | ||
45 | dump->offset = offset; | ||
46 | dump->size = min(from_len - offset, room); | ||
47 | memcpy(dump->data, from + offset, dump->size); | ||
48 | debug_event(dbf, level, dump, dump->size); | ||
49 | } | ||
50 | } | ||
51 | |||
34 | static int | 52 | static int |
35 | zfcp_dbf_stck(char *out_buf, const char *label, unsigned long long stck) | 53 | zfcp_dbf_stck(char *out_buf, const char *label, unsigned long long stck) |
36 | { | 54 | { |