diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index e1c1efc2c5a0..30436d53d358 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -437,6 +437,34 @@ void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) | |||
437 | } | 437 | } |
438 | } | 438 | } |
439 | 439 | ||
440 | #define ZFCP_FSF_PORTSPEED_1GBIT (1 << 0) | ||
441 | #define ZFCP_FSF_PORTSPEED_2GBIT (1 << 1) | ||
442 | #define ZFCP_FSF_PORTSPEED_4GBIT (1 << 2) | ||
443 | #define ZFCP_FSF_PORTSPEED_10GBIT (1 << 3) | ||
444 | #define ZFCP_FSF_PORTSPEED_8GBIT (1 << 4) | ||
445 | #define ZFCP_FSF_PORTSPEED_16GBIT (1 << 5) | ||
446 | #define ZFCP_FSF_PORTSPEED_NOT_NEGOTIATED (1 << 15) | ||
447 | |||
448 | static u32 zfcp_fsf_convert_portspeed(u32 fsf_speed) | ||
449 | { | ||
450 | u32 fdmi_speed = 0; | ||
451 | if (fsf_speed & ZFCP_FSF_PORTSPEED_1GBIT) | ||
452 | fdmi_speed |= FC_PORTSPEED_1GBIT; | ||
453 | if (fsf_speed & ZFCP_FSF_PORTSPEED_2GBIT) | ||
454 | fdmi_speed |= FC_PORTSPEED_2GBIT; | ||
455 | if (fsf_speed & ZFCP_FSF_PORTSPEED_4GBIT) | ||
456 | fdmi_speed |= FC_PORTSPEED_4GBIT; | ||
457 | if (fsf_speed & ZFCP_FSF_PORTSPEED_10GBIT) | ||
458 | fdmi_speed |= FC_PORTSPEED_10GBIT; | ||
459 | if (fsf_speed & ZFCP_FSF_PORTSPEED_8GBIT) | ||
460 | fdmi_speed |= FC_PORTSPEED_8GBIT; | ||
461 | if (fsf_speed & ZFCP_FSF_PORTSPEED_16GBIT) | ||
462 | fdmi_speed |= FC_PORTSPEED_16GBIT; | ||
463 | if (fsf_speed & ZFCP_FSF_PORTSPEED_NOT_NEGOTIATED) | ||
464 | fdmi_speed |= FC_PORTSPEED_NOT_NEGOTIATED; | ||
465 | return fdmi_speed; | ||
466 | } | ||
467 | |||
440 | static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req) | 468 | static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req) |
441 | { | 469 | { |
442 | struct fsf_qtcb_bottom_config *bottom = &req->qtcb->bottom.config; | 470 | struct fsf_qtcb_bottom_config *bottom = &req->qtcb->bottom.config; |
@@ -456,7 +484,8 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req) | |||
456 | fc_host_port_name(shost) = nsp->fl_wwpn; | 484 | fc_host_port_name(shost) = nsp->fl_wwpn; |
457 | fc_host_node_name(shost) = nsp->fl_wwnn; | 485 | fc_host_node_name(shost) = nsp->fl_wwnn; |
458 | fc_host_port_id(shost) = ntoh24(bottom->s_id); | 486 | fc_host_port_id(shost) = ntoh24(bottom->s_id); |
459 | fc_host_speed(shost) = bottom->fc_link_speed; | 487 | fc_host_speed(shost) = |
488 | zfcp_fsf_convert_portspeed(bottom->fc_link_speed); | ||
460 | fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; | 489 | fc_host_supported_classes(shost) = FC_COS_CLASS2 | FC_COS_CLASS3; |
461 | 490 | ||
462 | adapter->hydra_version = bottom->adapter_type; | 491 | adapter->hydra_version = bottom->adapter_type; |
@@ -580,7 +609,8 @@ static void zfcp_fsf_exchange_port_evaluate(struct zfcp_fsf_req *req) | |||
580 | } else | 609 | } else |
581 | fc_host_permanent_port_name(shost) = fc_host_port_name(shost); | 610 | fc_host_permanent_port_name(shost) = fc_host_port_name(shost); |
582 | fc_host_maxframe_size(shost) = bottom->maximum_frame_size; | 611 | fc_host_maxframe_size(shost) = bottom->maximum_frame_size; |
583 | fc_host_supported_speeds(shost) = bottom->supported_speed; | 612 | fc_host_supported_speeds(shost) = |
613 | zfcp_fsf_convert_portspeed(bottom->supported_speed); | ||
584 | memcpy(fc_host_supported_fc4s(shost), bottom->supported_fc4_types, | 614 | memcpy(fc_host_supported_fc4s(shost), bottom->supported_fc4_types, |
585 | FC_FC4_LIST_SIZE); | 615 | FC_FC4_LIST_SIZE); |
586 | memcpy(fc_host_active_fc4s(shost), bottom->active_fc4_types, | 616 | memcpy(fc_host_active_fc4s(shost), bottom->active_fc4_types, |