aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
author <andrew.vasquez@qlogic.com>2005-04-17 16:06:53 -0400
committerJames Bottomley <jejb@titanic>2005-04-18 14:47:46 -0400
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)
227{ 227{
228 struct Scsi_Host *host = dev_to_shost(starget->dev.parent); 228 struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
229 scsi_qla_host_t *ha = to_qla_host(host); 229 scsi_qla_host_t *ha = to_qla_host(host);
230 os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id); 230 fc_port_t *fcport;
231 uint64_t node_name = 0; 231 uint64_t node_name = 0;
232 232
233 if (tq->fcport) 233 list_for_each_entry(fcport, &ha->fcports, list) {
234 node_name = be64_to_cpu(*(uint64_t *)tq->fcport->node_name); 234 if (starget->id == fcport->os_target_id) {
235 fc_starget_node_name(starget) = node_name; 235 node_name = *(uint64_t *)fcport->node_name;
236 break;
237 }
238 }
239
240 fc_starget_node_name(starget) = be64_to_cpu(node_name);
236} 241}
237 242
238static void 243static void
@@ -240,12 +245,17 @@ qla2x00_get_starget_port_name(struct scsi_target *starget)
240{ 245{
241 struct Scsi_Host *host = dev_to_shost(starget->dev.parent); 246 struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
242 scsi_qla_host_t *ha = to_qla_host(host); 247 scsi_qla_host_t *ha = to_qla_host(host);
243 os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id); 248 fc_port_t *fcport;
244 uint64_t port_name = 0; 249 uint64_t port_name = 0;
245 250
246 if (tq->fcport) 251 list_for_each_entry(fcport, &ha->fcports, list) {
247 port_name = be64_to_cpu(*(uint64_t *)tq->fcport->port_name); 252 if (starget->id == fcport->os_target_id) {
248 fc_starget_port_name(starget) = port_name; 253 port_name = *(uint64_t *)fcport->port_name;
254 break;
255 }
256 }
257
258 fc_starget_port_name(starget) = be64_to_cpu(port_name);
249} 259}
250 260
251static void 261static void
@@ -253,20 +263,25 @@ qla2x00_get_starget_port_id(struct scsi_target *starget)
253{ 263{
254 struct Scsi_Host *host = dev_to_shost(starget->dev.parent); 264 struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
255 scsi_qla_host_t *ha = to_qla_host(host); 265 scsi_qla_host_t *ha = to_qla_host(host);
256 os_tgt_t *tq = (os_tgt_t *) TGT_Q(ha, starget->id); 266 fc_port_t *fcport;
257 uint32_t port_id = 0; 267 uint32_t port_id = ~0U;
268
269 list_for_each_entry(fcport, &ha->fcports, list) {
270 if (starget->id == fcport->os_target_id) {
271 port_id = fcport->d_id.b.domain << 16 |
272 fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
273 break;
274 }
275 }
258 276
259 if (tq->fcport)
260 port_id = tq->fcport->d_id.b.domain << 16 |
261 tq->fcport->d_id.b.area << 8 | tq->fcport->d_id.b.al_pa;
262 fc_starget_port_id(starget) = port_id; 277 fc_starget_port_id(starget) = port_id;
263} 278}
264 279
265static void 280static void
266qla2x00_get_rport_loss_tmo(struct fc_rport *rport) 281qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
267{ 282{
268 os_tgt_t *tq = rport->dd_data; 283 struct Scsi_Host *host = rport_to_shost(rport);
269 scsi_qla_host_t *ha = tq->ha; 284 scsi_qla_host_t *ha = to_qla_host(host);
270 285
271 rport->dev_loss_tmo = ha->port_down_retry_count + 5; 286 rport->dev_loss_tmo = ha->port_down_retry_count + 5;
272} 287}
@@ -274,8 +289,8 @@ qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
274static void 289static void
275qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) 290qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
276{ 291{
277 os_tgt_t *tq = rport->dd_data; 292 struct Scsi_Host *host = rport_to_shost(rport);
278 scsi_qla_host_t *ha = tq->ha; 293 scsi_qla_host_t *ha = to_qla_host(host);
279 294
280 if (timeout) 295 if (timeout)
281 ha->port_down_retry_count = timeout; 296 ha->port_down_retry_count = timeout;
@@ -292,7 +307,7 @@ static struct fc_function_template qla2xxx_transport_functions = {
292 .get_host_port_id = qla2x00_get_host_port_id, 307 .get_host_port_id = qla2x00_get_host_port_id,
293 .show_host_port_id = 1, 308 .show_host_port_id = 1,
294 309
295 .dd_fcrport_size = sizeof(os_tgt_t *), 310 .dd_fcrport_size = sizeof(struct fc_port *),
296 311
297 .get_starget_node_name = qla2x00_get_starget_node_name, 312 .get_starget_node_name = qla2x00_get_starget_node_name,
298 .show_starget_node_name = 1, 313 .show_starget_node_name = 1,