aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2011-02-22 13:54:45 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-25 12:02:14 -0500
commit2443c8b23aea83d529868030e28f45a6fa6553b2 (patch)
treede381ef06c4ed3685b8fe843a16edb997affeadf /drivers/s390
parent259afe2ed92c179e0a85da10ca63bf927b9851ca (diff)
[SCSI] zfcp: Merge FCP task management setup with regular FCP command setup
For task management commands, only LUN and flags are required. The regular FCP setup already sets the LUN in the fcp_cmnd. All is required for merging the function is setting up the TM flags. Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_fc.h22
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c4
2 files changed, 10 insertions, 16 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.h b/drivers/s390/scsi/zfcp_fc.h
index 2066f9d9ceb5..5243ce44aa42 100644
--- a/drivers/s390/scsi/zfcp_fc.h
+++ b/drivers/s390/scsi/zfcp_fc.h
@@ -164,14 +164,21 @@ struct zfcp_fc_wka_ports {
164 * zfcp_fc_scsi_to_fcp - setup FCP command with data from scsi_cmnd 164 * zfcp_fc_scsi_to_fcp - setup FCP command with data from scsi_cmnd
165 * @fcp: fcp_cmnd to setup 165 * @fcp: fcp_cmnd to setup
166 * @scsi: scsi_cmnd where to get LUN, task attributes/flags and CDB 166 * @scsi: scsi_cmnd where to get LUN, task attributes/flags and CDB
167 * @tm: task management flags to setup task management command
167 */ 168 */
168static inline 169static inline
169void zfcp_fc_scsi_to_fcp(struct fcp_cmnd *fcp, struct scsi_cmnd *scsi) 170void zfcp_fc_scsi_to_fcp(struct fcp_cmnd *fcp, struct scsi_cmnd *scsi,
171 u8 tm_flags)
170{ 172{
171 char tag[2]; 173 char tag[2];
172 174
173 int_to_scsilun(scsi->device->lun, (struct scsi_lun *) &fcp->fc_lun); 175 int_to_scsilun(scsi->device->lun, (struct scsi_lun *) &fcp->fc_lun);
174 176
177 if (unlikely(tm_flags)) {
178 fcp->fc_tm_flags = tm_flags;
179 return;
180 }
181
175 if (scsi_populate_tag_msg(scsi, tag)) { 182 if (scsi_populate_tag_msg(scsi, tag)) {
176 switch (tag[0]) { 183 switch (tag[0]) {
177 case MSG_ORDERED_TAG: 184 case MSG_ORDERED_TAG:
@@ -198,19 +205,6 @@ void zfcp_fc_scsi_to_fcp(struct fcp_cmnd *fcp, struct scsi_cmnd *scsi)
198} 205}
199 206
200/** 207/**
201 * zfcp_fc_fcp_tm - setup FCP command as task management command
202 * @fcp: fcp_cmnd to setup
203 * @dev: scsi_device where to send the task management command
204 * @tm: task management flags to setup tm command
205 */
206static inline
207void zfcp_fc_fcp_tm(struct fcp_cmnd *fcp, struct scsi_device *dev, u8 tm_flags)
208{
209 int_to_scsilun(dev->lun, (struct scsi_lun *) &fcp->fc_lun);
210 fcp->fc_tm_flags |= tm_flags;
211}
212
213/**
214 * zfcp_fc_evap_fcp_rsp - evaluate FCP RSP IU and update scsi_cmnd accordingly 208 * zfcp_fc_evap_fcp_rsp - evaluate FCP RSP IU and update scsi_cmnd accordingly
215 * @fcp_rsp: FCP RSP IU to evaluate 209 * @fcp_rsp: FCP RSP IU to evaluate
216 * @scsi: SCSI command where to update status and sense buffer 210 * @scsi: SCSI command where to update status and sense buffer
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 43ee0288c0e9..a0e05ef65924 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -2210,7 +2210,7 @@ int zfcp_fsf_fcp_cmnd(struct scsi_cmnd *scsi_cmnd)
2210 zfcp_fsf_set_data_dir(scsi_cmnd, &io->data_direction); 2210 zfcp_fsf_set_data_dir(scsi_cmnd, &io->data_direction);
2211 2211
2212 fcp_cmnd = (struct fcp_cmnd *) &req->qtcb->bottom.io.fcp_cmnd; 2212 fcp_cmnd = (struct fcp_cmnd *) &req->qtcb->bottom.io.fcp_cmnd;
2213 zfcp_fc_scsi_to_fcp(fcp_cmnd, scsi_cmnd); 2213 zfcp_fc_scsi_to_fcp(fcp_cmnd, scsi_cmnd, 0);
2214 2214
2215 if (scsi_prot_sg_count(scsi_cmnd)) { 2215 if (scsi_prot_sg_count(scsi_cmnd)) {
2216 zfcp_qdio_set_data_div(qdio, &req->qdio_req, 2216 zfcp_qdio_set_data_div(qdio, &req->qdio_req,
@@ -2299,7 +2299,7 @@ struct zfcp_fsf_req *zfcp_fsf_fcp_task_mgmt(struct scsi_cmnd *scmnd,
2299 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); 2299 zfcp_qdio_set_sbale_last(qdio, &req->qdio_req);
2300 2300
2301 fcp_cmnd = (struct fcp_cmnd *) &req->qtcb->bottom.io.fcp_cmnd; 2301 fcp_cmnd = (struct fcp_cmnd *) &req->qtcb->bottom.io.fcp_cmnd;
2302 zfcp_fc_fcp_tm(fcp_cmnd, scmnd->device, tm_flags); 2302 zfcp_fc_scsi_to_fcp(fcp_cmnd, scmnd, tm_flags);
2303 2303
2304 zfcp_fsf_start_timer(req, ZFCP_SCSI_ER_TIMEOUT); 2304 zfcp_fsf_start_timer(req, ZFCP_SCSI_ER_TIMEOUT);
2305 if (!zfcp_fsf_req_send(req)) 2305 if (!zfcp_fsf_req_send(req))