[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>

authored by Andrew Vasquez and committed by James Bottomley 7047fcdd 90991c85

+15
+15
drivers/scsi/qla2xxx/qla_attr.c
··· 879 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 895 struct fc_function_template qla2xxx_transport_functions = { 883 896 884 897 .show_host_node_name = 1, ··· 910 897 .show_host_system_hostname = 1, 911 898 .get_host_fabric_name = qla2x00_get_host_fabric_name, 912 899 .show_host_fabric_name = 1, 900 + .get_host_port_state = qla2x00_get_host_port_state, 901 + .show_host_port_state = 1, 913 902 914 903 .dd_fcrport_size = sizeof(struct fc_port *), 915 904 .show_rport_supported_classes = 1,