提交 7047fcdd 编写于 作者: A Andrew Vasquez 提交者: James Bottomley

[SCSI] qla2xxx: Add support for host port state FC transport attribute.

Signed-off-by: NAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 90991c85
...@@ -879,6 +879,19 @@ qla2x00_get_host_fabric_name(struct Scsi_Host *shost) ...@@ -879,6 +879,19 @@ qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
fc_host_fabric_name(shost) = node_name; 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 = { struct fc_function_template qla2xxx_transport_functions = {
.show_host_node_name = 1, .show_host_node_name = 1,
...@@ -897,6 +910,8 @@ struct fc_function_template qla2xxx_transport_functions = { ...@@ -897,6 +910,8 @@ struct fc_function_template qla2xxx_transport_functions = {
.show_host_system_hostname = 1, .show_host_system_hostname = 1,
.get_host_fabric_name = qla2x00_get_host_fabric_name, .get_host_fabric_name = qla2x00_get_host_fabric_name,
.show_host_fabric_name = 1, .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 *), .dd_fcrport_size = sizeof(struct fc_port *),
.show_rport_supported_classes = 1, .show_rport_supported_classes = 1,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册