aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2008-04-03 16:13:14 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 13:19:12 -0400
commit2ae2b3709542a4b5b691985ecbdf3b79303d9e56 (patch)
treec6c8917526436579a8f7748548c7778da1abdb8e /drivers/scsi/qla2xxx/qla_attr.c
parent01e58d8eac93f3b73246b8d0bdee071d9fb85661 (diff)
[SCSI] qla2xxx: Add support for host supported speeds FC transport attribute.
Use generic FC transport #defines for speed values. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 27111b18cc1b..aee03221ed6e 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -849,20 +849,20 @@ static void
849qla2x00_get_host_speed(struct Scsi_Host *shost) 849qla2x00_get_host_speed(struct Scsi_Host *shost)
850{ 850{
851 scsi_qla_host_t *ha = to_qla_parent(shost_priv(shost)); 851 scsi_qla_host_t *ha = to_qla_parent(shost_priv(shost));
852 uint32_t speed = 0; 852 u32 speed = FC_PORTSPEED_UNKNOWN;
853 853
854 switch (ha->link_data_rate) { 854 switch (ha->link_data_rate) {
855 case PORT_SPEED_1GB: 855 case PORT_SPEED_1GB:
856 speed = 1; 856 speed = FC_PORTSPEED_1GBIT;
857 break; 857 break;
858 case PORT_SPEED_2GB: 858 case PORT_SPEED_2GB:
859 speed = 2; 859 speed = FC_PORTSPEED_2GBIT;
860 break; 860 break;
861 case PORT_SPEED_4GB: 861 case PORT_SPEED_4GB:
862 speed = 4; 862 speed = FC_PORTSPEED_4GBIT;
863 break; 863 break;
864 case PORT_SPEED_8GB: 864 case PORT_SPEED_8GB:
865 speed = 8; 865 speed = FC_PORTSPEED_8GBIT;
866 break; 866 break;
867 } 867 }
868 fc_host_speed(shost) = speed; 868 fc_host_speed(shost) = speed;
@@ -1196,6 +1196,7 @@ struct fc_function_template qla2xxx_transport_functions = {
1196 .show_host_node_name = 1, 1196 .show_host_node_name = 1,
1197 .show_host_port_name = 1, 1197 .show_host_port_name = 1,
1198 .show_host_supported_classes = 1, 1198 .show_host_supported_classes = 1,
1199 .show_host_supported_speeds = 1,
1199 1200
1200 .get_host_port_id = qla2x00_get_host_port_id, 1201 .get_host_port_id = qla2x00_get_host_port_id,
1201 .show_host_port_id = 1, 1202 .show_host_port_id = 1,
@@ -1276,9 +1277,23 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
1276void 1277void
1277qla2x00_init_host_attr(scsi_qla_host_t *ha) 1278qla2x00_init_host_attr(scsi_qla_host_t *ha)
1278{ 1279{
1280 u32 speed = FC_PORTSPEED_UNKNOWN;
1281
1279 fc_host_node_name(ha->host) = wwn_to_u64(ha->node_name); 1282 fc_host_node_name(ha->host) = wwn_to_u64(ha->node_name);
1280 fc_host_port_name(ha->host) = wwn_to_u64(ha->port_name); 1283 fc_host_port_name(ha->host) = wwn_to_u64(ha->port_name);
1281 fc_host_supported_classes(ha->host) = FC_COS_CLASS3; 1284 fc_host_supported_classes(ha->host) = FC_COS_CLASS3;
1282 fc_host_max_npiv_vports(ha->host) = ha->max_npiv_vports;; 1285 fc_host_max_npiv_vports(ha->host) = ha->max_npiv_vports;;
1283 fc_host_npiv_vports_inuse(ha->host) = ha->cur_vport_count; 1286 fc_host_npiv_vports_inuse(ha->host) = ha->cur_vport_count;
1287
1288 if (IS_QLA25XX(ha))
1289 speed = FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT |
1290 FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT;
1291 else if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
1292 speed = FC_PORTSPEED_4GBIT | FC_PORTSPEED_2GBIT |
1293 FC_PORTSPEED_1GBIT;
1294 else if (IS_QLA23XX(ha))
1295 speed = FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT;
1296 else
1297 speed = FC_PORTSPEED_1GBIT;
1298 fc_host_supported_speeds(ha->host) = speed;
1284} 1299}