aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@avagotech.com>2015-12-16 18:12:02 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2015-12-21 22:04:04 -0500
commita085e87c814567c94e5d375e7362f9f25030aac1 (patch)
tree91460113db76bce1cbf7f809005fb9a6df9b83dc /drivers/scsi/lpfc/lpfc_init.c
parent5afab6bbf3f026b7d50451acbfdc12300c5f4353 (diff)
lpfc: Use new FDMI speed definitions for 10G, 25G and 40G FCoE.
Use new FDMI speed definitions for 10G, 25G and 40G FCoE. Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com> Signed-off-by: James Smart <james.smart@avagotech.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c95
1 files changed, 30 insertions, 65 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index d9753e3e9737..614f357dfb8a 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -3710,49 +3710,6 @@ lpfc_sli4_parse_latt_type(struct lpfc_hba *phba,
3710} 3710}
3711 3711
3712/** 3712/**
3713 * lpfc_sli4_parse_latt_link_speed - Parse sli4 link-attention link speed
3714 * @phba: pointer to lpfc hba data structure.
3715 * @acqe_link: pointer to the async link completion queue entry.
3716 *
3717 * This routine is to parse the SLI4 link-attention link speed and translate
3718 * it into the base driver's link-attention link speed coding.
3719 *
3720 * Return: Link-attention link speed in terms of base driver's coding.
3721 **/
3722static uint8_t
3723lpfc_sli4_parse_latt_link_speed(struct lpfc_hba *phba,
3724 struct lpfc_acqe_link *acqe_link)
3725{
3726 uint8_t link_speed;
3727
3728 switch (bf_get(lpfc_acqe_link_speed, acqe_link)) {
3729 case LPFC_ASYNC_LINK_SPEED_ZERO:
3730 case LPFC_ASYNC_LINK_SPEED_10MBPS:
3731 case LPFC_ASYNC_LINK_SPEED_100MBPS:
3732 link_speed = LPFC_LINK_SPEED_UNKNOWN;
3733 break;
3734 case LPFC_ASYNC_LINK_SPEED_1GBPS:
3735 link_speed = LPFC_LINK_SPEED_1GHZ;
3736 break;
3737 case LPFC_ASYNC_LINK_SPEED_10GBPS:
3738 link_speed = LPFC_LINK_SPEED_10GHZ;
3739 break;
3740 case LPFC_ASYNC_LINK_SPEED_20GBPS:
3741 case LPFC_ASYNC_LINK_SPEED_25GBPS:
3742 case LPFC_ASYNC_LINK_SPEED_40GBPS:
3743 link_speed = LPFC_LINK_SPEED_UNKNOWN;
3744 break;
3745 default:
3746 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
3747 "0483 Invalid link-attention link speed: x%x\n",
3748 bf_get(lpfc_acqe_link_speed, acqe_link));
3749 link_speed = LPFC_LINK_SPEED_UNKNOWN;
3750 break;
3751 }
3752 return link_speed;
3753}
3754
3755/**
3756 * lpfc_sli_port_speed_get - Get sli3 link speed code to link speed 3713 * lpfc_sli_port_speed_get - Get sli3 link speed code to link speed
3757 * @phba: pointer to lpfc hba data structure. 3714 * @phba: pointer to lpfc hba data structure.
3758 * 3715 *
@@ -3768,27 +3725,35 @@ lpfc_sli_port_speed_get(struct lpfc_hba *phba)
3768 if (!lpfc_is_link_up(phba)) 3725 if (!lpfc_is_link_up(phba))
3769 return 0; 3726 return 0;
3770 3727
3771 switch (phba->fc_linkspeed) { 3728 if (phba->sli_rev <= LPFC_SLI_REV3) {
3772 case LPFC_LINK_SPEED_1GHZ: 3729 switch (phba->fc_linkspeed) {
3773 link_speed = 1000; 3730 case LPFC_LINK_SPEED_1GHZ:
3774 break; 3731 link_speed = 1000;
3775 case LPFC_LINK_SPEED_2GHZ: 3732 break;
3776 link_speed = 2000; 3733 case LPFC_LINK_SPEED_2GHZ:
3777 break; 3734 link_speed = 2000;
3778 case LPFC_LINK_SPEED_4GHZ: 3735 break;
3779 link_speed = 4000; 3736 case LPFC_LINK_SPEED_4GHZ:
3780 break; 3737 link_speed = 4000;
3781 case LPFC_LINK_SPEED_8GHZ: 3738 break;
3782 link_speed = 8000; 3739 case LPFC_LINK_SPEED_8GHZ:
3783 break; 3740 link_speed = 8000;
3784 case LPFC_LINK_SPEED_10GHZ: 3741 break;
3785 link_speed = 10000; 3742 case LPFC_LINK_SPEED_10GHZ:
3786 break; 3743 link_speed = 10000;
3787 case LPFC_LINK_SPEED_16GHZ: 3744 break;
3788 link_speed = 16000; 3745 case LPFC_LINK_SPEED_16GHZ:
3789 break; 3746 link_speed = 16000;
3790 default: 3747 break;
3791 link_speed = 0; 3748 default:
3749 link_speed = 0;
3750 }
3751 } else {
3752 if (phba->sli4_hba.link_state.logical_speed)
3753 link_speed =
3754 phba->sli4_hba.link_state.logical_speed;
3755 else
3756 link_speed = phba->sli4_hba.link_state.speed;
3792 } 3757 }
3793 return link_speed; 3758 return link_speed;
3794} 3759}
@@ -3984,7 +3949,7 @@ lpfc_sli4_async_link_evt(struct lpfc_hba *phba,
3984 la->eventTag = acqe_link->event_tag; 3949 la->eventTag = acqe_link->event_tag;
3985 bf_set(lpfc_mbx_read_top_att_type, la, att_type); 3950 bf_set(lpfc_mbx_read_top_att_type, la, att_type);
3986 bf_set(lpfc_mbx_read_top_link_spd, la, 3951 bf_set(lpfc_mbx_read_top_link_spd, la,
3987 lpfc_sli4_parse_latt_link_speed(phba, acqe_link)); 3952 (bf_get(lpfc_acqe_link_speed, acqe_link)));
3988 3953
3989 /* Fake the the following irrelvant fields */ 3954 /* Fake the the following irrelvant fields */
3990 bf_set(lpfc_mbx_read_top_topology, la, LPFC_TOPOLOGY_PT_PT); 3955 bf_set(lpfc_mbx_read_top_topology, la, LPFC_TOPOLOGY_PT_PT);