aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c50
1 files changed, 44 insertions, 6 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index dd879a7d04a3..2f7018821531 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -4891,9 +4891,34 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
4891 mb->mbxOwner = OWN_CHIP; 4891 mb->mbxOwner = OWN_CHIP;
4892 4892
4893 if (psli->sli_flag & LPFC_SLI_ACTIVE) { 4893 if (psli->sli_flag & LPFC_SLI_ACTIVE) {
4894 /* First copy command data to host SLIM area */ 4894 /* Populate mbox extension offset word. */
4895 if (pmbox->in_ext_byte_len || pmbox->out_ext_byte_len) {
4896 *(((uint32_t *)mb) + pmbox->mbox_offset_word)
4897 = (uint8_t *)phba->mbox_ext
4898 - (uint8_t *)phba->mbox;
4899 }
4900
4901 /* Copy the mailbox extension data */
4902 if (pmbox->in_ext_byte_len && pmbox->context2) {
4903 lpfc_sli_pcimem_bcopy(pmbox->context2,
4904 (uint8_t *)phba->mbox_ext,
4905 pmbox->in_ext_byte_len);
4906 }
4907 /* Copy command data to host SLIM area */
4895 lpfc_sli_pcimem_bcopy(mb, phba->mbox, MAILBOX_CMD_SIZE); 4908 lpfc_sli_pcimem_bcopy(mb, phba->mbox, MAILBOX_CMD_SIZE);
4896 } else { 4909 } else {
4910 /* Populate mbox extension offset word. */
4911 if (pmbox->in_ext_byte_len || pmbox->out_ext_byte_len)
4912 *(((uint32_t *)mb) + pmbox->mbox_offset_word)
4913 = MAILBOX_HBA_EXT_OFFSET;
4914
4915 /* Copy the mailbox extension data */
4916 if (pmbox->in_ext_byte_len && pmbox->context2) {
4917 lpfc_memcpy_to_slim(phba->MBslimaddr +
4918 MAILBOX_HBA_EXT_OFFSET,
4919 pmbox->context2, pmbox->in_ext_byte_len);
4920
4921 }
4897 if (mb->mbxCommand == MBX_CONFIG_PORT) { 4922 if (mb->mbxCommand == MBX_CONFIG_PORT) {
4898 /* copy command data into host mbox for cmpl */ 4923 /* copy command data into host mbox for cmpl */
4899 lpfc_sli_pcimem_bcopy(mb, phba->mbox, MAILBOX_CMD_SIZE); 4924 lpfc_sli_pcimem_bcopy(mb, phba->mbox, MAILBOX_CMD_SIZE);
@@ -5003,15 +5028,22 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
5003 if (psli->sli_flag & LPFC_SLI_ACTIVE) { 5028 if (psli->sli_flag & LPFC_SLI_ACTIVE) {
5004 /* copy results back to user */ 5029 /* copy results back to user */
5005 lpfc_sli_pcimem_bcopy(phba->mbox, mb, MAILBOX_CMD_SIZE); 5030 lpfc_sli_pcimem_bcopy(phba->mbox, mb, MAILBOX_CMD_SIZE);
5031 /* Copy the mailbox extension data */
5032 if (pmbox->out_ext_byte_len && pmbox->context2) {
5033 lpfc_sli_pcimem_bcopy(phba->mbox_ext,
5034 pmbox->context2,
5035 pmbox->out_ext_byte_len);
5036 }
5006 } else { 5037 } else {
5007 /* First copy command data */ 5038 /* First copy command data */
5008 lpfc_memcpy_from_slim(mb, phba->MBslimaddr, 5039 lpfc_memcpy_from_slim(mb, phba->MBslimaddr,
5009 MAILBOX_CMD_SIZE); 5040 MAILBOX_CMD_SIZE);
5010 if ((mb->mbxCommand == MBX_DUMP_MEMORY) && 5041 /* Copy the mailbox extension data */
5011 pmbox->context2) { 5042 if (pmbox->out_ext_byte_len && pmbox->context2) {
5012 lpfc_memcpy_from_slim((void *)pmbox->context2, 5043 lpfc_memcpy_from_slim(pmbox->context2,
5013 phba->MBslimaddr + DMP_RSP_OFFSET, 5044 phba->MBslimaddr +
5014 mb->un.varDmp.word_cnt); 5045 MAILBOX_HBA_EXT_OFFSET,
5046 pmbox->out_ext_byte_len);
5015 } 5047 }
5016 } 5048 }
5017 5049
@@ -8133,6 +8165,12 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id)
8133 if (pmb->mbox_cmpl) { 8165 if (pmb->mbox_cmpl) {
8134 lpfc_sli_pcimem_bcopy(mbox, pmbox, 8166 lpfc_sli_pcimem_bcopy(mbox, pmbox,
8135 MAILBOX_CMD_SIZE); 8167 MAILBOX_CMD_SIZE);
8168 if (pmb->out_ext_byte_len &&
8169 pmb->context2)
8170 lpfc_sli_pcimem_bcopy(
8171 phba->mbox_ext,
8172 pmb->context2,
8173 pmb->out_ext_byte_len);
8136 } 8174 }
8137 if (pmb->mbox_flag & LPFC_MBX_IMED_UNREG) { 8175 if (pmb->mbox_flag & LPFC_MBX_IMED_UNREG) {
8138 pmb->mbox_flag &= ~LPFC_MBX_IMED_UNREG; 8176 pmb->mbox_flag &= ~LPFC_MBX_IMED_UNREG;