diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index b17ee62dd1a9..e03140fec179 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) | |||
426 | } | 426 | } |
427 | 427 | ||
428 | static void | 428 | static void |
429 | qla2x00_get_host_speed(struct Scsi_Host *shost) | ||
430 | { | ||
431 | scsi_qla_host_t *ha = to_qla_host(shost); | ||
432 | uint32_t speed = 0; | ||
433 | |||
434 | switch (ha->link_data_rate) { | ||
435 | case LDR_1GB: | ||
436 | speed = 1; | ||
437 | break; | ||
438 | case LDR_2GB: | ||
439 | speed = 2; | ||
440 | break; | ||
441 | case LDR_4GB: | ||
442 | speed = 4; | ||
443 | break; | ||
444 | } | ||
445 | fc_host_speed(shost) = speed; | ||
446 | } | ||
447 | |||
448 | static void | ||
429 | qla2x00_get_starget_node_name(struct scsi_target *starget) | 449 | qla2x00_get_starget_node_name(struct scsi_target *starget) |
430 | { | 450 | { |
431 | struct Scsi_Host *host = dev_to_shost(starget->dev.parent); | 451 | struct Scsi_Host *host = dev_to_shost(starget->dev.parent); |
@@ -520,6 +540,8 @@ struct fc_function_template qla2xxx_transport_functions = { | |||
520 | 540 | ||
521 | .get_host_port_id = qla2x00_get_host_port_id, | 541 | .get_host_port_id = qla2x00_get_host_port_id, |
522 | .show_host_port_id = 1, | 542 | .show_host_port_id = 1, |
543 | .get_host_speed = qla2x00_get_host_speed, | ||
544 | .show_host_speed = 1, | ||
523 | 545 | ||
524 | .dd_fcrport_size = sizeof(struct fc_port *), | 546 | .dd_fcrport_size = sizeof(struct fc_port *), |
525 | .show_rport_supported_classes = 1, | 547 | .show_rport_supported_classes = 1, |