@@ -3330,11 +3330,34 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
3330
3330
.bsg_timeout = qla24xx_bsg_timeout ,
3331
3331
};
3332
3332
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
+
3333
3356
void
3334
3357
qla2x00_init_host_attr (scsi_qla_host_t * vha )
3335
3358
{
3336
3359
struct qla_hw_data * ha = vha -> hw ;
3337
- u32 speeds = FC_PORTSPEED_UNKNOWN ;
3360
+ u32 speeds = 0 , fdmi_speed = 0 ;
3338
3361
3339
3362
fc_host_dev_loss_tmo (vha -> host ) = ha -> port_down_retry_count ;
3340
3363
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)
3344
3367
fc_host_max_npiv_vports (vha -> host ) = ha -> max_npiv_vports ;
3345
3368
fc_host_npiv_vports_inuse (vha -> host ) = ha -> cur_vport_count ;
3346
3369
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 );
3348
3372
3349
3373
fc_host_supported_speeds (vha -> host ) = speeds ;
3350
3374
}
0 commit comments