diff options
author | Joe Eykholt <jeykholt@cisco.com> | 2009-11-03 14:49:00 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:01:17 -0500 |
commit | 52a6690d3f0cb7414c34b1e26c569b32d4987662 (patch) | |
tree | cbb8ff950e319b9d3f7125ce882cf9eeea22ef3b /drivers/scsi/libfc | |
parent | 5f9a056db9c7973c46337ec8d034323aa72bf206 (diff) |
[SCSI] libfc: fix fc_els_resp_type to correct display of CT responses
Local port debug messages were using fc_els_resp_type() which showed
all CT responses as rejects.
Handle CT responses correctly based by inspecting fh_type.
I decided not to rename the function to keep the patch smaller.
We could call it just fc_resp_type() or fc_elsct_resp_type().
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')
-rw-r--r-- | drivers/scsi/libfc/fc_elsct.c | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/drivers/scsi/libfc/fc_elsct.c b/drivers/scsi/libfc/fc_elsct.c index 01be43f80f34..53748724f2c5 100644 --- a/drivers/scsi/libfc/fc_elsct.c +++ b/drivers/scsi/libfc/fc_elsct.c | |||
@@ -90,6 +90,9 @@ EXPORT_SYMBOL(fc_elsct_init); | |||
90 | const char *fc_els_resp_type(struct fc_frame *fp) | 90 | const char *fc_els_resp_type(struct fc_frame *fp) |
91 | { | 91 | { |
92 | const char *msg; | 92 | const char *msg; |
93 | struct fc_frame_header *fh; | ||
94 | struct fc_ct_hdr *ct; | ||
95 | |||
93 | if (IS_ERR(fp)) { | 96 | if (IS_ERR(fp)) { |
94 | switch (-PTR_ERR(fp)) { | 97 | switch (-PTR_ERR(fp)) { |
95 | case FC_NO_ERR: | 98 | case FC_NO_ERR: |
@@ -106,15 +109,41 @@ const char *fc_els_resp_type(struct fc_frame *fp) | |||
106 | break; | 109 | break; |
107 | } | 110 | } |
108 | } else { | 111 | } else { |
109 | switch (fc_frame_payload_op(fp)) { | 112 | fh = fc_frame_header_get(fp); |
110 | case ELS_LS_ACC: | 113 | switch (fh->fh_type) { |
111 | msg = "accept"; | 114 | case FC_TYPE_ELS: |
115 | switch (fc_frame_payload_op(fp)) { | ||
116 | case ELS_LS_ACC: | ||
117 | msg = "accept"; | ||
118 | break; | ||
119 | case ELS_LS_RJT: | ||
120 | msg = "reject"; | ||
121 | break; | ||
122 | default: | ||
123 | msg = "response unknown ELS"; | ||
124 | break; | ||
125 | } | ||
112 | break; | 126 | break; |
113 | case ELS_LS_RJT: | 127 | case FC_TYPE_CT: |
114 | msg = "reject"; | 128 | ct = fc_frame_payload_get(fp, sizeof(*ct)); |
129 | if (ct) { | ||
130 | switch (ntohs(ct->ct_cmd)) { | ||
131 | case FC_FS_ACC: | ||
132 | msg = "CT accept"; | ||
133 | break; | ||
134 | case FC_FS_RJT: | ||
135 | msg = "CT reject"; | ||
136 | break; | ||
137 | default: | ||
138 | msg = "response unknown CT"; | ||
139 | break; | ||
140 | } | ||
141 | } else { | ||
142 | msg = "short CT response"; | ||
143 | } | ||
115 | break; | 144 | break; |
116 | default: | 145 | default: |
117 | msg = "response unknown ELS"; | 146 | msg = "response not ELS or CT"; |
118 | break; | 147 | break; |
119 | } | 148 | } |
120 | } | 149 | } |