diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2009-08-25 14:03:21 -0700 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-10 12:07:59 -0500 |
commit | f657d299cf05883e23e12a69e86842da1df378ad (patch) | |
tree | 3593d2054bd361f28593eea12c83868709013b0c /drivers/scsi/libfc/fc_elsct.c | |
parent | 25b37b981e706c6df72c28c94f7787c3ea0cd343 (diff) | |
download | kernel_goldelico_gta04-f657d299cf05883e23e12a69e86842da1df378ad.zip kernel_goldelico_gta04-f657d299cf05883e23e12a69e86842da1df378ad.tar.gz kernel_goldelico_gta04-f657d299cf05883e23e12a69e86842da1df378ad.tar.bz2 |
[SCSI] libfc: improve debug messages for ELS response handlers
Improve lport and rport debug messages to indicate whether
the response is LS_ACC, LS_RJT, closed, or timeout.
Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc/fc_elsct.c')
-rw-r--r-- | drivers/scsi/libfc/fc_elsct.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/scsi/libfc/fc_elsct.c b/drivers/scsi/libfc/fc_elsct.c index 5e8b011..d655924 100644 --- a/drivers/scsi/libfc/fc_elsct.c +++ b/drivers/scsi/libfc/fc_elsct.c @@ -70,3 +70,41 @@ int fc_elsct_init(struct fc_lport *lport) return 0; } EXPORT_SYMBOL(fc_elsct_init); + +/** + * fc_els_resp_type() - return string describing ELS response for debug. + * @fp: frame pointer with possible error code. + */ +const char *fc_els_resp_type(struct fc_frame *fp) +{ + const char *msg; + if (IS_ERR(fp)) { + switch (-PTR_ERR(fp)) { + case FC_NO_ERR: + msg = "response no error"; + break; + case FC_EX_TIMEOUT: + msg = "response timeout"; + break; + case FC_EX_CLOSED: + msg = "response closed"; + break; + default: + msg = "response unknown error"; + break; + } + } else { + switch (fc_frame_payload_op(fp)) { + case ELS_LS_ACC: + msg = "accept"; + break; + case ELS_LS_RJT: + msg = "reject"; + break; + default: + msg = "response unknown ELS"; + break; + } + } + return msg; +} |