diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 157 |
1 files changed, 75 insertions, 82 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 215b70749e95..075852f6968c 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c | |||
@@ -10,9 +10,11 @@ | |||
10 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 10 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
11 | 11 | ||
12 | #include <linux/ctype.h> | 12 | #include <linux/ctype.h> |
13 | #include <linux/slab.h> | ||
13 | #include <asm/debug.h> | 14 | #include <asm/debug.h> |
14 | #include "zfcp_dbf.h" | 15 | #include "zfcp_dbf.h" |
15 | #include "zfcp_ext.h" | 16 | #include "zfcp_ext.h" |
17 | #include "zfcp_fc.h" | ||
16 | 18 | ||
17 | static u32 dbfsize = 4; | 19 | static u32 dbfsize = 4; |
18 | 20 | ||
@@ -139,9 +141,9 @@ void _zfcp_dbf_hba_fsf_response(const char *tag2, int level, | |||
139 | memcpy(response->fsf_status_qual, | 141 | memcpy(response->fsf_status_qual, |
140 | fsf_status_qual, FSF_STATUS_QUALIFIER_SIZE); | 142 | fsf_status_qual, FSF_STATUS_QUALIFIER_SIZE); |
141 | response->fsf_req_status = fsf_req->status; | 143 | response->fsf_req_status = fsf_req->status; |
142 | response->sbal_first = fsf_req->queue_req.sbal_first; | 144 | response->sbal_first = fsf_req->qdio_req.sbal_first; |
143 | response->sbal_last = fsf_req->queue_req.sbal_last; | 145 | response->sbal_last = fsf_req->qdio_req.sbal_last; |
144 | response->sbal_response = fsf_req->queue_req.sbal_response; | 146 | response->sbal_response = fsf_req->qdio_req.sbal_response; |
145 | response->pool = fsf_req->pool != NULL; | 147 | response->pool = fsf_req->pool != NULL; |
146 | response->erp_action = (unsigned long)fsf_req->erp_action; | 148 | response->erp_action = (unsigned long)fsf_req->erp_action; |
147 | 149 | ||
@@ -177,8 +179,7 @@ void _zfcp_dbf_hba_fsf_response(const char *tag2, int level, | |||
177 | 179 | ||
178 | case FSF_QTCB_SEND_ELS: | 180 | case FSF_QTCB_SEND_ELS: |
179 | send_els = (struct zfcp_send_els *)fsf_req->data; | 181 | send_els = (struct zfcp_send_els *)fsf_req->data; |
180 | response->u.els.d_id = qtcb->bottom.support.d_id; | 182 | response->u.els.d_id = ntoh24(qtcb->bottom.support.d_id); |
181 | response->u.els.ls_code = send_els->ls_code >> 24; | ||
182 | break; | 183 | break; |
183 | 184 | ||
184 | case FSF_QTCB_ABORT_FCP_CMND: | 185 | case FSF_QTCB_ABORT_FCP_CMND: |
@@ -327,7 +328,7 @@ static void zfcp_dbf_hba_view_response(char **p, | |||
327 | break; | 328 | break; |
328 | zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->u.fcp.cmnd); | 329 | zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->u.fcp.cmnd); |
329 | zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->u.fcp.serial); | 330 | zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->u.fcp.serial); |
330 | p += sprintf(*p, "\n"); | 331 | *p += sprintf(*p, "\n"); |
331 | break; | 332 | break; |
332 | 333 | ||
333 | case FSF_QTCB_OPEN_PORT_WITH_DID: | 334 | case FSF_QTCB_OPEN_PORT_WITH_DID: |
@@ -348,7 +349,6 @@ static void zfcp_dbf_hba_view_response(char **p, | |||
348 | 349 | ||
349 | case FSF_QTCB_SEND_ELS: | 350 | case FSF_QTCB_SEND_ELS: |
350 | zfcp_dbf_out(p, "d_id", "0x%06x", r->u.els.d_id); | 351 | zfcp_dbf_out(p, "d_id", "0x%06x", r->u.els.d_id); |
351 | zfcp_dbf_out(p, "ls_code", "0x%02x", r->u.els.ls_code); | ||
352 | break; | 352 | break; |
353 | 353 | ||
354 | case FSF_QTCB_ABORT_FCP_CMND: | 354 | case FSF_QTCB_ABORT_FCP_CMND: |
@@ -577,7 +577,8 @@ void zfcp_dbf_rec_adapter(char *id, void *ref, struct zfcp_dbf *dbf) | |||
577 | struct zfcp_adapter *adapter = dbf->adapter; | 577 | struct zfcp_adapter *adapter = dbf->adapter; |
578 | 578 | ||
579 | zfcp_dbf_rec_target(id, ref, dbf, &adapter->status, | 579 | zfcp_dbf_rec_target(id, ref, dbf, &adapter->status, |
580 | &adapter->erp_counter, 0, 0, 0); | 580 | &adapter->erp_counter, 0, 0, |
581 | ZFCP_DBF_INVALID_LUN); | ||
581 | } | 582 | } |
582 | 583 | ||
583 | /** | 584 | /** |
@@ -591,8 +592,8 @@ void zfcp_dbf_rec_port(char *id, void *ref, struct zfcp_port *port) | |||
591 | struct zfcp_dbf *dbf = port->adapter->dbf; | 592 | struct zfcp_dbf *dbf = port->adapter->dbf; |
592 | 593 | ||
593 | zfcp_dbf_rec_target(id, ref, dbf, &port->status, | 594 | zfcp_dbf_rec_target(id, ref, dbf, &port->status, |
594 | &port->erp_counter, port->wwpn, port->d_id, | 595 | &port->erp_counter, port->wwpn, port->d_id, |
595 | 0); | 596 | ZFCP_DBF_INVALID_LUN); |
596 | } | 597 | } |
597 | 598 | ||
598 | /** | 599 | /** |
@@ -643,10 +644,9 @@ void zfcp_dbf_rec_trigger(char *id2, void *ref, u8 want, u8 need, void *action, | |||
643 | r->u.trigger.ps = atomic_read(&port->status); | 644 | r->u.trigger.ps = atomic_read(&port->status); |
644 | r->u.trigger.wwpn = port->wwpn; | 645 | r->u.trigger.wwpn = port->wwpn; |
645 | } | 646 | } |
646 | if (unit) { | 647 | if (unit) |
647 | r->u.trigger.us = atomic_read(&unit->status); | 648 | r->u.trigger.us = atomic_read(&unit->status); |
648 | r->u.trigger.fcp_lun = unit->fcp_lun; | 649 | r->u.trigger.fcp_lun = unit ? unit->fcp_lun : ZFCP_DBF_INVALID_LUN; |
649 | } | ||
650 | debug_event(dbf->rec, action ? 1 : 4, r, sizeof(*r)); | 650 | debug_event(dbf->rec, action ? 1 : 4, r, sizeof(*r)); |
651 | spin_unlock_irqrestore(&dbf->rec_lock, flags); | 651 | spin_unlock_irqrestore(&dbf->rec_lock, flags); |
652 | } | 652 | } |
@@ -669,7 +669,7 @@ void zfcp_dbf_rec_action(char *id2, struct zfcp_erp_action *erp_action) | |||
669 | r->u.action.action = (unsigned long)erp_action; | 669 | r->u.action.action = (unsigned long)erp_action; |
670 | r->u.action.status = erp_action->status; | 670 | r->u.action.status = erp_action->status; |
671 | r->u.action.step = erp_action->step; | 671 | r->u.action.step = erp_action->step; |
672 | r->u.action.fsf_req = (unsigned long)erp_action->fsf_req; | 672 | r->u.action.fsf_req = erp_action->fsf_req_id; |
673 | debug_event(dbf->rec, 5, r, sizeof(*r)); | 673 | debug_event(dbf->rec, 5, r, sizeof(*r)); |
674 | spin_unlock_irqrestore(&dbf->rec_lock, flags); | 674 | spin_unlock_irqrestore(&dbf->rec_lock, flags); |
675 | } | 675 | } |
@@ -677,14 +677,14 @@ void zfcp_dbf_rec_action(char *id2, struct zfcp_erp_action *erp_action) | |||
677 | /** | 677 | /** |
678 | * zfcp_dbf_san_ct_request - trace event for issued CT request | 678 | * zfcp_dbf_san_ct_request - trace event for issued CT request |
679 | * @fsf_req: request containing issued CT data | 679 | * @fsf_req: request containing issued CT data |
680 | * @d_id: destination id where ct request is sent to | ||
680 | */ | 681 | */ |
681 | void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req) | 682 | void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req, u32 d_id) |
682 | { | 683 | { |
683 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; | 684 | struct zfcp_fsf_ct_els *ct = (struct zfcp_fsf_ct_els *)fsf_req->data; |
684 | struct zfcp_wka_port *wka_port = ct->wka_port; | 685 | struct zfcp_adapter *adapter = fsf_req->adapter; |
685 | struct zfcp_adapter *adapter = wka_port->adapter; | ||
686 | struct zfcp_dbf *dbf = adapter->dbf; | 686 | struct zfcp_dbf *dbf = adapter->dbf; |
687 | struct ct_hdr *hdr = sg_virt(ct->req); | 687 | struct fc_ct_hdr *hdr = sg_virt(ct->req); |
688 | struct zfcp_dbf_san_record *r = &dbf->san_buf; | 688 | struct zfcp_dbf_san_record *r = &dbf->san_buf; |
689 | struct zfcp_dbf_san_record_ct_request *oct = &r->u.ct_req; | 689 | struct zfcp_dbf_san_record_ct_request *oct = &r->u.ct_req; |
690 | int level = 3; | 690 | int level = 3; |
@@ -695,19 +695,18 @@ void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req) | |||
695 | strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE); | 695 | strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE); |
696 | r->fsf_reqid = fsf_req->req_id; | 696 | r->fsf_reqid = fsf_req->req_id; |
697 | r->fsf_seqno = fsf_req->seq_no; | 697 | r->fsf_seqno = fsf_req->seq_no; |
698 | r->s_id = fc_host_port_id(adapter->scsi_host); | 698 | oct->d_id = d_id; |
699 | r->d_id = wka_port->d_id; | 699 | oct->cmd_req_code = hdr->ct_cmd; |
700 | oct->cmd_req_code = hdr->cmd_rsp_code; | 700 | oct->revision = hdr->ct_rev; |
701 | oct->revision = hdr->revision; | 701 | oct->gs_type = hdr->ct_fs_type; |
702 | oct->gs_type = hdr->gs_type; | 702 | oct->gs_subtype = hdr->ct_fs_subtype; |
703 | oct->gs_subtype = hdr->gs_subtype; | 703 | oct->options = hdr->ct_options; |
704 | oct->options = hdr->options; | 704 | oct->max_res_size = hdr->ct_mr_size; |
705 | oct->max_res_size = hdr->max_res_size; | 705 | oct->len = min((int)ct->req->length - (int)sizeof(struct fc_ct_hdr), |
706 | oct->len = min((int)ct->req->length - (int)sizeof(struct ct_hdr), | ||
707 | ZFCP_DBF_SAN_MAX_PAYLOAD); | 706 | ZFCP_DBF_SAN_MAX_PAYLOAD); |
708 | debug_event(dbf->san, level, r, sizeof(*r)); | 707 | debug_event(dbf->san, level, r, sizeof(*r)); |
709 | zfcp_dbf_hexdump(dbf->san, r, sizeof(*r), level, | 708 | zfcp_dbf_hexdump(dbf->san, r, sizeof(*r), level, |
710 | (void *)hdr + sizeof(struct ct_hdr), oct->len); | 709 | (void *)hdr + sizeof(struct fc_ct_hdr), oct->len); |
711 | spin_unlock_irqrestore(&dbf->san_lock, flags); | 710 | spin_unlock_irqrestore(&dbf->san_lock, flags); |
712 | } | 711 | } |
713 | 712 | ||
@@ -717,10 +716,9 @@ void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req) | |||
717 | */ | 716 | */ |
718 | void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *fsf_req) | 717 | void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *fsf_req) |
719 | { | 718 | { |
720 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; | 719 | struct zfcp_fsf_ct_els *ct = (struct zfcp_fsf_ct_els *)fsf_req->data; |
721 | struct zfcp_wka_port *wka_port = ct->wka_port; | 720 | struct zfcp_adapter *adapter = fsf_req->adapter; |
722 | struct zfcp_adapter *adapter = wka_port->adapter; | 721 | struct fc_ct_hdr *hdr = sg_virt(ct->resp); |
723 | struct ct_hdr *hdr = sg_virt(ct->resp); | ||
724 | struct zfcp_dbf *dbf = adapter->dbf; | 722 | struct zfcp_dbf *dbf = adapter->dbf; |
725 | struct zfcp_dbf_san_record *r = &dbf->san_buf; | 723 | struct zfcp_dbf_san_record *r = &dbf->san_buf; |
726 | struct zfcp_dbf_san_record_ct_response *rct = &r->u.ct_resp; | 724 | struct zfcp_dbf_san_record_ct_response *rct = &r->u.ct_resp; |
@@ -732,25 +730,23 @@ void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *fsf_req) | |||
732 | strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); | 730 | strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); |
733 | r->fsf_reqid = fsf_req->req_id; | 731 | r->fsf_reqid = fsf_req->req_id; |
734 | r->fsf_seqno = fsf_req->seq_no; | 732 | r->fsf_seqno = fsf_req->seq_no; |
735 | r->s_id = wka_port->d_id; | 733 | rct->cmd_rsp_code = hdr->ct_cmd; |
736 | r->d_id = fc_host_port_id(adapter->scsi_host); | 734 | rct->revision = hdr->ct_rev; |
737 | rct->cmd_rsp_code = hdr->cmd_rsp_code; | 735 | rct->reason_code = hdr->ct_reason; |
738 | rct->revision = hdr->revision; | 736 | rct->expl = hdr->ct_explan; |
739 | rct->reason_code = hdr->reason_code; | 737 | rct->vendor_unique = hdr->ct_vendor; |
740 | rct->expl = hdr->reason_code_expl; | 738 | rct->max_res_size = hdr->ct_mr_size; |
741 | rct->vendor_unique = hdr->vendor_unique; | 739 | rct->len = min((int)ct->resp->length - (int)sizeof(struct fc_ct_hdr), |
742 | rct->max_res_size = hdr->max_res_size; | ||
743 | rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr), | ||
744 | ZFCP_DBF_SAN_MAX_PAYLOAD); | 740 | ZFCP_DBF_SAN_MAX_PAYLOAD); |
745 | debug_event(dbf->san, level, r, sizeof(*r)); | 741 | debug_event(dbf->san, level, r, sizeof(*r)); |
746 | zfcp_dbf_hexdump(dbf->san, r, sizeof(*r), level, | 742 | zfcp_dbf_hexdump(dbf->san, r, sizeof(*r), level, |
747 | (void *)hdr + sizeof(struct ct_hdr), rct->len); | 743 | (void *)hdr + sizeof(struct fc_ct_hdr), rct->len); |
748 | spin_unlock_irqrestore(&dbf->san_lock, flags); | 744 | spin_unlock_irqrestore(&dbf->san_lock, flags); |
749 | } | 745 | } |
750 | 746 | ||
751 | static void zfcp_dbf_san_els(const char *tag, int level, | 747 | static void zfcp_dbf_san_els(const char *tag, int level, |
752 | struct zfcp_fsf_req *fsf_req, u32 s_id, u32 d_id, | 748 | struct zfcp_fsf_req *fsf_req, u32 d_id, |
753 | u8 ls_code, void *buffer, int buflen) | 749 | void *buffer, int buflen) |
754 | { | 750 | { |
755 | struct zfcp_adapter *adapter = fsf_req->adapter; | 751 | struct zfcp_adapter *adapter = fsf_req->adapter; |
756 | struct zfcp_dbf *dbf = adapter->dbf; | 752 | struct zfcp_dbf *dbf = adapter->dbf; |
@@ -762,9 +758,7 @@ static void zfcp_dbf_san_els(const char *tag, int level, | |||
762 | strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); | 758 | strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); |
763 | rec->fsf_reqid = fsf_req->req_id; | 759 | rec->fsf_reqid = fsf_req->req_id; |
764 | rec->fsf_seqno = fsf_req->seq_no; | 760 | rec->fsf_seqno = fsf_req->seq_no; |
765 | rec->s_id = s_id; | 761 | rec->u.els.d_id = d_id; |
766 | rec->d_id = d_id; | ||
767 | rec->u.els.ls_code = ls_code; | ||
768 | debug_event(dbf->san, level, rec, sizeof(*rec)); | 762 | debug_event(dbf->san, level, rec, sizeof(*rec)); |
769 | zfcp_dbf_hexdump(dbf->san, rec, sizeof(*rec), level, | 763 | zfcp_dbf_hexdump(dbf->san, rec, sizeof(*rec), level, |
770 | buffer, min(buflen, ZFCP_DBF_SAN_MAX_PAYLOAD)); | 764 | buffer, min(buflen, ZFCP_DBF_SAN_MAX_PAYLOAD)); |
@@ -777,12 +771,11 @@ static void zfcp_dbf_san_els(const char *tag, int level, | |||
777 | */ | 771 | */ |
778 | void zfcp_dbf_san_els_request(struct zfcp_fsf_req *fsf_req) | 772 | void zfcp_dbf_san_els_request(struct zfcp_fsf_req *fsf_req) |
779 | { | 773 | { |
780 | struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; | 774 | struct zfcp_fsf_ct_els *els = (struct zfcp_fsf_ct_els *)fsf_req->data; |
775 | u32 d_id = ntoh24(fsf_req->qtcb->bottom.support.d_id); | ||
781 | 776 | ||
782 | zfcp_dbf_san_els("oels", 2, fsf_req, | 777 | zfcp_dbf_san_els("oels", 2, fsf_req, d_id, |
783 | fc_host_port_id(els->adapter->scsi_host), | 778 | sg_virt(els->req), els->req->length); |
784 | els->d_id, *(u8 *) sg_virt(els->req), | ||
785 | sg_virt(els->req), els->req->length); | ||
786 | } | 779 | } |
787 | 780 | ||
788 | /** | 781 | /** |
@@ -791,12 +784,11 @@ void zfcp_dbf_san_els_request(struct zfcp_fsf_req *fsf_req) | |||
791 | */ | 784 | */ |
792 | void zfcp_dbf_san_els_response(struct zfcp_fsf_req *fsf_req) | 785 | void zfcp_dbf_san_els_response(struct zfcp_fsf_req *fsf_req) |
793 | { | 786 | { |
794 | struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; | 787 | struct zfcp_fsf_ct_els *els = (struct zfcp_fsf_ct_els *)fsf_req->data; |
788 | u32 d_id = ntoh24(fsf_req->qtcb->bottom.support.d_id); | ||
795 | 789 | ||
796 | zfcp_dbf_san_els("rels", 2, fsf_req, els->d_id, | 790 | zfcp_dbf_san_els("rels", 2, fsf_req, d_id, |
797 | fc_host_port_id(els->adapter->scsi_host), | 791 | sg_virt(els->resp), els->resp->length); |
798 | *(u8 *)sg_virt(els->req), sg_virt(els->resp), | ||
799 | els->resp->length); | ||
800 | } | 792 | } |
801 | 793 | ||
802 | /** | 794 | /** |
@@ -805,16 +797,13 @@ void zfcp_dbf_san_els_response(struct zfcp_fsf_req *fsf_req) | |||
805 | */ | 797 | */ |
806 | void zfcp_dbf_san_incoming_els(struct zfcp_fsf_req *fsf_req) | 798 | void zfcp_dbf_san_incoming_els(struct zfcp_fsf_req *fsf_req) |
807 | { | 799 | { |
808 | struct zfcp_adapter *adapter = fsf_req->adapter; | ||
809 | struct fsf_status_read_buffer *buf = | 800 | struct fsf_status_read_buffer *buf = |
810 | (struct fsf_status_read_buffer *)fsf_req->data; | 801 | (struct fsf_status_read_buffer *)fsf_req->data; |
811 | int length = (int)buf->length - | 802 | int length = (int)buf->length - |
812 | (int)((void *)&buf->payload - (void *)buf); | 803 | (int)((void *)&buf->payload - (void *)buf); |
813 | 804 | ||
814 | zfcp_dbf_san_els("iels", 1, fsf_req, buf->d_id, | 805 | zfcp_dbf_san_els("iels", 1, fsf_req, ntoh24(buf->d_id), |
815 | fc_host_port_id(adapter->scsi_host), | 806 | (void *)buf->payload.data, length); |
816 | buf->payload.data[0], (void *)buf->payload.data, | ||
817 | length); | ||
818 | } | 807 | } |
819 | 808 | ||
820 | static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view, | 809 | static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view, |
@@ -829,11 +818,10 @@ static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view, | |||
829 | zfcp_dbf_tag(&p, "tag", r->tag); | 818 | zfcp_dbf_tag(&p, "tag", r->tag); |
830 | zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); | 819 | zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); |
831 | zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); | 820 | zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); |
832 | zfcp_dbf_out(&p, "s_id", "0x%06x", r->s_id); | ||
833 | zfcp_dbf_out(&p, "d_id", "0x%06x", r->d_id); | ||
834 | 821 | ||
835 | if (strncmp(r->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) { | 822 | if (strncmp(r->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) { |
836 | struct zfcp_dbf_san_record_ct_request *ct = &r->u.ct_req; | 823 | struct zfcp_dbf_san_record_ct_request *ct = &r->u.ct_req; |
824 | zfcp_dbf_out(&p, "d_id", "0x%06x", ct->d_id); | ||
837 | zfcp_dbf_out(&p, "cmd_req_code", "0x%04x", ct->cmd_req_code); | 825 | zfcp_dbf_out(&p, "cmd_req_code", "0x%04x", ct->cmd_req_code); |
838 | zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision); | 826 | zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision); |
839 | zfcp_dbf_out(&p, "gs_type", "0x%02x", ct->gs_type); | 827 | zfcp_dbf_out(&p, "gs_type", "0x%02x", ct->gs_type); |
@@ -852,7 +840,7 @@ static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view, | |||
852 | strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 || | 840 | strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 || |
853 | strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) { | 841 | strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) { |
854 | struct zfcp_dbf_san_record_els *els = &r->u.els; | 842 | struct zfcp_dbf_san_record_els *els = &r->u.els; |
855 | zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code); | 843 | zfcp_dbf_out(&p, "d_id", "0x%06x", els->d_id); |
856 | } | 844 | } |
857 | return p - out_buf; | 845 | return p - out_buf; |
858 | } | 846 | } |
@@ -870,8 +858,9 @@ void _zfcp_dbf_scsi(const char *tag, const char *tag2, int level, | |||
870 | struct zfcp_dbf_scsi_record *rec = &dbf->scsi_buf; | 858 | struct zfcp_dbf_scsi_record *rec = &dbf->scsi_buf; |
871 | struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec; | 859 | struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec; |
872 | unsigned long flags; | 860 | unsigned long flags; |
873 | struct fcp_rsp_iu *fcp_rsp; | 861 | struct fcp_resp_with_ext *fcp_rsp; |
874 | char *fcp_rsp_info = NULL, *fcp_sns_info = NULL; | 862 | struct fcp_resp_rsp_info *fcp_rsp_info = NULL; |
863 | char *fcp_sns_info = NULL; | ||
875 | int offset = 0, buflen = 0; | 864 | int offset = 0, buflen = 0; |
876 | 865 | ||
877 | spin_lock_irqsave(&dbf->scsi_lock, flags); | 866 | spin_lock_irqsave(&dbf->scsi_lock, flags); |
@@ -895,20 +884,22 @@ void _zfcp_dbf_scsi(const char *tag, const char *tag2, int level, | |||
895 | rec->scsi_allowed = scsi_cmnd->allowed; | 884 | rec->scsi_allowed = scsi_cmnd->allowed; |
896 | } | 885 | } |
897 | if (fsf_req != NULL) { | 886 | if (fsf_req != NULL) { |
898 | fcp_rsp = (struct fcp_rsp_iu *) | 887 | fcp_rsp = (struct fcp_resp_with_ext *) |
899 | &(fsf_req->qtcb->bottom.io.fcp_rsp); | 888 | &(fsf_req->qtcb->bottom.io.fcp_rsp); |
900 | fcp_rsp_info = (unsigned char *) &fcp_rsp[1]; | 889 | fcp_rsp_info = (struct fcp_resp_rsp_info *) |
901 | fcp_sns_info = | 890 | &fcp_rsp[1]; |
902 | zfcp_get_fcp_sns_info_ptr(fcp_rsp); | 891 | fcp_sns_info = (char *) &fcp_rsp[1]; |
903 | 892 | if (fcp_rsp->resp.fr_flags & FCP_RSP_LEN_VAL) | |
904 | rec->rsp_validity = fcp_rsp->validity.value; | 893 | fcp_sns_info += fcp_rsp->ext.fr_sns_len; |
905 | rec->rsp_scsi_status = fcp_rsp->scsi_status; | 894 | |
906 | rec->rsp_resid = fcp_rsp->fcp_resid; | 895 | rec->rsp_validity = fcp_rsp->resp.fr_flags; |
907 | if (fcp_rsp->validity.bits.fcp_rsp_len_valid) | 896 | rec->rsp_scsi_status = fcp_rsp->resp.fr_status; |
908 | rec->rsp_code = *(fcp_rsp_info + 3); | 897 | rec->rsp_resid = fcp_rsp->ext.fr_resid; |
909 | if (fcp_rsp->validity.bits.fcp_sns_len_valid) { | 898 | if (fcp_rsp->resp.fr_flags & FCP_RSP_LEN_VAL) |
910 | buflen = min((int)fcp_rsp->fcp_sns_len, | 899 | rec->rsp_code = fcp_rsp_info->rsp_code; |
911 | ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO); | 900 | if (fcp_rsp->resp.fr_flags & FCP_SNS_LEN_VAL) { |
901 | buflen = min(fcp_rsp->ext.fr_sns_len, | ||
902 | (u32)ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO); | ||
912 | rec->sns_info_len = buflen; | 903 | rec->sns_info_len = buflen; |
913 | memcpy(rec->sns_info, fcp_sns_info, | 904 | memcpy(rec->sns_info, fcp_sns_info, |
914 | min(buflen, | 905 | min(buflen, |
@@ -1067,6 +1058,8 @@ err_out: | |||
1067 | */ | 1058 | */ |
1068 | void zfcp_dbf_adapter_unregister(struct zfcp_dbf *dbf) | 1059 | void zfcp_dbf_adapter_unregister(struct zfcp_dbf *dbf) |
1069 | { | 1060 | { |
1061 | if (!dbf) | ||
1062 | return; | ||
1070 | debug_unregister(dbf->scsi); | 1063 | debug_unregister(dbf->scsi); |
1071 | debug_unregister(dbf->san); | 1064 | debug_unregister(dbf->san); |
1072 | debug_unregister(dbf->hba); | 1065 | debug_unregister(dbf->hba); |