summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
author <andrew.vasquez@qlogic.com>2005-04-17 15:06:53 -0500
committerJames Bottomley <jejb@titanic>2005-04-18 13:47:46 -0500
commitbdf796210e01145fd77bbb3ae644d04f982b6c3b (patch)
tree92253748a63c51e76a70384d35119e107077b050 /drivers/scsi/qla2xxx/qla_attr.c
parent8482e118afa0cb4321ab3d30b1100d27d63130c0 (diff)
[PATCH] qla2xxx: remove lun discovery codes...
Remove internal lun discovery routines and support structures. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c51
1 files changed, 33 insertions, 18 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 0105b609ff3a..56770fac4d14 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -227,12 +227,17 @@ qla2x00_get_starget_node_name(struct scsi_target *starget)
{
struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
scsi_qla_host_t *ha = to_qla_host(host);
- os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id);
+ fc_port_t *fcport;
uint64_t node_name = 0;
- if (tq->fcport)
- node_name = be64_to_cpu(*(uint64_t *)tq->fcport->node_name);
- fc_starget_node_name(starget) = node_name;
+ list_for_each_entry(fcport, &ha->fcports, list) {
+ if (starget->id == fcport->os_target_id) {
+ node_name = *(uint64_t *)fcport->node_name;
+ break;
+ }
+ }
+
+ fc_starget_node_name(starget) = be64_to_cpu(node_name);
}
static void
@@ -240,12 +245,17 @@ qla2x00_get_starget_port_name(struct scsi_target *starget)
{
struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
scsi_qla_host_t *ha = to_qla_host(host);
- os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id);
+ fc_port_t *fcport;
uint64_t port_name = 0;
- if (tq->fcport)
- port_name = be64_to_cpu(*(uint64_t *)tq->fcport->port_name);
- fc_starget_port_name(starget) = port_name;
+ list_for_each_entry(fcport, &ha->fcports, list) {
+ if (starget->id == fcport->os_target_id) {
+ port_name = *(uint64_t *)fcport->port_name;
+ break;
+ }
+ }
+
+ fc_starget_port_name(starget) = be64_to_cpu(port_name);
}
static void
@@ -253,20 +263,25 @@ qla2x00_get_starget_port_id(struct scsi_target *starget)
{
struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
scsi_qla_host_t *ha = to_qla_host(host);
- os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id);
- uint32_t port_id = 0;
+ fc_port_t *fcport;
+ uint32_t port_id = ~0U;
+
+ list_for_each_entry(fcport, &ha->fcports, list) {
+ if (starget->id == fcport->os_target_id) {
+ port_id = fcport->d_id.b.domain << 16 |
+ fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
+ break;
+ }
+ }
- if (tq->fcport)
- port_id = tq->fcport->d_id.b.domain << 16 |
- tq->fcport->d_id.b.area << 8 | tq->fcport->d_id.b.al_pa;
fc_starget_port_id(starget) = port_id;
}
static void
qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
{
- os_tgt_t *tq = rport->dd_data;
- scsi_qla_host_t *ha = tq->ha;
+ struct Scsi_Host *host = rport_to_shost(rport);
+ scsi_qla_host_t *ha = to_qla_host(host);
rport->dev_loss_tmo = ha->port_down_retry_count + 5;
}
@@ -274,8 +289,8 @@ qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
static void
qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
{
- os_tgt_t *tq = rport->dd_data;
- scsi_qla_host_t *ha = tq->ha;
+ struct Scsi_Host *host = rport_to_shost(rport);
+ scsi_qla_host_t *ha = to_qla_host(host);
if (timeout)
ha->port_down_retry_count = timeout;
@@ -292,7 +307,7 @@ static struct fc_function_template qla2xxx_transport_functions = {
.get_host_port_id = qla2x00_get_host_port_id,
.show_host_port_id = 1,
- .dd_fcrport_size = sizeof(os_tgt_t *),
+ .dd_fcrport_size = sizeof(struct fc_port *),
.get_starget_node_name = qla2x00_get_starget_node_name,
.show_starget_node_name = 1,