diff options
author | Alan Cox <alan@linux.intel.com> | 2012-07-04 11:35:35 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-07-06 16:09:23 -0400 |
commit | 4f1d0f1971ba37010603a3a5c763f398b888d2f4 (patch) | |
tree | 43dccd28d2930baadbc0bdf0d4fcddedc4c0c0af /drivers/scsi | |
parent | 863555be0c81558b1af277addcf68acb8f778860 (diff) |
qla2xxx: print the right array elements in qlt_async_event
Based upon Alan's patch from Coverity scan id 793583, these debug
messages in qlt_async_event() should be starting from byte 0, which is
always the Asynchronous Event Status Code from the parent switch statement.
Also, rename reason_code -> login_code following the language used in
2500 FW spec for Port Database Changed (0x8014) -> Port Database Changed
Event Mailbox Register for mailbox[2].
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 6986552b47e6..77759c78cc21 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -3960,7 +3960,7 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
3960 | { | 3960 | { |
3961 | struct qla_hw_data *ha = vha->hw; | 3961 | struct qla_hw_data *ha = vha->hw; |
3962 | struct qla_tgt *tgt = ha->tgt.qla_tgt; | 3962 | struct qla_tgt *tgt = ha->tgt.qla_tgt; |
3963 | int reason_code; | 3963 | int login_code; |
3964 | 3964 | ||
3965 | ql_dbg(ql_dbg_tgt, vha, 0xe039, | 3965 | ql_dbg(ql_dbg_tgt, vha, 0xe039, |
3966 | "scsi(%ld): ha state %d init_done %d oper_mode %d topo %d\n", | 3966 | "scsi(%ld): ha state %d init_done %d oper_mode %d topo %d\n", |
@@ -4003,9 +4003,9 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
4003 | { | 4003 | { |
4004 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03b, | 4004 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03b, |
4005 | "qla_target(%d): Async LOOP_UP occured " | 4005 | "qla_target(%d): Async LOOP_UP occured " |
4006 | "(m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, | 4006 | "(m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx, |
4007 | le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4007 | le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4008 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4008 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4009 | if (tgt->link_reinit_iocb_pending) { | 4009 | if (tgt->link_reinit_iocb_pending) { |
4010 | qlt_send_notify_ack(vha, (void *)&tgt->link_reinit_iocb, | 4010 | qlt_send_notify_ack(vha, (void *)&tgt->link_reinit_iocb, |
4011 | 0, 0, 0, 0, 0, 0); | 4011 | 0, 0, 0, 0, 0, 0); |
@@ -4020,23 +4020,24 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
4020 | case MBA_RSCN_UPDATE: | 4020 | case MBA_RSCN_UPDATE: |
4021 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03c, | 4021 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03c, |
4022 | "qla_target(%d): Async event %#x occured " | 4022 | "qla_target(%d): Async event %#x occured " |
4023 | "(m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, code, | 4023 | "(m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx, code, |
4024 | le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4024 | le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4025 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4025 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4026 | break; | 4026 | break; |
4027 | 4027 | ||
4028 | case MBA_PORT_UPDATE: | 4028 | case MBA_PORT_UPDATE: |
4029 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03d, | 4029 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03d, |
4030 | "qla_target(%d): Port update async event %#x " | 4030 | "qla_target(%d): Port update async event %#x " |
4031 | "occured: updating the ports database (m[1]=%x, m[2]=%x, " | 4031 | "occured: updating the ports database (m[0]=%x, m[1]=%x, " |
4032 | "m[3]=%x, m[4]=%x)", vha->vp_idx, code, | 4032 | "m[2]=%x, m[3]=%x)", vha->vp_idx, code, |
4033 | le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4033 | le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4034 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4034 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4035 | reason_code = le16_to_cpu(mailbox[2]); | 4035 | |
4036 | if (reason_code == 0x4) | 4036 | login_code = le16_to_cpu(mailbox[2]); |
4037 | if (login_code == 0x4) | ||
4037 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03e, | 4038 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03e, |
4038 | "Async MB 2: Got PLOGI Complete\n"); | 4039 | "Async MB 2: Got PLOGI Complete\n"); |
4039 | else if (reason_code == 0x7) | 4040 | else if (login_code == 0x7) |
4040 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03f, | 4041 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03f, |
4041 | "Async MB 2: Port Logged Out\n"); | 4042 | "Async MB 2: Port Logged Out\n"); |
4042 | break; | 4043 | break; |
@@ -4044,9 +4045,9 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha, | |||
4044 | default: | 4045 | default: |
4045 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf040, | 4046 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf040, |
4046 | "qla_target(%d): Async event %#x occured: " | 4047 | "qla_target(%d): Async event %#x occured: " |
4047 | "ignore (m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, | 4048 | "ignore (m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx, |
4048 | code, le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]), | 4049 | code, le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]), |
4049 | le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4])); | 4050 | le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3])); |
4050 | break; | 4051 | break; |
4051 | } | 4052 | } |
4052 | 4053 | ||