diff options
author | Seokmann Ju <seokmann.ju@qlogic.com> | 2008-07-10 19:55:47 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-26 15:14:36 -0400 |
commit | 5f3a9a207f1fccde476dd31b4c63ead2967d934f (patch) | |
tree | 2b7baa09df49b681dcb32391d120117ffd711286 /drivers/scsi/qla2xxx/qla_attr.c | |
parent | bbfb21daa320c9eb327d63734f295fa50ba93826 (diff) |
[SCSI] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 8dd88fc1244a..3112518b0e64 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -994,6 +994,33 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) | |||
994 | rport->dev_loss_tmo = ha->port_down_retry_count + 5; | 994 | rport->dev_loss_tmo = ha->port_down_retry_count + 5; |
995 | } | 995 | } |
996 | 996 | ||
997 | static void | ||
998 | qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) | ||
999 | { | ||
1000 | struct Scsi_Host *host = rport_to_shost(rport); | ||
1001 | fc_port_t *fcport = *(fc_port_t **)rport->dd_data; | ||
1002 | |||
1003 | qla2x00_abort_fcport_cmds(fcport); | ||
1004 | |||
1005 | /* | ||
1006 | * Transport has effectively 'deleted' the rport, clear | ||
1007 | * all local references. | ||
1008 | */ | ||
1009 | spin_lock_irq(host->host_lock); | ||
1010 | fcport->rport = NULL; | ||
1011 | *((fc_port_t **)rport->dd_data) = NULL; | ||
1012 | spin_unlock_irq(host->host_lock); | ||
1013 | } | ||
1014 | |||
1015 | static void | ||
1016 | qla2x00_terminate_rport_io(struct fc_rport *rport) | ||
1017 | { | ||
1018 | fc_port_t *fcport = *(fc_port_t **)rport->dd_data; | ||
1019 | |||
1020 | qla2x00_abort_fcport_cmds(fcport); | ||
1021 | scsi_target_unblock(&rport->dev); | ||
1022 | } | ||
1023 | |||
997 | static int | 1024 | static int |
998 | qla2x00_issue_lip(struct Scsi_Host *shost) | 1025 | qla2x00_issue_lip(struct Scsi_Host *shost) |
999 | { | 1026 | { |
@@ -1253,6 +1280,8 @@ struct fc_function_template qla2xxx_transport_functions = { | |||
1253 | .show_rport_dev_loss_tmo = 1, | 1280 | .show_rport_dev_loss_tmo = 1, |
1254 | 1281 | ||
1255 | .issue_fc_host_lip = qla2x00_issue_lip, | 1282 | .issue_fc_host_lip = qla2x00_issue_lip, |
1283 | .dev_loss_tmo_callbk = qla2x00_dev_loss_tmo_callbk, | ||
1284 | .terminate_rport_io = qla2x00_terminate_rport_io, | ||
1256 | .get_fc_host_stats = qla2x00_get_fc_host_stats, | 1285 | .get_fc_host_stats = qla2x00_get_fc_host_stats, |
1257 | 1286 | ||
1258 | .vport_create = qla24xx_vport_create, | 1287 | .vport_create = qla24xx_vport_create, |
@@ -1296,6 +1325,8 @@ struct fc_function_template qla2xxx_transport_vport_functions = { | |||
1296 | .show_rport_dev_loss_tmo = 1, | 1325 | .show_rport_dev_loss_tmo = 1, |
1297 | 1326 | ||
1298 | .issue_fc_host_lip = qla2x00_issue_lip, | 1327 | .issue_fc_host_lip = qla2x00_issue_lip, |
1328 | .dev_loss_tmo_callbk = qla2x00_dev_loss_tmo_callbk, | ||
1329 | .terminate_rport_io = qla2x00_terminate_rport_io, | ||
1299 | .get_fc_host_stats = qla2x00_get_fc_host_stats, | 1330 | .get_fc_host_stats = qla2x00_get_fc_host_stats, |
1300 | }; | 1331 | }; |
1301 | 1332 | ||