From e4ac05061f728de00669b0b511849c833251a427 Mon Sep 17 00:00:00 2001 From: "andrew.vasquez@qlogic.com" Date: Tue, 31 Jan 2006 16:04:56 -0800 Subject: [PATCH] --- yaml --- r: 20366 b: refs/heads/master c: 8d067623adf119081b7a2683cdc6ee90eb8a70b2 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/scsi/qla2xxx/qla_attr.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ce117bfc8769..7b635aee8787 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 04414013bbda644b65537e73f1dacb2821b36811 +refs/heads/master: 8d067623adf119081b7a2683cdc6ee90eb8a70b2 diff --git a/trunk/drivers/scsi/qla2xxx/qla_attr.c b/trunk/drivers/scsi/qla2xxx/qla_attr.c index e03140fec179..55016328bd78 100644 --- a/trunk/drivers/scsi/qla2xxx/qla_attr.c +++ b/trunk/drivers/scsi/qla2xxx/qla_attr.c @@ -445,6 +445,29 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) 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 qla2x00_get_starget_node_name(struct scsi_target *starget) { @@ -542,6 +565,8 @@ struct fc_function_template qla2xxx_transport_functions = { .show_host_port_id = 1, .get_host_speed = qla2x00_get_host_speed, .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 *), .show_rport_supported_classes = 1,