aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fnic
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2009-10-30 12:59:29 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:00:52 -0500
commit65d430fa99cbd0e88d09a3343f697c51fc8a7009 (patch)
treed0e7f7353bb227ff7585ff77cc682611acd1680b /drivers/scsi/fnic
parent03b147083a2f9a2a3fbbd2505fa88ffa3c6ab194 (diff)
[SCSI] scsi_transport_fc: Introduce helper function for blocking scsi_eh
Move the duplicated code from FC LLDs to SCSI FC transport class. Acked-by: James Smart <james.smart@emulex.com> Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Acked-by: Abhijeet Joglekar <abjoglek@cisco.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fnic')
-rw-r--r--drivers/scsi/fnic/fnic_scsi.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index b5d17385939b..8d26d7a9f01b 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -1225,22 +1225,6 @@ void fnic_terminate_rport_io(struct fc_rport *rport)
1225 1225
1226} 1226}
1227 1227
1228static void fnic_block_error_handler(struct scsi_cmnd *sc)
1229{
1230 struct Scsi_Host *shost = sc->device->host;
1231 struct fc_rport *rport = starget_to_rport(scsi_target(sc->device));
1232 unsigned long flags;
1233
1234 spin_lock_irqsave(shost->host_lock, flags);
1235 while (rport->port_state == FC_PORTSTATE_BLOCKED) {
1236 spin_unlock_irqrestore(shost->host_lock, flags);
1237 msleep(1000);
1238 spin_lock_irqsave(shost->host_lock, flags);
1239 }
1240 spin_unlock_irqrestore(shost->host_lock, flags);
1241
1242}
1243
1244/* 1228/*
1245 * This function is exported to SCSI for sending abort cmnds. 1229 * This function is exported to SCSI for sending abort cmnds.
1246 * A SCSI IO is represented by a io_req in the driver. 1230 * A SCSI IO is represented by a io_req in the driver.
@@ -1260,7 +1244,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
1260 DECLARE_COMPLETION_ONSTACK(tm_done); 1244 DECLARE_COMPLETION_ONSTACK(tm_done);
1261 1245
1262 /* Wait for rport to unblock */ 1246 /* Wait for rport to unblock */
1263 fnic_block_error_handler(sc); 1247 fc_block_scsi_eh(sc);
1264 1248
1265 /* Get local-port, check ready and link up */ 1249 /* Get local-port, check ready and link up */
1266 lp = shost_priv(sc->device->host); 1250 lp = shost_priv(sc->device->host);
@@ -1542,7 +1526,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)
1542 DECLARE_COMPLETION_ONSTACK(tm_done); 1526 DECLARE_COMPLETION_ONSTACK(tm_done);
1543 1527
1544 /* Wait for rport to unblock */ 1528 /* Wait for rport to unblock */
1545 fnic_block_error_handler(sc); 1529 fc_block_scsi_eh(sc);
1546 1530
1547 /* Get local-port, check ready and link up */ 1531 /* Get local-port, check ready and link up */
1548 lp = shost_priv(sc->device->host); 1532 lp = shost_priv(sc->device->host);