aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index aeae56b00b45..ca8f85f3dad4 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -21,20 +21,6 @@ char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu)
21 return fcp_sns_info_ptr; 21 return fcp_sns_info_ptr;
22} 22}
23 23
24void zfcp_set_fcp_dl(struct fcp_cmnd_iu *fcp_cmd, fcp_dl_t fcp_dl)
25{
26 fcp_dl_t *fcp_dl_ptr;
27
28 /*
29 * fcp_dl_addr = start address of fcp_cmnd structure +
30 * size of fixed part + size of dynamically sized add_dcp_cdb field
31 * SEE FCP-2 documentation
32 */
33 fcp_dl_ptr = (fcp_dl_t *) ((unsigned char *) &fcp_cmd[1] +
34 (fcp_cmd->add_fcp_cdb_length << 2));
35 *fcp_dl_ptr = fcp_dl;
36}
37
38static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) 24static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
39{ 25{
40 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; 26 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
@@ -119,13 +105,17 @@ static struct zfcp_unit *zfcp_unit_lookup(struct zfcp_adapter *adapter,
119{ 105{
120 struct zfcp_port *port; 106 struct zfcp_port *port;
121 struct zfcp_unit *unit; 107 struct zfcp_unit *unit;
108 int scsi_lun;
122 109
123 list_for_each_entry(port, &adapter->port_list_head, list) { 110 list_for_each_entry(port, &adapter->port_list_head, list) {
124 if (!port->rport || (id != port->rport->scsi_target_id)) 111 if (!port->rport || (id != port->rport->scsi_target_id))
125 continue; 112 continue;
126 list_for_each_entry(unit, &port->unit_list_head, list) 113 list_for_each_entry(unit, &port->unit_list_head, list) {
127 if (lun == unit->scsi_lun) 114 scsi_lun = scsilun_to_int(
115 (struct scsi_lun *)&unit->fcp_lun);
116 if (lun == scsi_lun)
128 return unit; 117 return unit;
118 }
129 } 119 }
130 120
131 return NULL; 121 return NULL;
@@ -183,7 +173,6 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
183 return retval; 173 return retval;
184 } 174 }
185 fsf_req->data = NULL; 175 fsf_req->data = NULL;
186 fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTING;
187 176
188 /* don't access old fsf_req after releasing the abort_lock */ 177 /* don't access old fsf_req after releasing the abort_lock */
189 write_unlock_irqrestore(&adapter->abort_lock, flags); 178 write_unlock_irqrestore(&adapter->abort_lock, flags);
@@ -294,7 +283,8 @@ int zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
294 sizeof (struct zfcp_adapter *)); 283 sizeof (struct zfcp_adapter *));
295 if (!adapter->scsi_host) { 284 if (!adapter->scsi_host) {
296 dev_err(&adapter->ccw_device->dev, 285 dev_err(&adapter->ccw_device->dev,
297 "registration with SCSI stack failed."); 286 "Registering the FCP device with the "
287 "SCSI stack failed\n");
298 return -EIO; 288 return -EIO;
299 } 289 }
300 290
@@ -312,7 +302,6 @@ int zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
312 scsi_host_put(adapter->scsi_host); 302 scsi_host_put(adapter->scsi_host);
313 return -EIO; 303 return -EIO;
314 } 304 }
315 atomic_set_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status);
316 305
317 return 0; 306 return 0;
318} 307}
@@ -336,7 +325,6 @@ void zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter)
336 scsi_remove_host(shost); 325 scsi_remove_host(shost);
337 scsi_host_put(shost); 326 scsi_host_put(shost);
338 adapter->scsi_host = NULL; 327 adapter->scsi_host = NULL;
339 atomic_clear_mask(ZFCP_STATUS_ADAPTER_REGISTERED, &adapter->status);
340 328
341 return; 329 return;
342} 330}