Skip to content

Commit

Permalink
[SCSI] qla2xxx: Add support for host port state FC transport attribute.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Andrew Vasquez authored and James Bottomley committed Oct 3, 2006
1 parent 90991c8 commit 7047fcd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/scsi/qla2xxx/qla_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,19 @@ qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
fc_host_fabric_name(shost) = node_name;
}

static void
qla2x00_get_host_port_state(struct Scsi_Host *shost)
{
scsi_qla_host_t *ha = to_qla_host(shost);

if (!ha->flags.online)
fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
else if (atomic_read(&ha->loop_state) == LOOP_TIMEOUT)
fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN;
else
fc_host_port_state(shost) = FC_PORTSTATE_ONLINE;
}

struct fc_function_template qla2xxx_transport_functions = {

.show_host_node_name = 1,
Expand All @@ -897,6 +910,8 @@ struct fc_function_template qla2xxx_transport_functions = {
.show_host_system_hostname = 1,
.get_host_fabric_name = qla2x00_get_host_fabric_name,
.show_host_fabric_name = 1,
.get_host_port_state = qla2x00_get_host_port_state,
.show_host_port_state = 1,

.dd_fcrport_size = sizeof(struct fc_port *),
.show_rport_supported_classes = 1,
Expand Down

0 comments on commit 7047fcd

Please sign in to comment.