Commit 719162bd authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Enable Management features for IF_TYPE=6

Addition of support for if_type=6 missed several checks for interface type,
resulting in the failure of several key management features such as
firmware dump and loopback testing.

Correct the checks on the if_type so that both SLI4 IF_TYPE's 2 and 6 are
supported.
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 2d1036ae
...@@ -1358,7 +1358,7 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode) ...@@ -1358,7 +1358,7 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
return -EACCES; return -EACCES;
if ((phba->sli_rev < LPFC_SLI_REV4) || if ((phba->sli_rev < LPFC_SLI_REV4) ||
(bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
LPFC_SLI_INTF_IF_TYPE_2)) LPFC_SLI_INTF_IF_TYPE_2))
return -EPERM; return -EPERM;
...@@ -4361,7 +4361,7 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr, ...@@ -4361,7 +4361,7 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
uint32_t prev_val, if_type; uint32_t prev_val, if_type;
if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf);
if (if_type == LPFC_SLI_INTF_IF_TYPE_2 && if (if_type >= LPFC_SLI_INTF_IF_TYPE_2 &&
phba->hba_flag & HBA_FORCED_LINK_SPEED) phba->hba_flag & HBA_FORCED_LINK_SPEED)
return -EPERM; return -EPERM;
......
...@@ -2222,7 +2222,7 @@ lpfc_bsg_diag_loopback_mode(struct bsg_job *job) ...@@ -2222,7 +2222,7 @@ lpfc_bsg_diag_loopback_mode(struct bsg_job *job)
if (phba->sli_rev < LPFC_SLI_REV4) if (phba->sli_rev < LPFC_SLI_REV4)
rc = lpfc_sli3_bsg_diag_loopback_mode(phba, job); rc = lpfc_sli3_bsg_diag_loopback_mode(phba, job);
else if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) == else if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) >=
LPFC_SLI_INTF_IF_TYPE_2) LPFC_SLI_INTF_IF_TYPE_2)
rc = lpfc_sli4_bsg_diag_loopback_mode(phba, job); rc = lpfc_sli4_bsg_diag_loopback_mode(phba, job);
else else
...@@ -2262,7 +2262,7 @@ lpfc_sli4_bsg_diag_mode_end(struct bsg_job *job) ...@@ -2262,7 +2262,7 @@ lpfc_sli4_bsg_diag_mode_end(struct bsg_job *job)
if (phba->sli_rev < LPFC_SLI_REV4) if (phba->sli_rev < LPFC_SLI_REV4)
return -ENODEV; return -ENODEV;
if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
LPFC_SLI_INTF_IF_TYPE_2) LPFC_SLI_INTF_IF_TYPE_2)
return -ENODEV; return -ENODEV;
...@@ -2354,7 +2354,7 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job) ...@@ -2354,7 +2354,7 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job)
rc = -ENODEV; rc = -ENODEV;
goto job_error; goto job_error;
} }
if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
LPFC_SLI_INTF_IF_TYPE_2) { LPFC_SLI_INTF_IF_TYPE_2) {
rc = -ENODEV; rc = -ENODEV;
goto job_error; goto job_error;
......
...@@ -5733,7 +5733,7 @@ lpfc_els_rcv_rdp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, ...@@ -5733,7 +5733,7 @@ lpfc_els_rcv_rdp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
struct ls_rjt stat; struct ls_rjt stat;
if (phba->sli_rev < LPFC_SLI_REV4 || if (phba->sli_rev < LPFC_SLI_REV4 ||
bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
LPFC_SLI_INTF_IF_TYPE_2) { LPFC_SLI_INTF_IF_TYPE_2) {
rjt_err = LSRJT_UNABLE_TPC; rjt_err = LSRJT_UNABLE_TPC;
rjt_expl = LSEXP_REQ_UNSUPPORTED; rjt_expl = LSEXP_REQ_UNSUPPORTED;
......
...@@ -4850,7 +4850,7 @@ lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) ...@@ -4850,7 +4850,7 @@ lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
if (phba->sli_rev == LPFC_SLI_REV4 && if (phba->sli_rev == LPFC_SLI_REV4 &&
(!(vport->load_flag & FC_UNLOADING)) && (!(vport->load_flag & FC_UNLOADING)) &&
(bf_get(lpfc_sli_intf_if_type, (bf_get(lpfc_sli_intf_if_type,
&phba->sli4_hba.sli_intf) == &phba->sli4_hba.sli_intf) >=
LPFC_SLI_INTF_IF_TYPE_2) && LPFC_SLI_INTF_IF_TYPE_2) &&
(kref_read(&ndlp->kref) > 0)) { (kref_read(&ndlp->kref) > 0)) {
mbox->ctx_ndlp = lpfc_nlp_get(ndlp); mbox->ctx_ndlp = lpfc_nlp_get(ndlp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment