@@ -3330,11 +3330,34 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
33303330 .bsg_timeout = qla24xx_bsg_timeout ,
33313331};
33323332
3333+ static uint
3334+ qla2x00_get_host_supported_speeds (scsi_qla_host_t * vha , uint speeds )
3335+ {
3336+ uint supported_speeds = FC_PORTSPEED_UNKNOWN ;
3337+
3338+ if (speeds & FDMI_PORT_SPEED_64GB )
3339+ supported_speeds |= FC_PORTSPEED_64GBIT ;
3340+ if (speeds & FDMI_PORT_SPEED_32GB )
3341+ supported_speeds |= FC_PORTSPEED_32GBIT ;
3342+ if (speeds & FDMI_PORT_SPEED_16GB )
3343+ supported_speeds |= FC_PORTSPEED_16GBIT ;
3344+ if (speeds & FDMI_PORT_SPEED_8GB )
3345+ supported_speeds |= FC_PORTSPEED_8GBIT ;
3346+ if (speeds & FDMI_PORT_SPEED_4GB )
3347+ supported_speeds |= FC_PORTSPEED_4GBIT ;
3348+ if (speeds & FDMI_PORT_SPEED_2GB )
3349+ supported_speeds |= FC_PORTSPEED_2GBIT ;
3350+ if (speeds & FDMI_PORT_SPEED_1GB )
3351+ supported_speeds |= FC_PORTSPEED_1GBIT ;
3352+
3353+ return supported_speeds ;
3354+ }
3355+
33333356void
33343357qla2x00_init_host_attr (scsi_qla_host_t * vha )
33353358{
33363359 struct qla_hw_data * ha = vha -> hw ;
3337- u32 speeds = FC_PORTSPEED_UNKNOWN ;
3360+ u32 speeds = 0 , fdmi_speed = 0 ;
33383361
33393362 fc_host_dev_loss_tmo (vha -> host ) = ha -> port_down_retry_count ;
33403363 fc_host_node_name (vha -> host ) = wwn_to_u64 (vha -> node_name );
@@ -3344,7 +3367,8 @@ qla2x00_init_host_attr(scsi_qla_host_t *vha)
33443367 fc_host_max_npiv_vports (vha -> host ) = ha -> max_npiv_vports ;
33453368 fc_host_npiv_vports_inuse (vha -> host ) = ha -> cur_vport_count ;
33463369
3347- speeds = qla25xx_fdmi_port_speed_capability (ha );
3370+ fdmi_speed = qla25xx_fdmi_port_speed_capability (ha );
3371+ speeds = qla2x00_get_host_supported_speeds (vha , fdmi_speed );
33483372
33493373 fc_host_supported_speeds (vha -> host ) = speeds ;
33503374}
0 commit comments