diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2008-04-03 16:13:16 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:19:13 -0400 |
commit | 5ab5a4dd5444db0715b5748bab916725138d3a32 (patch) | |
tree | 0e1b6d389332506fa3848c259bc70e94b1b4bc66 /drivers/scsi/qla2xxx | |
parent | 0ddda2d1529f2d01d3b043782d2efcf0499fc3db (diff) |
[SCSI] qla2xxx: Use an rport's scsi_target_id member consistently throughout driver.
Rather than using a duplicate/cached value stored in the driver's
internal fcport structure.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 9 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 4 |
3 files changed, 6 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index aee03221ed6e..798cc613c44a 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -900,7 +900,8 @@ qla2x00_get_starget_node_name(struct scsi_target *starget) | |||
900 | u64 node_name = 0; | 900 | u64 node_name = 0; |
901 | 901 | ||
902 | list_for_each_entry(fcport, &ha->fcports, list) { | 902 | list_for_each_entry(fcport, &ha->fcports, list) { |
903 | if (starget->id == fcport->os_target_id) { | 903 | if (fcport->rport && |
904 | starget->id == fcport->rport->scsi_target_id) { | ||
904 | node_name = wwn_to_u64(fcport->node_name); | 905 | node_name = wwn_to_u64(fcport->node_name); |
905 | break; | 906 | break; |
906 | } | 907 | } |
@@ -918,7 +919,8 @@ qla2x00_get_starget_port_name(struct scsi_target *starget) | |||
918 | u64 port_name = 0; | 919 | u64 port_name = 0; |
919 | 920 | ||
920 | list_for_each_entry(fcport, &ha->fcports, list) { | 921 | list_for_each_entry(fcport, &ha->fcports, list) { |
921 | if (starget->id == fcport->os_target_id) { | 922 | if (fcport->rport && |
923 | starget->id == fcport->rport->scsi_target_id) { | ||
922 | port_name = wwn_to_u64(fcport->port_name); | 924 | port_name = wwn_to_u64(fcport->port_name); |
923 | break; | 925 | break; |
924 | } | 926 | } |
@@ -936,7 +938,8 @@ qla2x00_get_starget_port_id(struct scsi_target *starget) | |||
936 | uint32_t port_id = ~0U; | 938 | uint32_t port_id = ~0U; |
937 | 939 | ||
938 | list_for_each_entry(fcport, &ha->fcports, list) { | 940 | list_for_each_entry(fcport, &ha->fcports, list) { |
939 | if (starget->id == fcport->os_target_id) { | 941 | if (fcport->rport && |
942 | starget->id == fcport->rport->scsi_target_id) { | ||
940 | port_id = fcport->d_id.b.domain << 16 | | 943 | port_id = fcport->d_id.b.domain << 16 | |
941 | fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa; | 944 | fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa; |
942 | break; | 945 | break; |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index aa9d2163cdf2..f70c78b6f364 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -1542,8 +1542,6 @@ typedef struct fc_port { | |||
1542 | atomic_t state; | 1542 | atomic_t state; |
1543 | uint32_t flags; | 1543 | uint32_t flags; |
1544 | 1544 | ||
1545 | unsigned int os_target_id; | ||
1546 | |||
1547 | int port_login_retry_count; | 1545 | int port_login_retry_count; |
1548 | int login_retry; | 1546 | int login_retry; |
1549 | atomic_t port_down_timer; | 1547 | atomic_t port_down_timer; |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 9b7ad590eb01..e773697cd8d5 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -2251,10 +2251,6 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
2251 | if (fcport->port_type == FCT_TARGET) | 2251 | if (fcport->port_type == FCT_TARGET) |
2252 | rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET; | 2252 | rport_ids.roles |= FC_RPORT_ROLE_FCP_TARGET; |
2253 | fc_remote_port_rolechg(rport, rport_ids.roles); | 2253 | fc_remote_port_rolechg(rport, rport_ids.roles); |
2254 | |||
2255 | if (rport->scsi_target_id != -1 && | ||
2256 | rport->scsi_target_id < ha->host->max_id) | ||
2257 | fcport->os_target_id = rport->scsi_target_id; | ||
2258 | } | 2254 | } |
2259 | 2255 | ||
2260 | /* | 2256 | /* |