@@ -3318,11 +3318,34 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
33183318 .bsg_timeout = qla24xx_bsg_timeout ,
33193319};
33203320
3321+ static uint
3322+ qla2x00_get_host_supported_speeds (scsi_qla_host_t * vha , uint speeds )
3323+ {
3324+ uint supported_speeds = FC_PORTSPEED_UNKNOWN ;
3325+
3326+ if (speeds & FDMI_PORT_SPEED_64GB )
3327+ supported_speeds |= FC_PORTSPEED_64GBIT ;
3328+ if (speeds & FDMI_PORT_SPEED_32GB )
3329+ supported_speeds |= FC_PORTSPEED_32GBIT ;
3330+ if (speeds & FDMI_PORT_SPEED_16GB )
3331+ supported_speeds |= FC_PORTSPEED_16GBIT ;
3332+ if (speeds & FDMI_PORT_SPEED_8GB )
3333+ supported_speeds |= FC_PORTSPEED_8GBIT ;
3334+ if (speeds & FDMI_PORT_SPEED_4GB )
3335+ supported_speeds |= FC_PORTSPEED_4GBIT ;
3336+ if (speeds & FDMI_PORT_SPEED_2GB )
3337+ supported_speeds |= FC_PORTSPEED_2GBIT ;
3338+ if (speeds & FDMI_PORT_SPEED_1GB )
3339+ supported_speeds |= FC_PORTSPEED_1GBIT ;
3340+
3341+ return supported_speeds ;
3342+ }
3343+
33213344void
33223345qla2x00_init_host_attr (scsi_qla_host_t * vha )
33233346{
33243347 struct qla_hw_data * ha = vha -> hw ;
3325- u32 speeds = FC_PORTSPEED_UNKNOWN ;
3348+ u32 speeds = 0 , fdmi_speed = 0 ;
33263349
33273350 fc_host_dev_loss_tmo (vha -> host ) = ha -> port_down_retry_count ;
33283351 fc_host_node_name (vha -> host ) = wwn_to_u64 (vha -> node_name );
@@ -3332,7 +3355,8 @@ qla2x00_init_host_attr(scsi_qla_host_t *vha)
33323355 fc_host_max_npiv_vports (vha -> host ) = ha -> max_npiv_vports ;
33333356 fc_host_npiv_vports_inuse (vha -> host ) = ha -> cur_vport_count ;
33343357
3335- speeds = qla25xx_fdmi_port_speed_capability (ha );
3358+ fdmi_speed = qla25xx_fdmi_port_speed_capability (ha );
3359+ speeds = qla2x00_get_host_supported_speeds (vha , fdmi_speed );
33363360
33373361 fc_host_supported_speeds (vha -> host ) = speeds ;
33383362}
0 commit comments