scsi: lpfc: Define lpfc_dmabuf type for ctx_buf ptr
authorJustin Tee <justin.tee@broadcom.com>
Tue, 5 Mar 2024 20:05:00 +0000 (12:05 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 10 Mar 2024 22:56:44 +0000 (18:56 -0400)
In LPFC_MBOXQ_t, the ctx_buf ptr shouldn't be defined as a generic void
*ptr.  It is named ctx_buf and it should only be used as an lpfc_dmabuf
*ptr.  Due to the void* declaration, there have been abuses of ctx_buf for
things not related to lpfc_dmabuf.

So, set the ptr type for *ctx_buf as lpfc_dmabuf.  Remove all type casts on
ctx_buf because it is no longer a void *ptr.  Convert the abuse of ctx_buf
for something not related to lpfc_dmabuf to use the void *context3 ptr.

A particular abuse of the ctx_buf warranted a new void *ext_buf ptr.
However, the usage of this new void *ext_buf is not generic.  It is
intended to only hold virtual addresses for extended mailbox commands.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20240305200503.57317-10-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_bsg.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_mbox.c
drivers/scsi/lpfc/lpfc_nportdisc.c
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_sli.h
drivers/scsi/lpfc/lpfc_vport.c

index 03605b827f3a626ab961c22f58f694283b4a9423..f784dc9b602a0cf745a158ea9f4a9dee8046e68d 100644 (file)
@@ -2513,7 +2513,7 @@ static int lpfcdiag_loop_self_reg(struct lpfc_hba *phba, uint16_t *rpi)
                return -ENOMEM;
        }
 
-       dmabuff = (struct lpfc_dmabuf *)mbox->ctx_buf;
+       dmabuff = mbox->ctx_buf;
        mbox->ctx_buf = NULL;
        mbox->ctx_ndlp = NULL;
        status = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO);
@@ -3553,7 +3553,7 @@ lpfc_bsg_issue_mbox_ext_handle_job(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)
        struct lpfc_sli_config_mbox *sli_cfg_mbx;
        uint8_t *pmbx;
 
-       dd_data = pmboxq->ctx_buf;
+       dd_data = pmboxq->context3;
 
        /* Determine if job has been aborted */
        spin_lock_irqsave(&phba->ct_ev_lock, flags);
@@ -3940,7 +3940,7 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job,
        pmboxq->mbox_cmpl = lpfc_bsg_issue_read_mbox_ext_cmpl;
 
        /* context fields to callback function */
-       pmboxq->ctx_buf = dd_data;
+       pmboxq->context3 = dd_data;
        dd_data->type = TYPE_MBOX;
        dd_data->set_job = job;
        dd_data->context_un.mbox.pmboxq = pmboxq;
@@ -4112,7 +4112,7 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct bsg_job *job,
                pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl;
 
                /* context fields to callback function */
-               pmboxq->ctx_buf = dd_data;
+               pmboxq->context3 = dd_data;
                dd_data->type = TYPE_MBOX;
                dd_data->set_job = job;
                dd_data->context_un.mbox.pmboxq = pmboxq;
@@ -4460,7 +4460,7 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct bsg_job *job,
                pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl;
 
                /* context fields to callback function */
-               pmboxq->ctx_buf = dd_data;
+               pmboxq->context3 = dd_data;
                dd_data->type = TYPE_MBOX;
                dd_data->set_job = job;
                dd_data->context_un.mbox.pmboxq = pmboxq;
@@ -4747,7 +4747,7 @@ lpfc_bsg_issue_mbox(struct lpfc_hba *phba, struct bsg_job *job,
        if (mbox_req->inExtWLen || mbox_req->outExtWLen) {
                from = pmbx;
                ext = from + sizeof(MAILBOX_t);
-               pmboxq->ctx_buf = ext;
+               pmboxq->ext_buf = ext;
                pmboxq->in_ext_byte_len =
                        mbox_req->inExtWLen * sizeof(uint32_t);
                pmboxq->out_ext_byte_len =
index 1c0ca5de7e1e248f96e3f7d8d5ef0c9a684dafd4..fdb0540fa492a3caa6b04e735184765dda7c666f 100644 (file)
@@ -7290,7 +7290,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
                mbox->in_ext_byte_len = DMP_SFF_PAGE_A0_SIZE;
                mbox->out_ext_byte_len = DMP_SFF_PAGE_A0_SIZE;
                mbox->mbox_offset_word = 5;
-               mbox->ctx_buf = virt;
+               mbox->ext_buf = virt;
        } else {
                bf_set(lpfc_mbx_memory_dump_type3_length,
                       &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A0_SIZE);
@@ -7306,7 +7306,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
        }
 
        if (phba->sli_rev == LPFC_SLI_REV4)
-               mp = (struct lpfc_dmabuf *)(mbox->ctx_buf);
+               mp = mbox->ctx_buf;
        else
                mp = mpsave;
 
@@ -7349,7 +7349,7 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
                mbox->in_ext_byte_len = DMP_SFF_PAGE_A2_SIZE;
                mbox->out_ext_byte_len = DMP_SFF_PAGE_A2_SIZE;
                mbox->mbox_offset_word = 5;
-               mbox->ctx_buf = virt;
+               mbox->ext_buf = virt;
        } else {
                bf_set(lpfc_mbx_memory_dump_type3_length,
                       &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A2_SIZE);
@@ -8637,9 +8637,9 @@ lpfc_els_rsp_rls_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
        mb = &pmb->u.mb;
 
        ndlp = pmb->ctx_ndlp;
-       rxid = (uint16_t)((unsigned long)(pmb->ctx_buf) & 0xffff);
-       oxid = (uint16_t)(((unsigned long)(pmb->ctx_buf) >> 16) & 0xffff);
-       pmb->ctx_buf = NULL;
+       rxid = (uint16_t)((unsigned long)(pmb->context3) & 0xffff);
+       oxid = (uint16_t)(((unsigned long)(pmb->context3) >> 16) & 0xffff);
+       pmb->context3 = NULL;
        pmb->ctx_ndlp = NULL;
 
        if (mb->mbxStatus) {
@@ -8743,7 +8743,7 @@ lpfc_els_rcv_rls(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
        mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC);
        if (mbox) {
                lpfc_read_lnk_stat(phba, mbox);
-               mbox->ctx_buf = (void *)((unsigned long)
+               mbox->context3 = (void *)((unsigned long)
                                         (ox_id << 16 | ctx));
                mbox->ctx_ndlp = lpfc_nlp_get(ndlp);
                if (!mbox->ctx_ndlp)
index c1cc2850ba7101a29af89bd64a757ed18c30c0ab..e42fa9c822b50235a9421570a5816599f6463e8b 100644 (file)
@@ -3428,7 +3428,7 @@ static void
 lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 {
        MAILBOX_t *mb = &pmb->u.mb;
-       struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
+       struct lpfc_dmabuf *mp = pmb->ctx_buf;
        struct lpfc_vport  *vport = pmb->vport;
        struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
        struct serv_parm *sp = &vport->fc_sparam;
@@ -3736,7 +3736,7 @@ lpfc_mbx_cmpl_read_topology(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
        struct lpfc_mbx_read_top *la;
        struct lpfc_sli_ring *pring;
        MAILBOX_t *mb = &pmb->u.mb;
-       struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf);
+       struct lpfc_dmabuf *mp = pmb->ctx_buf;
        uint8_t attn_type;
 
        /* Unblock ELS traffic */
@@ -3850,7 +3850,7 @@ void
 lpfc_mbx_cmpl_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 {
        struct lpfc_vport  *vport = pmb->vport;
-       struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
+       struct lpfc_dmabuf *mp = pmb->ctx_buf;
        struct lpfc_nodelist *ndlp = pmb->ctx_ndlp;
 
        /* The driver calls the state machine with the pmb pointer
@@ -4065,7 +4065,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba)
                 * the dump routine is a single-use construct.
                 */
                if (pmb->ctx_buf) {
-                       mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
+                       mp = pmb->ctx_buf;
                        lpfc_mbuf_free(phba, mp->virt, mp->phys);
                        kfree(mp);
                        pmb->ctx_buf = NULL;
@@ -4088,7 +4088,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba)
 
                if (phba->sli_rev == LPFC_SLI_REV4) {
                        byte_count = pmb->u.mqe.un.mb_words[5];
-                       mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
+                       mp = pmb->ctx_buf;
                        if (byte_count > sizeof(struct static_vport_info) -
                                        offset)
                                byte_count = sizeof(struct static_vport_info)
index c4c305472285a30183057fe4782902f1b1b9b102..f7a0aa3625f4e1b63d0254a925b0cc00f7bf40ad 100644 (file)
@@ -460,7 +460,7 @@ lpfc_config_port_post(struct lpfc_hba *phba)
                return -EIO;
        }
 
-       mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
+       mp = pmb->ctx_buf;
 
        /* This dmabuf was allocated by lpfc_read_sparam. The dmabuf is no
         * longer needed.  Prevent unintended ctx_buf access as the mbox is
@@ -2217,7 +2217,7 @@ lpfc_handle_latt(struct lpfc_hba *phba)
        /* Cleanup any outstanding ELS commands */
        lpfc_els_flush_all_cmd(phba);
        psli->slistat.link_event++;
-       lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf);
+       lpfc_read_topology(phba, pmb, pmb->ctx_buf);
        pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology;
        pmb->vport = vport;
        /* Block ELS IOCBs until we have processed this mbox command */
@@ -5454,7 +5454,7 @@ lpfc_sli4_async_link_evt(struct lpfc_hba *phba,
        phba->sli.slistat.link_event++;
 
        /* Create lpfc_handle_latt mailbox command from link ACQE */
-       lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf);
+       lpfc_read_topology(phba, pmb, pmb->ctx_buf);
        pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology;
        pmb->vport = phba->pport;
 
@@ -6347,7 +6347,7 @@ lpfc_sli4_async_fc_evt(struct lpfc_hba *phba, struct lpfc_acqe_fc_la *acqe_fc)
        phba->sli.slistat.link_event++;
 
        /* Create lpfc_handle_latt mailbox command from link ACQE */
-       lpfc_read_topology(phba, pmb, (struct lpfc_dmabuf *)pmb->ctx_buf);
+       lpfc_read_topology(phba, pmb, pmb->ctx_buf);
        pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology;
        pmb->vport = phba->pport;
 
index d4c9a537f83439d9241dcd2b464e974b8d1ad2fc..eaa3f89458ec99cd052cf18ebd53f06cdb1d924c 100644 (file)
@@ -102,7 +102,7 @@ lpfc_mbox_rsrc_cleanup(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox,
 {
        struct lpfc_dmabuf *mp;
 
-       mp = (struct lpfc_dmabuf *)mbox->ctx_buf;
+       mp = mbox->ctx_buf;
        mbox->ctx_buf = NULL;
 
        /* Release the generic BPL buffer memory.  */
@@ -204,10 +204,8 @@ lpfc_dump_mem(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint16_t offset,
                uint16_t region_id)
 {
        MAILBOX_t *mb;
-       void *ctx;
 
        mb = &pmb->u.mb;
-       ctx = pmb->ctx_buf;
 
        /* Setup to dump VPD region */
        memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
@@ -219,7 +217,6 @@ lpfc_dump_mem(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, uint16_t offset,
        mb->un.varDmp.word_cnt = (DMP_RSP_SIZE / sizeof (uint32_t));
        mb->un.varDmp.co = 0;
        mb->un.varDmp.resp_offset = 0;
-       pmb->ctx_buf = ctx;
        mb->mbxOwner = OWN_HOST;
        return;
 }
@@ -236,11 +233,8 @@ void
 lpfc_dump_wakeup_param(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
 {
        MAILBOX_t *mb;
-       void *ctx;
 
        mb = &pmb->u.mb;
-       /* Save context so that we can restore after memset */
-       ctx = pmb->ctx_buf;
 
        /* Setup to dump VPD region */
        memset(pmb, 0, sizeof(LPFC_MBOXQ_t));
@@ -254,7 +248,6 @@ lpfc_dump_wakeup_param(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
        mb->un.varDmp.word_cnt = WAKE_UP_PARMS_WORD_SIZE;
        mb->un.varDmp.co = 0;
        mb->un.varDmp.resp_offset = 0;
-       pmb->ctx_buf = ctx;
        return;
 }
 
@@ -372,7 +365,7 @@ lpfc_read_topology(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb,
        /* Save address for later completion and set the owner to host so that
         * the FW knows this mailbox is available for processing.
         */
-       pmb->ctx_buf = (uint8_t *)mp;
+       pmb->ctx_buf = mp;
        mb->mbxOwner = OWN_HOST;
        return (0);
 }
@@ -2385,7 +2378,7 @@ mbx_failed:
 static void
 lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox)
 {
-       struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)mbox->ctx_buf;
+       struct lpfc_dmabuf *mp = mbox->ctx_buf;
        struct lpfc_rdp_context *rdp_context =
                        (struct lpfc_rdp_context *)(mbox->context3);
 
@@ -2416,7 +2409,7 @@ void
 lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox)
 {
        int rc;
-       struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(mbox->ctx_buf);
+       struct lpfc_dmabuf *mp = mbox->ctx_buf;
        struct lpfc_rdp_context *rdp_context =
                        (struct lpfc_rdp_context *)(mbox->context3);
 
index 8878f3c3cc2ace00f00e428592d659c5b53b0010..c6b76c3d0f707253da5385fc81db9b03e8da6d55 100644 (file)
@@ -682,7 +682,7 @@ lpfc_mbx_cmpl_resume_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
        struct lpfc_nodelist *ndlp;
        uint32_t cmd;
 
-       elsiocb = (struct lpfc_iocbq *)mboxq->ctx_buf;
+       elsiocb = mboxq->context3;
        ndlp = mboxq->ctx_ndlp;
        vport = mboxq->vport;
        cmd = elsiocb->drvrTimeout;
index 236b4e7e1de15d460cb0ee775087ff52ef649693..aa746cb0884181541b509a111e73739005dac6ab 100644 (file)
@@ -2885,7 +2885,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
        if (!test_bit(FC_UNLOADING, &phba->pport->load_flag) &&
            pmb->u.mb.mbxCommand == MBX_REG_LOGIN64 &&
            !pmb->u.mb.mbxStatus) {
-               mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
+               mp = pmb->ctx_buf;
                if (mp) {
                        pmb->ctx_buf = NULL;
                        lpfc_mbuf_free(phba, mp->virt, mp->phys);
@@ -5819,7 +5819,7 @@ lpfc_sli4_read_fcoe_params(struct lpfc_hba *phba)
                goto out_free_mboxq;
        }
 
-       mp = (struct lpfc_dmabuf *)mboxq->ctx_buf;
+       mp = mboxq->ctx_buf;
        rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
 
        lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
@@ -8766,7 +8766,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba)
 
        mboxq->vport = vport;
        rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
-       mp = (struct lpfc_dmabuf *)mboxq->ctx_buf;
+       mp = mboxq->ctx_buf;
        if (rc == MBX_SUCCESS) {
                memcpy(&vport->fc_sparam, mp->virt, sizeof(struct serv_parm));
                rc = 0;
@@ -9548,8 +9548,8 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
                }
 
                /* Copy the mailbox extension data */
-               if (pmbox->in_ext_byte_len && pmbox->ctx_buf) {
-                       lpfc_sli_pcimem_bcopy(pmbox->ctx_buf,
+               if (pmbox->in_ext_byte_len && pmbox->ext_buf) {
+                       lpfc_sli_pcimem_bcopy(pmbox->ext_buf,
                                              (uint8_t *)phba->mbox_ext,
                                              pmbox->in_ext_byte_len);
                }
@@ -9562,10 +9562,10 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
                                = MAILBOX_HBA_EXT_OFFSET;
 
                /* Copy the mailbox extension data */
-               if (pmbox->in_ext_byte_len && pmbox->ctx_buf)
+               if (pmbox->in_ext_byte_len && pmbox->ext_buf)
                        lpfc_memcpy_to_slim(phba->MBslimaddr +
                                MAILBOX_HBA_EXT_OFFSET,
-                               pmbox->ctx_buf, pmbox->in_ext_byte_len);
+                               pmbox->ext_buf, pmbox->in_ext_byte_len);
 
                if (mbx->mbxCommand == MBX_CONFIG_PORT)
                        /* copy command data into host mbox for cmpl */
@@ -9688,9 +9688,9 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
                        lpfc_sli_pcimem_bcopy(phba->mbox, mbx,
                                                MAILBOX_CMD_SIZE);
                        /* Copy the mailbox extension data */
-                       if (pmbox->out_ext_byte_len && pmbox->ctx_buf) {
+                       if (pmbox->out_ext_byte_len && pmbox->ext_buf) {
                                lpfc_sli_pcimem_bcopy(phba->mbox_ext,
-                                                     pmbox->ctx_buf,
+                                                     pmbox->ext_buf,
                                                      pmbox->out_ext_byte_len);
                        }
                } else {
@@ -9698,9 +9698,9 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox,
                        lpfc_memcpy_from_slim(mbx, phba->MBslimaddr,
                                                MAILBOX_CMD_SIZE);
                        /* Copy the mailbox extension data */
-                       if (pmbox->out_ext_byte_len && pmbox->ctx_buf) {
+                       if (pmbox->out_ext_byte_len && pmbox->ext_buf) {
                                lpfc_memcpy_from_slim(
-                                       pmbox->ctx_buf,
+                                       pmbox->ext_buf,
                                        phba->MBslimaddr +
                                        MAILBOX_HBA_EXT_OFFSET,
                                        pmbox->out_ext_byte_len);
@@ -13813,10 +13813,10 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id)
                                        lpfc_sli_pcimem_bcopy(mbox, pmbox,
                                                        MAILBOX_CMD_SIZE);
                                        if (pmb->out_ext_byte_len &&
-                                               pmb->ctx_buf)
+                                               pmb->ext_buf)
                                                lpfc_sli_pcimem_bcopy(
                                                phba->mbox_ext,
-                                               pmb->ctx_buf,
+                                               pmb->ext_buf,
                                                pmb->out_ext_byte_len);
                                }
                                if (pmb->mbox_flag & LPFC_MBX_IMED_UNREG) {
@@ -13830,8 +13830,7 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id)
                                                pmbox->un.varWords[0], 0);
 
                                        if (!pmbox->mbxStatus) {
-                                               mp = (struct lpfc_dmabuf *)
-                                                       (pmb->ctx_buf);
+                                               mp = pmb->ctx_buf;
                                                ndlp = pmb->ctx_ndlp;
 
                                                /* Reg_LOGIN of dflt RPI was
@@ -14339,7 +14338,7 @@ lpfc_sli4_sp_handle_mbox_event(struct lpfc_hba *phba, struct lpfc_mcqe *mcqe)
                                      mcqe_status,
                                      pmbox->un.varWords[0], 0);
                if (mcqe_status == MB_CQE_STATUS_SUCCESS) {
-                       mp = (struct lpfc_dmabuf *)(pmb->ctx_buf);
+                       mp = pmb->ctx_buf;
                        ndlp = pmb->ctx_ndlp;
 
                        /* Reg_LOGIN of dflt RPI was successful. Mark the
@@ -19858,7 +19857,7 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp,
        lpfc_resume_rpi(mboxq, ndlp);
        if (cmpl) {
                mboxq->mbox_cmpl = cmpl;
-               mboxq->ctx_buf = arg;
+               mboxq->context3 = arg;
        } else
                mboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
        mboxq->ctx_ndlp = ndlp;
@@ -20675,7 +20674,7 @@ lpfc_sli4_get_config_region23(struct lpfc_hba *phba, char *rgn23_data)
        if (lpfc_sli4_dump_cfg_rg23(phba, mboxq))
                goto out;
        mqe = &mboxq->u.mqe;
-       mp = (struct lpfc_dmabuf *)mboxq->ctx_buf;
+       mp = mboxq->ctx_buf;
        rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
        if (rc)
                goto out;
index 60332de27f44209a36b32ca6405f3918a8aa3d78..29fdccd689af0970a13cb1438676585a4051f0b5 100644 (file)
@@ -183,7 +183,11 @@ typedef struct lpfcMboxq {
        } u;
        struct lpfc_vport *vport; /* virtual port pointer */
        struct lpfc_nodelist *ctx_ndlp; /* caller ndlp pointer */
-       void *ctx_buf;                  /* caller buffer information */
+       struct lpfc_dmabuf *ctx_buf;    /* caller buffer information */
+       void *ext_buf;                  /* extended buffer for extended mbox
+                                        * cmds.  Not a generic pointer.
+                                        * Use for storing virtual address.
+                                        */
        void *context3;                 /* a generic pointer.  Code must
                                         * accommodate the actual datatype.
                                         */
index 9850080ee33d174f7c3e627930ab4b2b1ba876a2..4439167a51882dedf10de9ade9c30c12bca8dfb1 100644 (file)
@@ -166,7 +166,7 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport)
                }
        }
 
-       mp = (struct lpfc_dmabuf *)pmb->ctx_buf;
+       mp = pmb->ctx_buf;
        memcpy(&vport->fc_sparam, mp->virt, sizeof (struct serv_parm));
        memcpy(&vport->fc_nodename, &vport->fc_sparam.nodeName,
               sizeof (struct lpfc_name));