aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_mbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_mbox.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_mbox.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index 1ab405902a18..2a38d94654bc 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -849,7 +849,10 @@ lpfc_unreg_vpi(struct lpfc_hba *phba, uint16_t vpi, LPFC_MBOXQ_t *pmb)
849 MAILBOX_t *mb = &pmb->u.mb; 849 MAILBOX_t *mb = &pmb->u.mb;
850 memset(pmb, 0, sizeof (LPFC_MBOXQ_t)); 850 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
851 851
852 mb->un.varUnregVpi.vpi = vpi + phba->vpi_base; 852 if (phba->sli_rev < LPFC_SLI_REV4)
853 mb->un.varUnregVpi.vpi = vpi + phba->vpi_base;
854 else
855 mb->un.varUnregVpi.sli4_vpi = vpi + phba->vpi_base;
853 856
854 mb->mbxCommand = MBX_UNREG_VPI; 857 mb->mbxCommand = MBX_UNREG_VPI;
855 mb->mbxOwner = OWN_HOST; 858 mb->mbxOwner = OWN_HOST;
@@ -1850,7 +1853,7 @@ lpfc_init_vpi(struct lpfc_hba *phba, struct lpfcMboxq *mbox, uint16_t vpi)
1850/** 1853/**
1851 * lpfc_unreg_vfi - Initialize the UNREG_VFI mailbox command 1854 * lpfc_unreg_vfi - Initialize the UNREG_VFI mailbox command
1852 * @mbox: pointer to lpfc mbox command to initialize. 1855 * @mbox: pointer to lpfc mbox command to initialize.
1853 * @vfi: VFI to be unregistered. 1856 * @vport: vport associated with the VF.
1854 * 1857 *
1855 * The UNREG_VFI mailbox command causes the SLI Host to put a virtual fabric 1858 * The UNREG_VFI mailbox command causes the SLI Host to put a virtual fabric
1856 * (logical NPort) into the inactive state. The SLI Host must have logged out 1859 * (logical NPort) into the inactive state. The SLI Host must have logged out
@@ -1859,11 +1862,12 @@ lpfc_init_vpi(struct lpfc_hba *phba, struct lpfcMboxq *mbox, uint16_t vpi)
1859 * fabric inactive. 1862 * fabric inactive.
1860 **/ 1863 **/
1861void 1864void
1862lpfc_unreg_vfi(struct lpfcMboxq *mbox, uint16_t vfi) 1865lpfc_unreg_vfi(struct lpfcMboxq *mbox, struct lpfc_vport *vport)
1863{ 1866{
1864 memset(mbox, 0, sizeof(*mbox)); 1867 memset(mbox, 0, sizeof(*mbox));
1865 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_UNREG_VFI); 1868 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_UNREG_VFI);
1866 bf_set(lpfc_unreg_vfi_vfi, &mbox->u.mqe.un.unreg_vfi, vfi); 1869 bf_set(lpfc_unreg_vfi_vfi, &mbox->u.mqe.un.unreg_vfi,
1870 vport->vfi + vport->phba->vfi_base);
1867} 1871}
1868 1872
1869/** 1873/**