diff options
author | James Smart <james.smart@emulex.com> | 2011-12-13 13:23:09 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-12-15 01:57:45 -0500 |
commit | 1b51197d0fd0c06877c6df1bba84ac4008a7fc60 (patch) | |
tree | 0b8b6d450e94b10c12ddf4c8df8a765f8d2eecfc /drivers/scsi/lpfc/lpfc_sli.c | |
parent | 2e90f4b5a2a0ce5ab72c0c81c74269bd0a62522b (diff) |
[SCSI] lpfc 8.3.28: Add Loopback support for SLI4 adapters
- Add Basic support for SLI4 Loopback.
(CR 124951, 125766, 124951, 125843, 125832, 125843)
- Added missing protection in setting/clearing of phba->link_flag bit
field (CR 125994)
- Use link type and link number obtained from READ_CONFIG mailbox
command. (CR 126264)
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index e27cb44b3ec2..23a27592388c 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -3619,8 +3619,8 @@ lpfc_sli_brdready(struct lpfc_hba *phba, uint32_t mask) | |||
3619 | * lpfc_reset_barrier - Make HBA ready for HBA reset | 3619 | * lpfc_reset_barrier - Make HBA ready for HBA reset |
3620 | * @phba: Pointer to HBA context object. | 3620 | * @phba: Pointer to HBA context object. |
3621 | * | 3621 | * |
3622 | * This function is called before resetting an HBA. This | 3622 | * This function is called before resetting an HBA. This function is called |
3623 | * function requests HBA to quiesce DMAs before a reset. | 3623 | * with hbalock held and requests HBA to quiesce DMAs before a reset. |
3624 | **/ | 3624 | **/ |
3625 | void lpfc_reset_barrier(struct lpfc_hba *phba) | 3625 | void lpfc_reset_barrier(struct lpfc_hba *phba) |
3626 | { | 3626 | { |
@@ -6267,9 +6267,12 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) | |||
6267 | goto out_unset_queue; | 6267 | goto out_unset_queue; |
6268 | } | 6268 | } |
6269 | } else if (phba->cfg_suppress_link_up == LPFC_INITIALIZE_LINK) { | 6269 | } else if (phba->cfg_suppress_link_up == LPFC_INITIALIZE_LINK) { |
6270 | rc = phba->lpfc_hba_init_link(phba, MBX_NOWAIT); | 6270 | /* don't perform init_link on SLI4 FC port loopback test */ |
6271 | if (rc) | 6271 | if (!(phba->link_flag & LS_LOOPBACK_MODE)) { |
6272 | goto out_unset_queue; | 6272 | rc = phba->lpfc_hba_init_link(phba, MBX_NOWAIT); |
6273 | if (rc) | ||
6274 | goto out_unset_queue; | ||
6275 | } | ||
6273 | } | 6276 | } |
6274 | mempool_free(mboxq, phba->mbox_mem_pool); | 6277 | mempool_free(mboxq, phba->mbox_mem_pool); |
6275 | return rc; | 6278 | return rc; |
@@ -7540,6 +7543,7 @@ lpfc_sli4_bpl2sgl(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq, | |||
7540 | struct ulp_bde64 *bpl = NULL; | 7543 | struct ulp_bde64 *bpl = NULL; |
7541 | struct ulp_bde64 bde; | 7544 | struct ulp_bde64 bde; |
7542 | struct sli4_sge *sgl = NULL; | 7545 | struct sli4_sge *sgl = NULL; |
7546 | struct lpfc_dmabuf *dmabuf; | ||
7543 | IOCB_t *icmd; | 7547 | IOCB_t *icmd; |
7544 | int numBdes = 0; | 7548 | int numBdes = 0; |
7545 | int i = 0; | 7549 | int i = 0; |
@@ -7558,9 +7562,12 @@ lpfc_sli4_bpl2sgl(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq, | |||
7558 | * have not been byteswapped yet so there is no | 7562 | * have not been byteswapped yet so there is no |
7559 | * need to swap them back. | 7563 | * need to swap them back. |
7560 | */ | 7564 | */ |
7561 | bpl = (struct ulp_bde64 *) | 7565 | if (piocbq->context3) |
7562 | ((struct lpfc_dmabuf *)piocbq->context3)->virt; | 7566 | dmabuf = (struct lpfc_dmabuf *)piocbq->context3; |
7567 | else | ||
7568 | return xritag; | ||
7563 | 7569 | ||
7570 | bpl = (struct ulp_bde64 *)dmabuf->virt; | ||
7564 | if (!bpl) | 7571 | if (!bpl) |
7565 | return xritag; | 7572 | return xritag; |
7566 | 7573 | ||
@@ -7670,6 +7677,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
7670 | struct ulp_bde64 bde; | 7677 | struct ulp_bde64 bde; |
7671 | struct lpfc_nodelist *ndlp; | 7678 | struct lpfc_nodelist *ndlp; |
7672 | uint32_t *pcmd; | 7679 | uint32_t *pcmd; |
7680 | uint32_t if_type; | ||
7673 | 7681 | ||
7674 | fip = phba->hba_flag & HBA_FIP_SUPPORT; | 7682 | fip = phba->hba_flag & HBA_FIP_SUPPORT; |
7675 | /* The fcp commands will set command type */ | 7683 | /* The fcp commands will set command type */ |
@@ -7743,7 +7751,9 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
7743 | >> LPFC_FIP_ELS_ID_SHIFT); | 7751 | >> LPFC_FIP_ELS_ID_SHIFT); |
7744 | pcmd = (uint32_t *) (((struct lpfc_dmabuf *) | 7752 | pcmd = (uint32_t *) (((struct lpfc_dmabuf *) |
7745 | iocbq->context2)->virt); | 7753 | iocbq->context2)->virt); |
7746 | if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { | 7754 | if_type = bf_get(lpfc_sli_intf_if_type, |
7755 | &phba->sli4_hba.sli_intf); | ||
7756 | if (if_type == LPFC_SLI_INTF_IF_TYPE_2) { | ||
7747 | if (pcmd && (*pcmd == ELS_CMD_FLOGI || | 7757 | if (pcmd && (*pcmd == ELS_CMD_FLOGI || |
7748 | *pcmd == ELS_CMD_SCR || | 7758 | *pcmd == ELS_CMD_SCR || |
7749 | *pcmd == ELS_CMD_PLOGI)) { | 7759 | *pcmd == ELS_CMD_PLOGI)) { |
@@ -7776,6 +7786,8 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
7776 | /* The entire sequence is transmitted for this IOCB */ | 7786 | /* The entire sequence is transmitted for this IOCB */ |
7777 | xmit_len = total_len; | 7787 | xmit_len = total_len; |
7778 | cmnd = CMD_XMIT_SEQUENCE64_CR; | 7788 | cmnd = CMD_XMIT_SEQUENCE64_CR; |
7789 | if (phba->link_flag & LS_LOOPBACK_MODE) | ||
7790 | bf_set(wqe_xo, &wqe->xmit_sequence.wge_ctl, 1); | ||
7779 | case CMD_XMIT_SEQUENCE64_CR: | 7791 | case CMD_XMIT_SEQUENCE64_CR: |
7780 | /* word3 iocb=io_tag32 wqe=reserved */ | 7792 | /* word3 iocb=io_tag32 wqe=reserved */ |
7781 | wqe->xmit_sequence.rsvd3 = 0; | 7793 | wqe->xmit_sequence.rsvd3 = 0; |