aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_scsi.c
diff options
context:
space:
mode:
authorAndreas Herrmann <aherrman@de.ibm.com>2006-09-18 16:29:56 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-09-23 19:01:23 -0400
commit2abbe866c8eb0296e3f5343bcf73e5371522a738 (patch)
treec839b12b43d07d538e32bcabec1fefa2106f384f /drivers/s390/scsi/zfcp_scsi.c
parent4eff4a36516d72e4f6ede901141214a7e05607e7 (diff)
[SCSI] zfcp: introduce struct timer_list in struct zfcp_fsf_req
This instance will be used whenever a timer is needed for a request by zfcp. Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 043ed7c0a7ed..753bb9b2fe74 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -231,7 +231,7 @@ zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result)
231 */ 231 */
232int 232int
233zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit, 233zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit,
234 struct scsi_cmnd *scpnt, struct timer_list *timer) 234 struct scsi_cmnd *scpnt, int use_timer)
235{ 235{
236 int tmp; 236 int tmp;
237 int retval; 237 int retval;
@@ -267,7 +267,7 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit,
267 goto out; 267 goto out;
268 } 268 }
269 269
270 tmp = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, timer, 270 tmp = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, use_timer,
271 ZFCP_REQ_AUTO_CLEANUP); 271 ZFCP_REQ_AUTO_CLEANUP);
272 272
273 if (unlikely(tmp < 0)) { 273 if (unlikely(tmp < 0)) {
@@ -291,21 +291,22 @@ zfcp_scsi_command_sync_handler(struct scsi_cmnd *scpnt)
291 * zfcp_scsi_command_sync - send a SCSI command and wait for completion 291 * zfcp_scsi_command_sync - send a SCSI command and wait for completion
292 * @unit: unit where command is sent to 292 * @unit: unit where command is sent to
293 * @scpnt: scsi command to be sent 293 * @scpnt: scsi command to be sent
294 * @timer: timer to be started if request is successfully initiated 294 * @use_timer: indicates whether timer should be setup or not
295 * Return: 0 295 * Return: 0
296 * 296 *
297 * Errors are indicated in scpnt->result 297 * Errors are indicated in scpnt->result
298 */ 298 */
299int 299int
300zfcp_scsi_command_sync(struct zfcp_unit *unit, struct scsi_cmnd *scpnt, 300zfcp_scsi_command_sync(struct zfcp_unit *unit, struct scsi_cmnd *scpnt,
301 struct timer_list *timer) 301 int use_timer)
302{ 302{
303 int ret; 303 int ret;
304 DECLARE_COMPLETION(wait); 304 DECLARE_COMPLETION(wait);
305 305
306 scpnt->SCp.ptr = (void *) &wait; /* silent re-use */ 306 scpnt->SCp.ptr = (void *) &wait; /* silent re-use */
307 scpnt->scsi_done = zfcp_scsi_command_sync_handler; 307 scpnt->scsi_done = zfcp_scsi_command_sync_handler;
308 ret = zfcp_scsi_command_async(unit->port->adapter, unit, scpnt, timer); 308 ret = zfcp_scsi_command_async(unit->port->adapter, unit, scpnt,
309 use_timer);
309 if (ret == 0) 310 if (ret == 0)
310 wait_for_completion(&wait); 311 wait_for_completion(&wait);
311 312
@@ -341,7 +342,7 @@ zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt,
341 adapter = (struct zfcp_adapter *) scpnt->device->host->hostdata[0]; 342 adapter = (struct zfcp_adapter *) scpnt->device->host->hostdata[0];
342 unit = (struct zfcp_unit *) scpnt->device->hostdata; 343 unit = (struct zfcp_unit *) scpnt->device->hostdata;
343 344
344 return zfcp_scsi_command_async(adapter, unit, scpnt, NULL); 345 return zfcp_scsi_command_async(adapter, unit, scpnt, 0);
345} 346}
346 347
347static struct zfcp_unit * 348static struct zfcp_unit *
@@ -538,8 +539,6 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags,
538 539
539/** 540/**
540 * zfcp_scsi_eh_host_reset_handler - handler for host and bus reset 541 * zfcp_scsi_eh_host_reset_handler - handler for host and bus reset
541 *
542 * If ERP is already running it will be stopped.
543 */ 542 */
544int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) 543int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
545{ 544{
@@ -638,16 +637,6 @@ zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter)
638 return; 637 return;
639} 638}
640 639
641
642void
643zfcp_fsf_start_scsi_er_timer(struct zfcp_adapter *adapter)
644{
645 adapter->scsi_er_timer.function = zfcp_fsf_scsi_er_timeout_handler;
646 adapter->scsi_er_timer.data = (unsigned long) adapter;
647 adapter->scsi_er_timer.expires = jiffies + ZFCP_SCSI_ER_TIMEOUT;
648 add_timer(&adapter->scsi_er_timer);
649}
650
651/* 640/*
652 * Support functions for FC transport class 641 * Support functions for FC transport class
653 */ 642 */