diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2006-10-02 15:00:47 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-10-03 18:28:58 -0400 |
commit | 7047fcddb1bc96a80fc54ac3a88ea18ca3ae77f6 (patch) | |
tree | ae7997cd2bea9db58b941bc1079dd32f0df510af /drivers/scsi | |
parent | 90991c85d398fd46b2b07440b5639eb50dfacb2b (diff) |
[SCSI] qla2xxx: Add support for host port state 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')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index d4cf51a8796b..ee75a71f3c66 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -879,6 +879,19 @@ qla2x00_get_host_fabric_name(struct Scsi_Host *shost) | |||
879 | fc_host_fabric_name(shost) = node_name; | 879 | fc_host_fabric_name(shost) = node_name; |
880 | } | 880 | } |
881 | 881 | ||
882 | static void | ||
883 | qla2x00_get_host_port_state(struct Scsi_Host *shost) | ||
884 | { | ||
885 | scsi_qla_host_t *ha = to_qla_host(shost); | ||
886 | |||
887 | if (!ha->flags.online) | ||
888 | fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE; | ||
889 | else if (atomic_read(&ha->loop_state) == LOOP_TIMEOUT) | ||
890 | fc_host_port_state(shost) = FC_PORTSTATE_UNKNOWN; | ||
891 | else | ||
892 | fc_host_port_state(shost) = FC_PORTSTATE_ONLINE; | ||
893 | } | ||
894 | |||
882 | struct fc_function_template qla2xxx_transport_functions = { | 895 | struct fc_function_template qla2xxx_transport_functions = { |
883 | 896 | ||
884 | .show_host_node_name = 1, | 897 | .show_host_node_name = 1, |
@@ -897,6 +910,8 @@ struct fc_function_template qla2xxx_transport_functions = { | |||
897 | .show_host_system_hostname = 1, | 910 | .show_host_system_hostname = 1, |
898 | .get_host_fabric_name = qla2x00_get_host_fabric_name, | 911 | .get_host_fabric_name = qla2x00_get_host_fabric_name, |
899 | .show_host_fabric_name = 1, | 912 | .show_host_fabric_name = 1, |
913 | .get_host_port_state = qla2x00_get_host_port_state, | ||
914 | .show_host_port_state = 1, | ||
900 | 915 | ||
901 | .dd_fcrport_size = sizeof(struct fc_port *), | 916 | .dd_fcrport_size = sizeof(struct fc_port *), |
902 | .show_rport_supported_classes = 1, | 917 | .show_rport_supported_classes = 1, |