diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_fc.h')
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.h | 126 |
1 files changed, 67 insertions, 59 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.h b/drivers/s390/scsi/zfcp_fc.h index 938d50360166..4561f3bf7300 100644 --- a/drivers/s390/scsi/zfcp_fc.h +++ b/drivers/s390/scsi/zfcp_fc.h | |||
@@ -64,33 +64,16 @@ struct zfcp_fc_gid_pn_req { | |||
64 | } __packed; | 64 | } __packed; |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * struct zfcp_fc_gid_pn_resp - container for ct header plus gid_pn response | 67 | * struct zfcp_fc_gid_pn_rsp - container for ct header plus gid_pn response |
68 | * @ct_hdr: FC GS common transport header | 68 | * @ct_hdr: FC GS common transport header |
69 | * @gid_pn: GID_PN response | 69 | * @gid_pn: GID_PN response |
70 | */ | 70 | */ |
71 | struct zfcp_fc_gid_pn_resp { | 71 | struct zfcp_fc_gid_pn_rsp { |
72 | struct fc_ct_hdr ct_hdr; | 72 | struct fc_ct_hdr ct_hdr; |
73 | struct fc_gid_pn_resp gid_pn; | 73 | struct fc_gid_pn_resp gid_pn; |
74 | } __packed; | 74 | } __packed; |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * struct zfcp_fc_gid_pn - everything required in zfcp for gid_pn request | ||
78 | * @ct: data passed to zfcp_fsf for issuing fsf request | ||
79 | * @sg_req: scatterlist entry for request data | ||
80 | * @sg_resp: scatterlist entry for response data | ||
81 | * @gid_pn_req: GID_PN request data | ||
82 | * @gid_pn_resp: GID_PN response data | ||
83 | */ | ||
84 | struct zfcp_fc_gid_pn { | ||
85 | struct zfcp_fsf_ct_els ct; | ||
86 | struct scatterlist sg_req; | ||
87 | struct scatterlist sg_resp; | ||
88 | struct zfcp_fc_gid_pn_req gid_pn_req; | ||
89 | struct zfcp_fc_gid_pn_resp gid_pn_resp; | ||
90 | struct zfcp_port *port; | ||
91 | }; | ||
92 | |||
93 | /** | ||
94 | * struct zfcp_fc_gpn_ft - container for ct header plus gpn_ft request | 77 | * struct zfcp_fc_gpn_ft - container for ct header plus gpn_ft request |
95 | * @ct_hdr: FC GS common transport header | 78 | * @ct_hdr: FC GS common transport header |
96 | * @gpn_ft: GPN_FT request | 79 | * @gpn_ft: GPN_FT request |
@@ -101,41 +84,72 @@ struct zfcp_fc_gpn_ft_req { | |||
101 | } __packed; | 84 | } __packed; |
102 | 85 | ||
103 | /** | 86 | /** |
104 | * struct zfcp_fc_gpn_ft_resp - container for ct header plus gpn_ft response | 87 | * struct zfcp_fc_gspn_req - container for ct header plus GSPN_ID request |
105 | * @ct_hdr: FC GS common transport header | 88 | * @ct_hdr: FC GS common transport header |
106 | * @gpn_ft: Array of gpn_ft response data to fill one memory page | 89 | * @gspn: GSPN_ID request |
107 | */ | 90 | */ |
108 | struct zfcp_fc_gpn_ft_resp { | 91 | struct zfcp_fc_gspn_req { |
109 | struct fc_ct_hdr ct_hdr; | 92 | struct fc_ct_hdr ct_hdr; |
110 | struct fc_gpn_ft_resp gpn_ft[ZFCP_FC_GPN_FT_ENT_PAGE]; | 93 | struct fc_gid_pn_resp gspn; |
111 | } __packed; | 94 | } __packed; |
112 | 95 | ||
113 | /** | 96 | /** |
114 | * struct zfcp_fc_gpn_ft - zfcp data for gpn_ft request | 97 | * struct zfcp_fc_gspn_rsp - container for ct header plus GSPN_ID response |
115 | * @ct: data passed to zfcp_fsf for issuing fsf request | 98 | * @ct_hdr: FC GS common transport header |
116 | * @sg_req: scatter list entry for gpn_ft request | 99 | * @gspn: GSPN_ID response |
117 | * @sg_resp: scatter list entries for gpn_ft responses (per memory page) | 100 | * @name: The name string of the GSPN_ID response |
118 | */ | 101 | */ |
119 | struct zfcp_fc_gpn_ft { | 102 | struct zfcp_fc_gspn_rsp { |
120 | struct zfcp_fsf_ct_els ct; | 103 | struct fc_ct_hdr ct_hdr; |
121 | struct scatterlist sg_req; | 104 | struct fc_gspn_resp gspn; |
122 | struct scatterlist sg_resp[ZFCP_FC_GPN_FT_NUM_BUFS]; | 105 | char name[FC_SYMBOLIC_NAME_SIZE]; |
123 | }; | 106 | } __packed; |
124 | 107 | ||
125 | /** | 108 | /** |
126 | * struct zfcp_fc_els_adisc - everything required in zfcp for issuing ELS ADISC | 109 | * struct zfcp_fc_rspn_req - container for ct header plus RSPN_ID request |
127 | * @els: data required for issuing els fsf command | 110 | * @ct_hdr: FC GS common transport header |
128 | * @req: scatterlist entry for ELS ADISC request | 111 | * @rspn: RSPN_ID request |
129 | * @resp: scatterlist entry for ELS ADISC response | 112 | * @name: The name string of the RSPN_ID request |
130 | * @adisc_req: ELS ADISC request data | ||
131 | * @adisc_resp: ELS ADISC response data | ||
132 | */ | 113 | */ |
133 | struct zfcp_fc_els_adisc { | 114 | struct zfcp_fc_rspn_req { |
134 | struct zfcp_fsf_ct_els els; | 115 | struct fc_ct_hdr ct_hdr; |
135 | struct scatterlist req; | 116 | struct fc_ns_rspn rspn; |
136 | struct scatterlist resp; | 117 | char name[FC_SYMBOLIC_NAME_SIZE]; |
137 | struct fc_els_adisc adisc_req; | 118 | } __packed; |
138 | struct fc_els_adisc adisc_resp; | 119 | |
120 | /** | ||
121 | * struct zfcp_fc_req - Container for FC ELS and CT requests sent from zfcp | ||
122 | * @ct_els: data required for issuing fsf command | ||
123 | * @sg_req: scatterlist entry for request data | ||
124 | * @sg_rsp: scatterlist entry for response data | ||
125 | * @u: request specific data | ||
126 | */ | ||
127 | struct zfcp_fc_req { | ||
128 | struct zfcp_fsf_ct_els ct_els; | ||
129 | struct scatterlist sg_req; | ||
130 | struct scatterlist sg_rsp; | ||
131 | union { | ||
132 | struct { | ||
133 | struct fc_els_adisc req; | ||
134 | struct fc_els_adisc rsp; | ||
135 | } adisc; | ||
136 | struct { | ||
137 | struct zfcp_fc_gid_pn_req req; | ||
138 | struct zfcp_fc_gid_pn_rsp rsp; | ||
139 | } gid_pn; | ||
140 | struct { | ||
141 | struct scatterlist sg_rsp2[ZFCP_FC_GPN_FT_NUM_BUFS - 1]; | ||
142 | struct zfcp_fc_gpn_ft_req req; | ||
143 | } gpn_ft; | ||
144 | struct { | ||
145 | struct zfcp_fc_gspn_req req; | ||
146 | struct zfcp_fc_gspn_rsp rsp; | ||
147 | } gspn; | ||
148 | struct { | ||
149 | struct zfcp_fc_rspn_req req; | ||
150 | struct fc_ct_hdr rsp; | ||
151 | } rspn; | ||
152 | } u; | ||
139 | }; | 153 | }; |
140 | 154 | ||
141 | /** | 155 | /** |
@@ -192,14 +206,21 @@ struct zfcp_fc_wka_ports { | |||
192 | * zfcp_fc_scsi_to_fcp - setup FCP command with data from scsi_cmnd | 206 | * zfcp_fc_scsi_to_fcp - setup FCP command with data from scsi_cmnd |
193 | * @fcp: fcp_cmnd to setup | 207 | * @fcp: fcp_cmnd to setup |
194 | * @scsi: scsi_cmnd where to get LUN, task attributes/flags and CDB | 208 | * @scsi: scsi_cmnd where to get LUN, task attributes/flags and CDB |
209 | * @tm: task management flags to setup task management command | ||
195 | */ | 210 | */ |
196 | static inline | 211 | static inline |
197 | void zfcp_fc_scsi_to_fcp(struct fcp_cmnd *fcp, struct scsi_cmnd *scsi) | 212 | void zfcp_fc_scsi_to_fcp(struct fcp_cmnd *fcp, struct scsi_cmnd *scsi, |
213 | u8 tm_flags) | ||
198 | { | 214 | { |
199 | char tag[2]; | 215 | char tag[2]; |
200 | 216 | ||
201 | int_to_scsilun(scsi->device->lun, (struct scsi_lun *) &fcp->fc_lun); | 217 | int_to_scsilun(scsi->device->lun, (struct scsi_lun *) &fcp->fc_lun); |
202 | 218 | ||
219 | if (unlikely(tm_flags)) { | ||
220 | fcp->fc_tm_flags = tm_flags; | ||
221 | return; | ||
222 | } | ||
223 | |||
203 | if (scsi_populate_tag_msg(scsi, tag)) { | 224 | if (scsi_populate_tag_msg(scsi, tag)) { |
204 | switch (tag[0]) { | 225 | switch (tag[0]) { |
205 | case MSG_ORDERED_TAG: | 226 | case MSG_ORDERED_TAG: |
@@ -226,19 +247,6 @@ void zfcp_fc_scsi_to_fcp(struct fcp_cmnd *fcp, struct scsi_cmnd *scsi) | |||
226 | } | 247 | } |
227 | 248 | ||
228 | /** | 249 | /** |
229 | * zfcp_fc_fcp_tm - setup FCP command as task management command | ||
230 | * @fcp: fcp_cmnd to setup | ||
231 | * @dev: scsi_device where to send the task management command | ||
232 | * @tm: task management flags to setup tm command | ||
233 | */ | ||
234 | static inline | ||
235 | void zfcp_fc_fcp_tm(struct fcp_cmnd *fcp, struct scsi_device *dev, u8 tm_flags) | ||
236 | { | ||
237 | int_to_scsilun(dev->lun, (struct scsi_lun *) &fcp->fc_lun); | ||
238 | fcp->fc_tm_flags |= tm_flags; | ||
239 | } | ||
240 | |||
241 | /** | ||
242 | * zfcp_fc_evap_fcp_rsp - evaluate FCP RSP IU and update scsi_cmnd accordingly | 250 | * zfcp_fc_evap_fcp_rsp - evaluate FCP RSP IU and update scsi_cmnd accordingly |
243 | * @fcp_rsp: FCP RSP IU to evaluate | 251 | * @fcp_rsp: FCP RSP IU to evaluate |
244 | * @scsi: SCSI command where to update status and sense buffer | 252 | * @scsi: SCSI command where to update status and sense buffer |
@@ -270,7 +278,7 @@ void zfcp_fc_eval_fcp_rsp(struct fcp_resp_with_ext *fcp_rsp, | |||
270 | if (unlikely(rsp_flags & FCP_SNS_LEN_VAL)) { | 278 | if (unlikely(rsp_flags & FCP_SNS_LEN_VAL)) { |
271 | sense = (char *) &fcp_rsp[1]; | 279 | sense = (char *) &fcp_rsp[1]; |
272 | if (rsp_flags & FCP_RSP_LEN_VAL) | 280 | if (rsp_flags & FCP_RSP_LEN_VAL) |
273 | sense += fcp_rsp->ext.fr_sns_len; | 281 | sense += fcp_rsp->ext.fr_rsp_len; |
274 | sense_len = min(fcp_rsp->ext.fr_sns_len, | 282 | sense_len = min(fcp_rsp->ext.fr_sns_len, |
275 | (u32) SCSI_SENSE_BUFFERSIZE); | 283 | (u32) SCSI_SENSE_BUFFERSIZE); |
276 | memcpy(scsi->sense_buffer, sense, sense_len); | 284 | memcpy(scsi->sense_buffer, sense, sense_len); |