diff options
author | andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> | 2006-01-31 19:04:56 -0500 |
---|---|---|
committer | <jejb@mulgrave.il.steeleye.com> | 2006-02-04 17:10:28 -0500 |
commit | 8d067623adf119081b7a2683cdc6ee90eb8a70b2 (patch) | |
tree | aa08e89b8cff1524ebc348fc0132afa1f74763a1 /drivers/scsi/qla2xxx/qla_attr.c | |
parent | 04414013bbda644b65537e73f1dacb2821b36811 (diff) |
[SCSI] qla2xxx: Add host port-type FC transport attribute.
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.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index e03140fec179..55016328bd78 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -446,6 +446,29 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) | |||
446 | } | 446 | } |
447 | 447 | ||
448 | static void | 448 | static void |
449 | qla2x00_get_host_port_type(struct Scsi_Host *shost) | ||
450 | { | ||
451 | scsi_qla_host_t *ha = to_qla_host(shost); | ||
452 | uint32_t port_type = FC_PORTTYPE_UNKNOWN; | ||
453 | |||
454 | switch (ha->current_topology) { | ||
455 | case ISP_CFG_NL: | ||
456 | port_type = FC_PORTTYPE_LPORT; | ||
457 | break; | ||
458 | case ISP_CFG_FL: | ||
459 | port_type = FC_PORTTYPE_NLPORT; | ||
460 | break; | ||
461 | case ISP_CFG_N: | ||
462 | port_type = FC_PORTTYPE_PTP; | ||
463 | break; | ||
464 | case ISP_CFG_F: | ||
465 | port_type = FC_PORTTYPE_NPORT; | ||
466 | break; | ||
467 | } | ||
468 | fc_host_port_type(shost) = port_type; | ||
469 | } | ||
470 | |||
471 | static void | ||
449 | qla2x00_get_starget_node_name(struct scsi_target *starget) | 472 | qla2x00_get_starget_node_name(struct scsi_target *starget) |
450 | { | 473 | { |
451 | struct Scsi_Host *host = dev_to_shost(starget->dev.parent); | 474 | struct Scsi_Host *host = dev_to_shost(starget->dev.parent); |
@@ -542,6 +565,8 @@ struct fc_function_template qla2xxx_transport_functions = { | |||
542 | .show_host_port_id = 1, | 565 | .show_host_port_id = 1, |
543 | .get_host_speed = qla2x00_get_host_speed, | 566 | .get_host_speed = qla2x00_get_host_speed, |
544 | .show_host_speed = 1, | 567 | .show_host_speed = 1, |
568 | .get_host_port_type = qla2x00_get_host_port_type, | ||
569 | .show_host_port_type = 1, | ||
545 | 570 | ||
546 | .dd_fcrport_size = sizeof(struct fc_port *), | 571 | .dd_fcrport_size = sizeof(struct fc_port *), |
547 | .show_rport_supported_classes = 1, | 572 | .show_rport_supported_classes = 1, |