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_init.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_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index bbbc5a632a1d..c7388fadf225 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -1864,12 +1864,11 @@ qla2x00_rport_del(void *data) | |||
1864 | { | 1864 | { |
1865 | fc_port_t *fcport = data; | 1865 | fc_port_t *fcport = data; |
1866 | struct fc_rport *rport; | 1866 | struct fc_rport *rport; |
1867 | unsigned long flags; | ||
1868 | 1867 | ||
1869 | spin_lock_irqsave(&fcport->rport_lock, flags); | 1868 | spin_lock_irq(fcport->ha->host->host_lock); |
1870 | rport = fcport->drport; | 1869 | rport = fcport->drport; |
1871 | fcport->drport = NULL; | 1870 | fcport->drport = NULL; |
1872 | spin_unlock_irqrestore(&fcport->rport_lock, flags); | 1871 | spin_unlock_irq(fcport->ha->host->host_lock); |
1873 | if (rport) | 1872 | if (rport) |
1874 | fc_remote_port_delete(rport); | 1873 | fc_remote_port_delete(rport); |
1875 | } | 1874 | } |
@@ -1898,7 +1897,6 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags) | |||
1898 | atomic_set(&fcport->state, FCS_UNCONFIGURED); | 1897 | atomic_set(&fcport->state, FCS_UNCONFIGURED); |
1899 | fcport->flags = FCF_RLC_SUPPORT; | 1898 | fcport->flags = FCF_RLC_SUPPORT; |
1900 | fcport->supported_classes = FC_COS_UNSPECIFIED; | 1899 | fcport->supported_classes = FC_COS_UNSPECIFIED; |
1901 | spin_lock_init(&fcport->rport_lock); | ||
1902 | 1900 | ||
1903 | return fcport; | 1901 | return fcport; |
1904 | } | 1902 | } |
@@ -2243,28 +2241,24 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
2243 | { | 2241 | { |
2244 | struct fc_rport_identifiers rport_ids; | 2242 | struct fc_rport_identifiers rport_ids; |
2245 | struct fc_rport *rport; | 2243 | struct fc_rport *rport; |
2246 | unsigned long flags; | ||
2247 | 2244 | ||
2248 | if (fcport->drport) | 2245 | if (fcport->drport) |
2249 | qla2x00_rport_del(fcport); | 2246 | qla2x00_rport_del(fcport); |
2250 | if (fcport->rport) | ||
2251 | return; | ||
2252 | 2247 | ||
2253 | rport_ids.node_name = wwn_to_u64(fcport->node_name); | 2248 | rport_ids.node_name = wwn_to_u64(fcport->node_name); |
2254 | rport_ids.port_name = wwn_to_u64(fcport->port_name); | 2249 | rport_ids.port_name = wwn_to_u64(fcport->port_name); |
2255 | rport_ids.port_id = fcport->d_id.b.domain << 16 | | 2250 | rport_ids.port_id = fcport->d_id.b.domain << 16 | |
2256 | fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa; | 2251 | fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa; |
2257 | rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; | 2252 | rport_ids.roles = FC_RPORT_ROLE_UNKNOWN; |
2258 | rport = fc_remote_port_add(ha->host, 0, &rport_ids); | 2253 | fcport->rport = rport = fc_remote_port_add(ha->host, 0, &rport_ids); |
2259 | if (!rport) { | 2254 | if (!rport) { |
2260 | qla_printk(KERN_WARNING, ha, | 2255 | qla_printk(KERN_WARNING, ha, |
2261 | "Unable to allocate fc remote port!\n"); | 2256 | "Unable to allocate fc remote port!\n"); |
2262 | return; | 2257 | return; |
2263 | } | 2258 | } |
2264 | spin_lock_irqsave(&fcport->rport_lock, flags); | 2259 | spin_lock_irq(fcport->ha->host->host_lock); |
2265 | fcport->rport = rport; | ||
2266 | *((fc_port_t **)rport->dd_data) = fcport; | 2260 | *((fc_port_t **)rport->dd_data) = fcport; |
2267 | spin_unlock_irqrestore(&fcport->rport_lock, flags); | 2261 | spin_unlock_irq(fcport->ha->host->host_lock); |
2268 | 2262 | ||
2269 | rport->supported_classes = fcport->supported_classes; | 2263 | rport->supported_classes = fcport->supported_classes; |
2270 | 2264 | ||