Commit 8d067623 authored by andrew.vasquez@qlogic.com's avatar andrew.vasquez@qlogic.com Committed by

[SCSI] qla2xxx: Add host port-type FC transport attribute.

Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 04414013
...@@ -445,6 +445,29 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) ...@@ -445,6 +445,29 @@ qla2x00_get_host_speed(struct Scsi_Host *shost)
fc_host_speed(shost) = speed; fc_host_speed(shost) = speed;
} }
static void
qla2x00_get_host_port_type(struct Scsi_Host *shost)
{
scsi_qla_host_t *ha = to_qla_host(shost);
uint32_t port_type = FC_PORTTYPE_UNKNOWN;
switch (ha->current_topology) {
case ISP_CFG_NL:
port_type = FC_PORTTYPE_LPORT;
break;
case ISP_CFG_FL:
port_type = FC_PORTTYPE_NLPORT;
break;
case ISP_CFG_N:
port_type = FC_PORTTYPE_PTP;
break;
case ISP_CFG_F:
port_type = FC_PORTTYPE_NPORT;
break;
}
fc_host_port_type(shost) = port_type;
}
static void static void
qla2x00_get_starget_node_name(struct scsi_target *starget) qla2x00_get_starget_node_name(struct scsi_target *starget)
{ {
...@@ -542,6 +565,8 @@ struct fc_function_template qla2xxx_transport_functions = { ...@@ -542,6 +565,8 @@ struct fc_function_template qla2xxx_transport_functions = {
.show_host_port_id = 1, .show_host_port_id = 1,
.get_host_speed = qla2x00_get_host_speed, .get_host_speed = qla2x00_get_host_speed,
.show_host_speed = 1, .show_host_speed = 1,
.get_host_port_type = qla2x00_get_host_port_type,
.show_host_port_type = 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment