aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
authorandrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com>2006-01-31 16:04:51 -0800
committer <jejb@mulgrave.il.steeleye.com>2006-02-04 16:10:07 -0600
commit04414013bbda644b65537e73f1dacb2821b36811 (patch)
treed8859176c167bff43bfb929657a32da3bb814749 /drivers/scsi/qla2xxx/qla_attr.c
parent53ea68ecea11bcbb3451c2758ce181bd97b569a9 (diff)
downloadkernel_samsung_espresso10-04414013bbda644b65537e73f1dacb2821b36811.zip
kernel_samsung_espresso10-04414013bbda644b65537e73f1dacb2821b36811.tar.gz
kernel_samsung_espresso10-04414013bbda644b65537e73f1dacb2821b36811.tar.bz2
[SCSI] qla2xxx: Add port-speed 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/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index b17ee62..e03140f 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -426,6 +426,26 @@ qla2x00_get_host_port_id(struct Scsi_Host *shost)
}
static void
+qla2x00_get_host_speed(struct Scsi_Host *shost)
+{
+ scsi_qla_host_t *ha = to_qla_host(shost);
+ uint32_t speed = 0;
+
+ switch (ha->link_data_rate) {
+ case LDR_1GB:
+ speed = 1;
+ break;
+ case LDR_2GB:
+ speed = 2;
+ break;
+ case LDR_4GB:
+ speed = 4;
+ break;
+ }
+ fc_host_speed(shost) = speed;
+}
+
+static void
qla2x00_get_starget_node_name(struct scsi_target *starget)
{
struct Scsi_Host *host = dev_to_shost(starget->dev.parent);
@@ -520,6 +540,8 @@ struct fc_function_template qla2xxx_transport_functions = {
.get_host_port_id = qla2x00_get_host_port_id,
.show_host_port_id = 1,
+ .get_host_speed = qla2x00_get_host_speed,
+ .show_host_speed = 1,
.dd_fcrport_size = sizeof(struct fc_port *),
.show_rport_supported_classes = 1,