Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: lpfc: refactor mailbox structure context fields

The driver data structure for managing a mailbox command contained two
context fields. Unfortunately, the context were considered "generic" to be
used at the whim of the command code. Of course, one section of code used
fields this way, while another did it that way, and eventually there were
mixups.

Refactored the structure so that the generic contexts become a node context
and a buffer context and all code standardizes on their use.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

James Smart and committed by
Martin K. Petersen
3e1f0718 0f31e959

+165 -161
+5 -5
drivers/scsi/lpfc/lpfc_attr.c
··· 1688 1688 pmb = &pmboxq->u.mb; 1689 1689 pmb->mbxCommand = MBX_READ_CONFIG; 1690 1690 pmb->mbxOwner = OWN_HOST; 1691 - pmboxq->context1 = NULL; 1691 + pmboxq->ctx_buf = NULL; 1692 1692 1693 1693 if (phba->pport->fc_flag & FC_OFFLINE_MODE) 1694 1694 rc = MBX_NOT_FINISHED; ··· 6219 6219 pmb = &pmboxq->u.mb; 6220 6220 pmb->mbxCommand = MBX_READ_STATUS; 6221 6221 pmb->mbxOwner = OWN_HOST; 6222 - pmboxq->context1 = NULL; 6222 + pmboxq->ctx_buf = NULL; 6223 6223 pmboxq->vport = vport; 6224 6224 6225 6225 if (vport->fc_flag & FC_OFFLINE_MODE) ··· 6251 6251 memset(pmboxq, 0, sizeof (LPFC_MBOXQ_t)); 6252 6252 pmb->mbxCommand = MBX_READ_LNK_STAT; 6253 6253 pmb->mbxOwner = OWN_HOST; 6254 - pmboxq->context1 = NULL; 6254 + pmboxq->ctx_buf = NULL; 6255 6255 pmboxq->vport = vport; 6256 6256 6257 6257 if (vport->fc_flag & FC_OFFLINE_MODE) ··· 6331 6331 pmb->mbxCommand = MBX_READ_STATUS; 6332 6332 pmb->mbxOwner = OWN_HOST; 6333 6333 pmb->un.varWords[0] = 0x1; /* reset request */ 6334 - pmboxq->context1 = NULL; 6334 + pmboxq->ctx_buf = NULL; 6335 6335 pmboxq->vport = vport; 6336 6336 6337 6337 if ((vport->fc_flag & FC_OFFLINE_MODE) || ··· 6349 6349 memset(pmboxq, 0, sizeof(LPFC_MBOXQ_t)); 6350 6350 pmb->mbxCommand = MBX_READ_LNK_STAT; 6351 6351 pmb->mbxOwner = OWN_HOST; 6352 - pmboxq->context1 = NULL; 6352 + pmboxq->ctx_buf = NULL; 6353 6353 pmboxq->vport = vport; 6354 6354 6355 6355 if ((vport->fc_flag & FC_OFFLINE_MODE) ||
+10 -10
drivers/scsi/lpfc/lpfc_bsg.c
··· 2501 2501 return -ENOMEM; 2502 2502 } 2503 2503 2504 - dmabuff = (struct lpfc_dmabuf *) mbox->context1; 2505 - mbox->context1 = NULL; 2506 - mbox->context2 = NULL; 2504 + dmabuff = (struct lpfc_dmabuf *)mbox->ctx_buf; 2505 + mbox->ctx_buf = NULL; 2506 + mbox->ctx_ndlp = NULL; 2507 2507 status = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO); 2508 2508 2509 2509 if ((status != MBX_SUCCESS) || (mbox->u.mb.mbxStatus)) { ··· 3388 3388 unsigned long flags; 3389 3389 uint8_t *pmb, *pmb_buf; 3390 3390 3391 - dd_data = pmboxq->context1; 3391 + dd_data = pmboxq->ctx_ndlp; 3392 3392 3393 3393 /* 3394 3394 * The outgoing buffer is readily referred from the dma buffer, ··· 3573 3573 struct lpfc_sli_config_mbox *sli_cfg_mbx; 3574 3574 uint8_t *pmbx; 3575 3575 3576 - dd_data = pmboxq->context1; 3576 + dd_data = pmboxq->ctx_buf; 3577 3577 3578 3578 /* Determine if job has been aborted */ 3579 3579 spin_lock_irqsave(&phba->ct_ev_lock, flags); ··· 3960 3960 pmboxq->mbox_cmpl = lpfc_bsg_issue_read_mbox_ext_cmpl; 3961 3961 3962 3962 /* context fields to callback function */ 3963 - pmboxq->context1 = dd_data; 3963 + pmboxq->ctx_buf = dd_data; 3964 3964 dd_data->type = TYPE_MBOX; 3965 3965 dd_data->set_job = job; 3966 3966 dd_data->context_un.mbox.pmboxq = pmboxq; ··· 4131 4131 pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; 4132 4132 4133 4133 /* context fields to callback function */ 4134 - pmboxq->context1 = dd_data; 4134 + pmboxq->ctx_buf = dd_data; 4135 4135 dd_data->type = TYPE_MBOX; 4136 4136 dd_data->set_job = job; 4137 4137 dd_data->context_un.mbox.pmboxq = pmboxq; ··· 4476 4476 pmboxq->mbox_cmpl = lpfc_bsg_issue_write_mbox_ext_cmpl; 4477 4477 4478 4478 /* context fields to callback function */ 4479 - pmboxq->context1 = dd_data; 4479 + pmboxq->ctx_buf = dd_data; 4480 4480 dd_data->type = TYPE_MBOX; 4481 4481 dd_data->set_job = job; 4482 4482 dd_data->context_un.mbox.pmboxq = pmboxq; ··· 4761 4761 if (mbox_req->inExtWLen || mbox_req->outExtWLen) { 4762 4762 from = pmbx; 4763 4763 ext = from + sizeof(MAILBOX_t); 4764 - pmboxq->context2 = ext; 4764 + pmboxq->ctx_buf = ext; 4765 4765 pmboxq->in_ext_byte_len = 4766 4766 mbox_req->inExtWLen * sizeof(uint32_t); 4767 4767 pmboxq->out_ext_byte_len = ··· 4889 4889 pmboxq->mbox_cmpl = lpfc_bsg_issue_mbox_cmpl; 4890 4890 4891 4891 /* setup context field to pass wait_queue pointer to wake function */ 4892 - pmboxq->context1 = dd_data; 4892 + pmboxq->ctx_ndlp = dd_data; 4893 4893 dd_data->type = TYPE_MBOX; 4894 4894 dd_data->set_job = job; 4895 4895 dd_data->context_un.mbox.pmboxq = pmboxq;
+32 -32
drivers/scsi/lpfc/lpfc_els.c
··· 415 415 /* increment the reference count on ndlp to hold reference 416 416 * for the callback routine. 417 417 */ 418 - mbox->context2 = lpfc_nlp_get(ndlp); 418 + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); 419 419 420 420 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); 421 421 if (rc == MBX_NOT_FINISHED) { ··· 430 430 * for the failed mbox command. 431 431 */ 432 432 lpfc_nlp_put(ndlp); 433 - mp = (struct lpfc_dmabuf *) mbox->context1; 433 + mp = (struct lpfc_dmabuf *)mbox->ctx_buf; 434 434 lpfc_mbuf_free(phba, mp->virt, mp->phys); 435 435 kfree(mp); 436 436 fail_free_mbox: ··· 504 504 505 505 mboxq->mbox_cmpl = lpfc_mbx_cmpl_reg_vfi; 506 506 mboxq->vport = vport; 507 - mboxq->context1 = dmabuf; 507 + mboxq->ctx_buf = dmabuf; 508 508 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT); 509 509 if (rc == MBX_NOT_FINISHED) { 510 510 rc = -ENXIO; ··· 3990 3990 void 3991 3991 lpfc_mbx_cmpl_dflt_rpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) 3992 3992 { 3993 - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); 3994 - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2; 3993 + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); 3994 + struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 3995 3995 3996 - pmb->context1 = NULL; 3997 - pmb->context2 = NULL; 3996 + pmb->ctx_buf = NULL; 3997 + pmb->ctx_ndlp = NULL; 3998 3998 3999 3999 lpfc_mbuf_free(phba, mp->virt, mp->phys); 4000 4000 kfree(mp); ··· 4070 4070 /* Check to see if link went down during discovery */ 4071 4071 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) || lpfc_els_chk_latt(vport)) { 4072 4072 if (mbox) { 4073 - mp = (struct lpfc_dmabuf *) mbox->context1; 4073 + mp = (struct lpfc_dmabuf *)mbox->ctx_buf; 4074 4074 if (mp) { 4075 4075 lpfc_mbuf_free(phba, mp->virt, mp->phys); 4076 4076 kfree(mp); ··· 4114 4114 "Data: x%x x%x x%x\n", 4115 4115 ndlp->nlp_DID, ndlp->nlp_state, 4116 4116 ndlp->nlp_rpi, ndlp->nlp_flag); 4117 - mp = mbox->context1; 4117 + mp = mbox->ctx_buf; 4118 4118 if (mp) { 4119 4119 lpfc_mbuf_free(phba, mp->virt, 4120 4120 mp->phys); ··· 4127 4127 /* Increment reference count to ndlp to hold the 4128 4128 * reference to ndlp for the callback function. 4129 4129 */ 4130 - mbox->context2 = lpfc_nlp_get(ndlp); 4130 + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); 4131 4131 mbox->vport = vport; 4132 4132 if (ndlp->nlp_flag & NLP_RM_DFLT_RPI) { 4133 4133 mbox->mbox_flag |= LPFC_MBX_IMED_UNREG; ··· 4181 4181 } 4182 4182 } 4183 4183 } 4184 - mp = (struct lpfc_dmabuf *) mbox->context1; 4184 + mp = (struct lpfc_dmabuf *)mbox->ctx_buf; 4185 4185 if (mp) { 4186 4186 lpfc_mbuf_free(phba, mp->virt, mp->phys); 4187 4187 kfree(mp); ··· 5597 5597 goto prep_mbox_fail; 5598 5598 mbox->vport = rdp_context->ndlp->vport; 5599 5599 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a0; 5600 - mbox->context2 = (struct lpfc_rdp_context *) rdp_context; 5600 + mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; 5601 5601 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); 5602 5602 if (rc == MBX_NOT_FINISHED) 5603 5603 goto issue_mbox_fail; ··· 5722 5722 int rc; 5723 5723 5724 5724 mb = &pmb->u.mb; 5725 - lcb_context = (struct lpfc_lcb_context *)pmb->context1; 5725 + lcb_context = (struct lpfc_lcb_context *)pmb->ctx_ndlp; 5726 5726 ndlp = lcb_context->ndlp; 5727 - pmb->context1 = NULL; 5728 - pmb->context2 = NULL; 5727 + pmb->ctx_ndlp = NULL; 5728 + pmb->ctx_buf = NULL; 5729 5729 5730 5730 shdr = (union lpfc_sli4_cfg_shdr *) 5731 5731 &pmb->u.mqe.un.beacon_config.header.cfg_shdr; ··· 5832 5832 lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_COMMON, 5833 5833 LPFC_MBOX_OPCODE_SET_BEACON_CONFIG, len, 5834 5834 LPFC_SLI4_MBX_EMBED); 5835 - mbox->context1 = (void *)lcb_context; 5835 + mbox->ctx_ndlp = (void *)lcb_context; 5836 5836 mbox->vport = phba->pport; 5837 5837 mbox->mbox_cmpl = lpfc_els_lcb_rsp; 5838 5838 bf_set(lpfc_mbx_set_beacon_port_num, &mbox->u.mqe.un.beacon_config, ··· 6758 6758 6759 6759 mb = &pmb->u.mb; 6760 6760 6761 - ndlp = (struct lpfc_nodelist *) pmb->context2; 6762 - rxid = (uint16_t) ((unsigned long)(pmb->context1) & 0xffff); 6763 - oxid = (uint16_t) (((unsigned long)(pmb->context1) >> 16) & 0xffff); 6764 - pmb->context1 = NULL; 6765 - pmb->context2 = NULL; 6761 + ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 6762 + rxid = (uint16_t)((unsigned long)(pmb->ctx_buf) & 0xffff); 6763 + oxid = (uint16_t)(((unsigned long)(pmb->ctx_buf) >> 16) & 0xffff); 6764 + pmb->ctx_buf = NULL; 6765 + pmb->ctx_ndlp = NULL; 6766 6766 6767 6767 if (mb->mbxStatus) { 6768 6768 mempool_free(pmb, phba->mbox_mem_pool); ··· 6846 6846 6847 6847 mb = &pmb->u.mb; 6848 6848 6849 - ndlp = (struct lpfc_nodelist *) pmb->context2; 6850 - rxid = (uint16_t) ((unsigned long)(pmb->context1) & 0xffff); 6851 - oxid = (uint16_t) (((unsigned long)(pmb->context1) >> 16) & 0xffff); 6852 - pmb->context1 = NULL; 6853 - pmb->context2 = NULL; 6849 + ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 6850 + rxid = (uint16_t)((unsigned long)(pmb->ctx_buf) & 0xffff); 6851 + oxid = (uint16_t)(((unsigned long)(pmb->ctx_buf) >> 16) & 0xffff); 6852 + pmb->ctx_ndlp = NULL; 6853 + pmb->ctx_buf = NULL; 6854 6854 6855 6855 if (mb->mbxStatus) { 6856 6856 mempool_free(pmb, phba->mbox_mem_pool); ··· 6941 6941 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC); 6942 6942 if (mbox) { 6943 6943 lpfc_read_lnk_stat(phba, mbox); 6944 - mbox->context1 = (void *)((unsigned long) 6944 + mbox->ctx_buf = (void *)((unsigned long) 6945 6945 ((cmdiocb->iocb.unsli3.rcvsli3.ox_id << 16) | 6946 6946 cmdiocb->iocb.ulpContext)); /* rx_id */ 6947 - mbox->context2 = lpfc_nlp_get(ndlp); 6947 + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); 6948 6948 mbox->vport = vport; 6949 6949 mbox->mbox_cmpl = lpfc_els_rsp_rls_acc; 6950 6950 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) ··· 7104 7104 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_ATOMIC); 7105 7105 if (mbox) { 7106 7106 lpfc_read_lnk_stat(phba, mbox); 7107 - mbox->context1 = (void *)((unsigned long) 7107 + mbox->ctx_buf = (void *)((unsigned long) 7108 7108 ((cmdiocb->iocb.unsli3.rcvsli3.ox_id << 16) | 7109 7109 cmdiocb->iocb.ulpContext)); /* rx_id */ 7110 - mbox->context2 = lpfc_nlp_get(ndlp); 7110 + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); 7111 7111 mbox->vport = vport; 7112 7112 mbox->mbox_cmpl = lpfc_els_rsp_rps_acc; 7113 7113 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) ··· 8602 8602 { 8603 8603 struct lpfc_vport *vport = pmb->vport; 8604 8604 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 8605 - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2; 8605 + struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 8606 8606 MAILBOX_t *mb = &pmb->u.mb; 8607 8607 int rc; 8608 8608 ··· 8720 8720 if (mbox) { 8721 8721 lpfc_reg_vpi(vport, mbox); 8722 8722 mbox->vport = vport; 8723 - mbox->context2 = lpfc_nlp_get(ndlp); 8723 + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); 8724 8724 mbox->mbox_cmpl = lpfc_cmpl_reg_new_vport; 8725 8725 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) 8726 8726 == MBX_NOT_FINISHED) {
+38 -38
drivers/scsi/lpfc/lpfc_hbadisc.c
··· 2944 2944 void 2945 2945 lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) 2946 2946 { 2947 - struct lpfc_dmabuf *dmabuf = mboxq->context1; 2947 + struct lpfc_dmabuf *dmabuf = mboxq->ctx_buf; 2948 2948 struct lpfc_vport *vport = mboxq->vport; 2949 2949 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2950 2950 ··· 3037 3037 lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) 3038 3038 { 3039 3039 MAILBOX_t *mb = &pmb->u.mb; 3040 - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) pmb->context1; 3040 + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)pmb->ctx_buf; 3041 3041 struct lpfc_vport *vport = pmb->vport; 3042 3042 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 3043 3043 struct serv_parm *sp = &vport->fc_sparam; ··· 3081 3081 return; 3082 3082 3083 3083 out: 3084 - pmb->context1 = NULL; 3084 + pmb->ctx_buf = NULL; 3085 3085 lpfc_mbuf_free(phba, mp->virt, mp->phys); 3086 3086 kfree(mp); 3087 3087 lpfc_issue_clear_la(phba, vport); ··· 3220 3220 sparam_mbox->mbox_cmpl = lpfc_mbx_cmpl_read_sparam; 3221 3221 rc = lpfc_sli_issue_mbox(phba, sparam_mbox, MBX_NOWAIT); 3222 3222 if (rc == MBX_NOT_FINISHED) { 3223 - mp = (struct lpfc_dmabuf *) sparam_mbox->context1; 3223 + mp = (struct lpfc_dmabuf *)sparam_mbox->ctx_buf; 3224 3224 lpfc_mbuf_free(phba, mp->virt, mp->phys); 3225 3225 kfree(mp); 3226 3226 mempool_free(sparam_mbox, phba->mbox_mem_pool); ··· 3349 3349 struct lpfc_mbx_read_top *la; 3350 3350 struct lpfc_sli_ring *pring; 3351 3351 MAILBOX_t *mb = &pmb->u.mb; 3352 - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); 3352 + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); 3353 3353 uint8_t attn_type; 3354 3354 3355 3355 /* Unblock ELS traffic */ ··· 3506 3506 lpfc_mbx_cmpl_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) 3507 3507 { 3508 3508 struct lpfc_vport *vport = pmb->vport; 3509 - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); 3510 - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2; 3509 + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); 3510 + struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 3511 3511 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 3512 3512 3513 - pmb->context1 = NULL; 3514 - pmb->context2 = NULL; 3513 + pmb->ctx_buf = NULL; 3514 + pmb->ctx_ndlp = NULL; 3515 3515 3516 3516 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, 3517 3517 "0002 rpi:%x DID:%x flg:%x %d map:%x %p\n", ··· 3719 3719 vport_buff = (uint8_t *) vport_info; 3720 3720 do { 3721 3721 /* free dma buffer from previous round */ 3722 - if (pmb->context1) { 3723 - mp = (struct lpfc_dmabuf *)pmb->context1; 3722 + if (pmb->ctx_buf) { 3723 + mp = (struct lpfc_dmabuf *)pmb->ctx_buf; 3724 3724 lpfc_mbuf_free(phba, mp->virt, mp->phys); 3725 3725 kfree(mp); 3726 3726 } ··· 3742 3742 3743 3743 if (phba->sli_rev == LPFC_SLI_REV4) { 3744 3744 byte_count = pmb->u.mqe.un.mb_words[5]; 3745 - mp = (struct lpfc_dmabuf *)pmb->context1; 3745 + mp = (struct lpfc_dmabuf *)pmb->ctx_buf; 3746 3746 if (byte_count > sizeof(struct static_vport_info) - 3747 3747 offset) 3748 3748 byte_count = sizeof(struct static_vport_info) ··· 3807 3807 out: 3808 3808 kfree(vport_info); 3809 3809 if (mbx_wait_rc != MBX_TIMEOUT) { 3810 - if (pmb->context1) { 3811 - mp = (struct lpfc_dmabuf *)pmb->context1; 3810 + if (pmb->ctx_buf) { 3811 + mp = (struct lpfc_dmabuf *)pmb->ctx_buf; 3812 3812 lpfc_mbuf_free(phba, mp->virt, mp->phys); 3813 3813 kfree(mp); 3814 3814 } ··· 3829 3829 { 3830 3830 struct lpfc_vport *vport = pmb->vport; 3831 3831 MAILBOX_t *mb = &pmb->u.mb; 3832 - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); 3832 + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); 3833 3833 struct lpfc_nodelist *ndlp; 3834 3834 struct Scsi_Host *shost; 3835 3835 3836 - ndlp = (struct lpfc_nodelist *) pmb->context2; 3837 - pmb->context1 = NULL; 3838 - pmb->context2 = NULL; 3836 + ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 3837 + pmb->ctx_ndlp = NULL; 3838 + pmb->ctx_buf = NULL; 3839 3839 3840 3840 if (mb->mbxStatus) { 3841 3841 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, ··· 3982 3982 lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) 3983 3983 { 3984 3984 MAILBOX_t *mb = &pmb->u.mb; 3985 - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); 3986 - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2; 3985 + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); 3986 + struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 3987 3987 struct lpfc_vport *vport = pmb->vport; 3988 3988 3989 - pmb->context1 = NULL; 3990 - pmb->context2 = NULL; 3989 + pmb->ctx_buf = NULL; 3990 + pmb->ctx_ndlp = NULL; 3991 3991 vport->gidft_inp = 0; 3992 3992 3993 3993 if (mb->mbxStatus) { ··· 4756 4756 struct lpfc_vport *vport = pmb->vport; 4757 4757 struct lpfc_nodelist *ndlp; 4758 4758 4759 - ndlp = (struct lpfc_nodelist *)(pmb->context1); 4759 + ndlp = (struct lpfc_nodelist *)(pmb->ctx_ndlp); 4760 4760 if (!ndlp) 4761 4761 return; 4762 4762 lpfc_issue_els_logo(vport, ndlp, 0); ··· 4799 4799 lpfc_unreg_login(phba, vport->vpi, rpi, mbox); 4800 4800 mbox->vport = vport; 4801 4801 if (ndlp->nlp_flag & NLP_ISSUE_LOGO) { 4802 - mbox->context1 = ndlp; 4802 + mbox->ctx_ndlp = ndlp; 4803 4803 mbox->mbox_cmpl = lpfc_nlp_logo_unreg; 4804 4804 } else { 4805 4805 if (phba->sli_rev == LPFC_SLI_REV4 && ··· 4808 4808 &phba->sli4_hba.sli_intf) == 4809 4809 LPFC_SLI_INTF_IF_TYPE_2) && 4810 4810 (kref_read(&ndlp->kref) > 0)) { 4811 - mbox->context1 = lpfc_nlp_get(ndlp); 4811 + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); 4812 4812 mbox->mbox_cmpl = 4813 4813 lpfc_sli4_unreg_rpi_cmpl_clr; 4814 4814 /* ··· 4895 4895 mbox); 4896 4896 mbox->vport = vport; 4897 4897 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 4898 - mbox->context1 = NULL; 4898 + mbox->ctx_ndlp = NULL; 4899 4899 rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO); 4900 4900 if (rc != MBX_TIMEOUT) 4901 4901 mempool_free(mbox, phba->mbox_mem_pool); ··· 4920 4920 mbox); 4921 4921 mbox->vport = vport; 4922 4922 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 4923 - mbox->context1 = NULL; 4923 + mbox->ctx_ndlp = NULL; 4924 4924 rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO); 4925 4925 if (rc != MBX_TIMEOUT) 4926 4926 mempool_free(mbox, phba->mbox_mem_pool); ··· 4974 4974 if ((mb = phba->sli.mbox_active)) { 4975 4975 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && 4976 4976 !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) && 4977 - (ndlp == (struct lpfc_nodelist *) mb->context2)) { 4978 - mb->context2 = NULL; 4977 + (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { 4978 + mb->ctx_ndlp = NULL; 4979 4979 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 4980 4980 } 4981 4981 } ··· 4985 4985 list_for_each_entry(mb, &phba->sli.mboxq_cmpl, list) { 4986 4986 if ((mb->u.mb.mbxCommand != MBX_REG_LOGIN64) || 4987 4987 (mb->mbox_flag & LPFC_MBX_IMED_UNREG) || 4988 - (ndlp != (struct lpfc_nodelist *) mb->context2)) 4988 + (ndlp != (struct lpfc_nodelist *)mb->ctx_ndlp)) 4989 4989 continue; 4990 4990 4991 - mb->context2 = NULL; 4991 + mb->ctx_ndlp = NULL; 4992 4992 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 4993 4993 } 4994 4994 4995 4995 list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { 4996 4996 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && 4997 4997 !(mb->mbox_flag & LPFC_MBX_IMED_UNREG) && 4998 - (ndlp == (struct lpfc_nodelist *) mb->context2)) { 4999 - mp = (struct lpfc_dmabuf *) (mb->context1); 4998 + (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { 4999 + mp = (struct lpfc_dmabuf *)(mb->ctx_buf); 5000 5000 if (mp) { 5001 5001 __lpfc_mbuf_free(phba, mp->virt, mp->phys); 5002 5002 kfree(mp); ··· 5066 5066 mbox->mbox_flag |= LPFC_MBX_IMED_UNREG; 5067 5067 mbox->mbox_cmpl = lpfc_mbx_cmpl_dflt_rpi; 5068 5068 mbox->vport = vport; 5069 - mbox->context2 = ndlp; 5069 + mbox->ctx_ndlp = ndlp; 5070 5070 rc =lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); 5071 5071 if (rc == MBX_NOT_FINISHED) { 5072 5072 mempool_free(mbox, phba->mbox_mem_pool); ··· 5831 5831 lpfc_mbx_cmpl_fdmi_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) 5832 5832 { 5833 5833 MAILBOX_t *mb = &pmb->u.mb; 5834 - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); 5835 - struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2; 5834 + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); 5835 + struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 5836 5836 struct lpfc_vport *vport = pmb->vport; 5837 5837 5838 - pmb->context1 = NULL; 5839 - pmb->context2 = NULL; 5838 + pmb->ctx_buf = NULL; 5839 + pmb->ctx_ndlp = NULL; 5840 5840 5841 5841 if (phba->sli_rev < LPFC_SLI_REV4) 5842 5842 ndlp->nlp_rpi = mb->un.varWords[0];
+3 -3
drivers/scsi/lpfc/lpfc_init.c
··· 443 443 "READ_SPARM mbxStatus x%x\n", 444 444 mb->mbxCommand, mb->mbxStatus); 445 445 phba->link_state = LPFC_HBA_ERROR; 446 - mp = (struct lpfc_dmabuf *) pmb->context1; 446 + mp = (struct lpfc_dmabuf *)pmb->ctx_buf; 447 447 mempool_free(pmb, phba->mbox_mem_pool); 448 448 lpfc_mbuf_free(phba, mp->virt, mp->phys); 449 449 kfree(mp); 450 450 return -EIO; 451 451 } 452 452 453 - mp = (struct lpfc_dmabuf *) pmb->context1; 453 + mp = (struct lpfc_dmabuf *)pmb->ctx_buf; 454 454 455 455 memcpy(&vport->fc_sparam, mp->virt, sizeof (struct serv_parm)); 456 456 lpfc_mbuf_free(phba, mp->virt, mp->phys); 457 457 kfree(mp); 458 - pmb->context1 = NULL; 458 + pmb->ctx_buf = NULL; 459 459 lpfc_update_vport_wwn(vport); 460 460 461 461 /* Update the fc_host data structures with new wwn. */
+19 -19
drivers/scsi/lpfc/lpfc_mbox.c
··· 94 94 memset(mp->virt, 0, LPFC_BPL_SIZE); 95 95 INIT_LIST_HEAD(&mp->list); 96 96 /* save address for completion */ 97 - pmb->context1 = (uint8_t *)mp; 97 + pmb->ctx_buf = (uint8_t *)mp; 98 98 mb->un.varWords[3] = putPaddrLow(mp->phys); 99 99 mb->un.varWords[4] = putPaddrHigh(mp->phys); 100 100 mb->un.varDmp.sli4_length = sizeof(struct static_vport_info); ··· 139 139 void *ctx; 140 140 141 141 mb = &pmb->u.mb; 142 - ctx = pmb->context2; 142 + ctx = pmb->ctx_buf; 143 143 144 144 /* Setup to dump VPD region */ 145 145 memset(pmb, 0, sizeof (LPFC_MBOXQ_t)); ··· 151 151 mb->un.varDmp.word_cnt = (DMP_RSP_SIZE / sizeof (uint32_t)); 152 152 mb->un.varDmp.co = 0; 153 153 mb->un.varDmp.resp_offset = 0; 154 - pmb->context2 = ctx; 154 + pmb->ctx_buf = ctx; 155 155 mb->mbxOwner = OWN_HOST; 156 156 return; 157 157 } ··· 172 172 173 173 mb = &pmb->u.mb; 174 174 /* Save context so that we can restore after memset */ 175 - ctx = pmb->context2; 175 + ctx = pmb->ctx_buf; 176 176 177 177 /* Setup to dump VPD region */ 178 178 memset(pmb, 0, sizeof(LPFC_MBOXQ_t)); ··· 186 186 mb->un.varDmp.word_cnt = WAKE_UP_PARMS_WORD_SIZE; 187 187 mb->un.varDmp.co = 0; 188 188 mb->un.varDmp.resp_offset = 0; 189 - pmb->context2 = ctx; 189 + pmb->ctx_buf = ctx; 190 190 return; 191 191 } 192 192 ··· 304 304 /* Save address for later completion and set the owner to host so that 305 305 * the FW knows this mailbox is available for processing. 306 306 */ 307 - pmb->context1 = (uint8_t *)mp; 307 + pmb->ctx_buf = (uint8_t *)mp; 308 308 mb->mbxOwner = OWN_HOST; 309 309 return (0); 310 310 } ··· 631 631 mb->un.varRdSparm.vpi = phba->vpi_ids[vpi]; 632 632 633 633 /* save address for completion */ 634 - pmb->context1 = mp; 634 + pmb->ctx_buf = mp; 635 635 636 636 return (0); 637 637 } ··· 783 783 memcpy(sparam, param, sizeof (struct serv_parm)); 784 784 785 785 /* save address for completion */ 786 - pmb->context1 = (uint8_t *) mp; 786 + pmb->ctx_buf = (uint8_t *)mp; 787 787 788 788 mb->mbxCommand = MBX_REG_LOGIN64; 789 789 mb->un.varRegLogin.un.sp64.tus.f.bdeSize = sizeof (struct serv_parm); ··· 858 858 mbox->u.mb.un.varUnregLogin.rsvd1 = 0x4000; 859 859 mbox->vport = vport; 860 860 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 861 - mbox->context1 = NULL; 861 + mbox->ctx_ndlp = NULL; 862 862 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); 863 863 if (rc == MBX_NOT_FINISHED) 864 864 mempool_free(mbox, phba->mbox_mem_pool); ··· 2288 2288 INIT_LIST_HEAD(&mp->list); 2289 2289 2290 2290 /* save address for completion */ 2291 - mbox->context1 = (uint8_t *) mp; 2291 + mbox->ctx_buf = (uint8_t *)mp; 2292 2292 2293 2293 mb->mbxCommand = MBX_DUMP_MEMORY; 2294 2294 mb->un.varDmp.type = DMP_NV_PARAMS; ··· 2305 2305 MAILBOX_t *mb; 2306 2306 int rc = FAILURE; 2307 2307 struct lpfc_rdp_context *rdp_context = 2308 - (struct lpfc_rdp_context *)(mboxq->context2); 2308 + (struct lpfc_rdp_context *)(mboxq->ctx_ndlp); 2309 2309 2310 2310 mb = &mboxq->u.mb; 2311 2311 if (mb->mbxStatus) ··· 2323 2323 static void 2324 2324 lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) 2325 2325 { 2326 - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) mbox->context1; 2326 + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)mbox->ctx_buf; 2327 2327 struct lpfc_rdp_context *rdp_context = 2328 - (struct lpfc_rdp_context *)(mbox->context2); 2328 + (struct lpfc_rdp_context *)(mbox->ctx_ndlp); 2329 2329 2330 2330 if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) 2331 2331 goto error_mbuf_free; ··· 2341 2341 lpfc_read_lnk_stat(phba, mbox); 2342 2342 mbox->vport = rdp_context->ndlp->vport; 2343 2343 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat; 2344 - mbox->context2 = (struct lpfc_rdp_context *) rdp_context; 2344 + mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; 2345 2345 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) == MBX_NOT_FINISHED) 2346 2346 goto error_cmd_free; 2347 2347 ··· 2359 2359 lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) 2360 2360 { 2361 2361 int rc; 2362 - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (mbox->context1); 2362 + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); 2363 2363 struct lpfc_rdp_context *rdp_context = 2364 - (struct lpfc_rdp_context *)(mbox->context2); 2364 + (struct lpfc_rdp_context *)(mbox->ctx_ndlp); 2365 2365 2366 2366 if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) 2367 2367 goto error; ··· 2375 2375 INIT_LIST_HEAD(&mp->list); 2376 2376 2377 2377 /* save address for completion */ 2378 - mbox->context1 = mp; 2378 + mbox->ctx_buf = mp; 2379 2379 mbox->vport = rdp_context->ndlp->vport; 2380 2380 2381 2381 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_DUMP_MEMORY); ··· 2391 2391 mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); 2392 2392 2393 2393 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a2; 2394 - mbox->context2 = (struct lpfc_rdp_context *) rdp_context; 2394 + mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; 2395 2395 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); 2396 2396 if (rc == MBX_NOT_FINISHED) 2397 2397 goto error; ··· 2436 2436 2437 2437 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_DUMP_MEMORY); 2438 2438 /* save address for completion */ 2439 - mbox->context1 = mp; 2439 + mbox->ctx_buf = mp; 2440 2440 2441 2441 bf_set(lpfc_mbx_memory_dump_type3_type, 2442 2442 &mbox->u.mqe.un.mem_dump_type3, DMP_LMSD);
+3 -3
drivers/scsi/lpfc/lpfc_mem.c
··· 330 330 331 331 /* Free memory used in mailbox queue back to mailbox memory pool */ 332 332 list_for_each_entry_safe(mbox, next_mbox, &psli->mboxq, list) { 333 - mp = (struct lpfc_dmabuf *) (mbox->context1); 333 + mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); 334 334 if (mp) { 335 335 lpfc_mbuf_free(phba, mp->virt, mp->phys); 336 336 kfree(mp); ··· 340 340 } 341 341 /* Free memory used in mailbox cmpl list back to mailbox memory pool */ 342 342 list_for_each_entry_safe(mbox, next_mbox, &psli->mboxq_cmpl, list) { 343 - mp = (struct lpfc_dmabuf *) (mbox->context1); 343 + mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); 344 344 if (mp) { 345 345 lpfc_mbuf_free(phba, mp->virt, mp->phys); 346 346 kfree(mp); ··· 354 354 spin_unlock_irq(&phba->hbalock); 355 355 if (psli->mbox_active) { 356 356 mbox = psli->mbox_active; 357 - mp = (struct lpfc_dmabuf *) (mbox->context1); 357 + mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); 358 358 if (mp) { 359 359 lpfc_mbuf_free(phba, mp->virt, mp->phys); 360 360 kfree(mp);
+9 -9
drivers/scsi/lpfc/lpfc_nportdisc.c
··· 467 467 */ 468 468 mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; 469 469 /* 470 - * mbox->context2 = lpfc_nlp_get(ndlp) deferred until mailbox 470 + * mbox->ctx_ndlp = lpfc_nlp_get(ndlp) deferred until mailbox 471 471 * command issued in lpfc_cmpl_els_acc(). 472 472 */ 473 473 mbox->vport = vport; ··· 535 535 struct lpfc_nodelist *ndlp; 536 536 uint32_t cmd; 537 537 538 - elsiocb = (struct lpfc_iocbq *)mboxq->context1; 539 - ndlp = (struct lpfc_nodelist *) mboxq->context2; 538 + elsiocb = (struct lpfc_iocbq *)mboxq->ctx_buf; 539 + ndlp = (struct lpfc_nodelist *)mboxq->ctx_ndlp; 540 540 vport = mboxq->vport; 541 541 cmd = elsiocb->drvrTimeout; 542 542 ··· 1258 1258 ndlp->nlp_flag |= NLP_REG_LOGIN_SEND; 1259 1259 mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; 1260 1260 } 1261 - mbox->context2 = lpfc_nlp_get(ndlp); 1261 + mbox->ctx_ndlp = lpfc_nlp_get(ndlp); 1262 1262 mbox->vport = vport; 1263 1263 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) 1264 1264 != MBX_NOT_FINISHED) { ··· 1272 1272 * command 1273 1273 */ 1274 1274 lpfc_nlp_put(ndlp); 1275 - mp = (struct lpfc_dmabuf *) mbox->context1; 1275 + mp = (struct lpfc_dmabuf *)mbox->ctx_buf; 1276 1276 lpfc_mbuf_free(phba, mp->virt, mp->phys); 1277 1277 kfree(mp); 1278 1278 mempool_free(mbox, phba->mbox_mem_pool); ··· 1641 1641 /* cleanup any ndlp on mbox q waiting for reglogin cmpl */ 1642 1642 if ((mb = phba->sli.mbox_active)) { 1643 1643 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && 1644 - (ndlp == (struct lpfc_nodelist *) mb->context2)) { 1644 + (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { 1645 1645 ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; 1646 1646 lpfc_nlp_put(ndlp); 1647 - mb->context2 = NULL; 1647 + mb->ctx_ndlp = NULL; 1648 1648 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 1649 1649 } 1650 1650 } ··· 1652 1652 spin_lock_irq(&phba->hbalock); 1653 1653 list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { 1654 1654 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && 1655 - (ndlp == (struct lpfc_nodelist *) mb->context2)) { 1656 - mp = (struct lpfc_dmabuf *) (mb->context1); 1655 + (ndlp == (struct lpfc_nodelist *)mb->ctx_ndlp)) { 1656 + mp = (struct lpfc_dmabuf *)(mb->ctx_buf); 1657 1657 if (mp) { 1658 1658 __lpfc_mbuf_free(phba, mp->virt, mp->phys); 1659 1659 kfree(mp);
+41 -37
drivers/scsi/lpfc/lpfc_sli.c
··· 2456 2456 uint16_t rpi, vpi; 2457 2457 int rc; 2458 2458 2459 - mp = (struct lpfc_dmabuf *) (pmb->context1); 2459 + mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); 2460 2460 2461 2461 if (mp) { 2462 2462 lpfc_mbuf_free(phba, mp->virt, mp->phys); ··· 2491 2491 } 2492 2492 2493 2493 if (pmb->u.mb.mbxCommand == MBX_REG_LOGIN64) { 2494 - ndlp = (struct lpfc_nodelist *)pmb->context2; 2494 + ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 2495 2495 lpfc_nlp_put(ndlp); 2496 - pmb->context2 = NULL; 2496 + pmb->ctx_ndlp = NULL; 2497 2497 } 2498 2498 2499 2499 /* Check security permission status on INIT_LINK mailbox command */ ··· 2527 2527 struct lpfc_vport *vport = pmb->vport; 2528 2528 struct lpfc_nodelist *ndlp; 2529 2529 2530 - ndlp = pmb->context1; 2530 + ndlp = pmb->ctx_ndlp; 2531 2531 if (pmb->u.mb.mbxCommand == MBX_UNREG_LOGIN) { 2532 2532 if (phba->sli_rev == LPFC_SLI_REV4 && 2533 2533 (bf_get(lpfc_sli_intf_if_type, ··· 5229 5229 goto out_free_mboxq; 5230 5230 } 5231 5231 5232 - mp = (struct lpfc_dmabuf *) mboxq->context1; 5232 + mp = (struct lpfc_dmabuf *)mboxq->ctx_buf; 5233 5233 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); 5234 5234 5235 5235 lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, ··· 7350 7350 7351 7351 mboxq->vport = vport; 7352 7352 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); 7353 - mp = (struct lpfc_dmabuf *) mboxq->context1; 7353 + mp = (struct lpfc_dmabuf *)mboxq->ctx_buf; 7354 7354 if (rc == MBX_SUCCESS) { 7355 7355 memcpy(&vport->fc_sparam, mp->virt, sizeof(struct serv_parm)); 7356 7356 rc = 0; ··· 7362 7362 */ 7363 7363 lpfc_mbuf_free(phba, mp->virt, mp->phys); 7364 7364 kfree(mp); 7365 - mboxq->context1 = NULL; 7365 + mboxq->ctx_buf = NULL; 7366 7366 if (unlikely(rc)) { 7367 7367 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, 7368 7368 "0382 READ_SPARAM command failed " ··· 8132 8132 } 8133 8133 8134 8134 /* Copy the mailbox extension data */ 8135 - if (pmbox->in_ext_byte_len && pmbox->context2) { 8136 - lpfc_sli_pcimem_bcopy(pmbox->context2, 8137 - (uint8_t *)phba->mbox_ext, 8138 - pmbox->in_ext_byte_len); 8135 + if (pmbox->in_ext_byte_len && pmbox->ctx_buf) { 8136 + lpfc_sli_pcimem_bcopy(pmbox->ctx_buf, 8137 + (uint8_t *)phba->mbox_ext, 8138 + pmbox->in_ext_byte_len); 8139 8139 } 8140 8140 /* Copy command data to host SLIM area */ 8141 8141 lpfc_sli_pcimem_bcopy(mbx, phba->mbox, MAILBOX_CMD_SIZE); ··· 8146 8146 = MAILBOX_HBA_EXT_OFFSET; 8147 8147 8148 8148 /* Copy the mailbox extension data */ 8149 - if (pmbox->in_ext_byte_len && pmbox->context2) 8149 + if (pmbox->in_ext_byte_len && pmbox->ctx_buf) 8150 8150 lpfc_memcpy_to_slim(phba->MBslimaddr + 8151 8151 MAILBOX_HBA_EXT_OFFSET, 8152 - pmbox->context2, pmbox->in_ext_byte_len); 8152 + pmbox->ctx_buf, pmbox->in_ext_byte_len); 8153 8153 8154 8154 if (mbx->mbxCommand == MBX_CONFIG_PORT) 8155 8155 /* copy command data into host mbox for cmpl */ ··· 8272 8272 lpfc_sli_pcimem_bcopy(phba->mbox, mbx, 8273 8273 MAILBOX_CMD_SIZE); 8274 8274 /* Copy the mailbox extension data */ 8275 - if (pmbox->out_ext_byte_len && pmbox->context2) { 8275 + if (pmbox->out_ext_byte_len && pmbox->ctx_buf) { 8276 8276 lpfc_sli_pcimem_bcopy(phba->mbox_ext, 8277 - pmbox->context2, 8277 + pmbox->ctx_buf, 8278 8278 pmbox->out_ext_byte_len); 8279 8279 } 8280 8280 } else { ··· 8282 8282 lpfc_memcpy_from_slim(mbx, phba->MBslimaddr, 8283 8283 MAILBOX_CMD_SIZE); 8284 8284 /* Copy the mailbox extension data */ 8285 - if (pmbox->out_ext_byte_len && pmbox->context2) { 8286 - lpfc_memcpy_from_slim(pmbox->context2, 8285 + if (pmbox->out_ext_byte_len && pmbox->ctx_buf) { 8286 + lpfc_memcpy_from_slim( 8287 + pmbox->ctx_buf, 8287 8288 phba->MBslimaddr + 8288 8289 MAILBOX_HBA_EXT_OFFSET, 8289 8290 pmbox->out_ext_byte_len); ··· 12559 12558 lpfc_sli_pcimem_bcopy(mbox, pmbox, 12560 12559 MAILBOX_CMD_SIZE); 12561 12560 if (pmb->out_ext_byte_len && 12562 - pmb->context2) 12561 + pmb->ctx_buf) 12563 12562 lpfc_sli_pcimem_bcopy( 12564 12563 phba->mbox_ext, 12565 - pmb->context2, 12564 + pmb->ctx_buf, 12566 12565 pmb->out_ext_byte_len); 12567 12566 } 12568 12567 if (pmb->mbox_flag & LPFC_MBX_IMED_UNREG) { ··· 12577 12576 12578 12577 if (!pmbox->mbxStatus) { 12579 12578 mp = (struct lpfc_dmabuf *) 12580 - (pmb->context1); 12579 + (pmb->ctx_buf); 12581 12580 ndlp = (struct lpfc_nodelist *) 12582 - pmb->context2; 12581 + pmb->ctx_ndlp; 12583 12582 12584 12583 /* Reg_LOGIN of dflt RPI was 12585 12584 * successful. new lets get ··· 12592 12591 pmb); 12593 12592 pmb->mbox_cmpl = 12594 12593 lpfc_mbx_cmpl_dflt_rpi; 12595 - pmb->context1 = mp; 12596 - pmb->context2 = ndlp; 12594 + pmb->ctx_buf = mp; 12595 + pmb->ctx_ndlp = ndlp; 12597 12596 pmb->vport = vport; 12598 12597 rc = lpfc_sli_issue_mbox(phba, 12599 12598 pmb, ··· 13199 13198 mcqe_status, 13200 13199 pmbox->un.varWords[0], 0); 13201 13200 if (mcqe_status == MB_CQE_STATUS_SUCCESS) { 13202 - mp = (struct lpfc_dmabuf *)(pmb->context1); 13203 - ndlp = (struct lpfc_nodelist *)pmb->context2; 13201 + mp = (struct lpfc_dmabuf *)(pmb->ctx_buf); 13202 + ndlp = (struct lpfc_nodelist *)pmb->ctx_ndlp; 13204 13203 /* Reg_LOGIN of dflt RPI was successful. Now lets get 13205 13204 * RID of the PPI using the same mbox buffer. 13206 13205 */ 13207 13206 lpfc_unreg_login(phba, vport->vpi, 13208 13207 pmbox->un.varWords[0], pmb); 13209 13208 pmb->mbox_cmpl = lpfc_mbx_cmpl_dflt_rpi; 13210 - pmb->context1 = mp; 13211 - pmb->context2 = ndlp; 13209 + pmb->ctx_buf = mp; 13210 + pmb->ctx_ndlp = ndlp; 13212 13211 pmb->vport = vport; 13213 13212 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); 13214 13213 if (rc != MBX_BUSY) ··· 14683 14682 14684 14683 mbox->vport = phba->pport; 14685 14684 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 14686 - mbox->context1 = NULL; 14685 + mbox->ctx_buf = NULL; 14686 + mbox->ctx_ndlp = NULL; 14687 14687 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); 14688 14688 shdr = (union lpfc_sli4_cfg_shdr *) &eq_delay->header.cfg_shdr; 14689 14689 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); ··· 14804 14802 } 14805 14803 mbox->vport = phba->pport; 14806 14804 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 14807 - mbox->context1 = NULL; 14805 + mbox->ctx_buf = NULL; 14806 + mbox->ctx_ndlp = NULL; 14808 14807 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); 14809 14808 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response); 14810 14809 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response); ··· 18223 18220 lpfc_resume_rpi(mboxq, ndlp); 18224 18221 if (cmpl) { 18225 18222 mboxq->mbox_cmpl = cmpl; 18226 - mboxq->context1 = arg; 18227 - mboxq->context2 = ndlp; 18223 + mboxq->ctx_buf = arg; 18224 + mboxq->ctx_ndlp = ndlp; 18228 18225 } else 18229 18226 mboxq->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 18230 18227 mboxq->vport = ndlp->vport; ··· 19035 19032 if (lpfc_sli4_dump_cfg_rg23(phba, mboxq)) 19036 19033 goto out; 19037 19034 mqe = &mboxq->u.mqe; 19038 - mp = (struct lpfc_dmabuf *) mboxq->context1; 19035 + mp = (struct lpfc_dmabuf *)mboxq->ctx_buf; 19039 19036 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); 19040 19037 if (rc) 19041 19038 goto out; ··· 19286 19283 (mb->u.mb.mbxCommand == MBX_REG_VPI)) 19287 19284 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 19288 19285 if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) { 19289 - act_mbx_ndlp = (struct lpfc_nodelist *)mb->context2; 19286 + act_mbx_ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp; 19290 19287 /* Put reference count for delayed processing */ 19291 19288 act_mbx_ndlp = lpfc_nlp_get(act_mbx_ndlp); 19292 19289 /* Unregister the RPI when mailbox complete */ ··· 19311 19308 19312 19309 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 19313 19310 if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) { 19314 - ndlp = (struct lpfc_nodelist *)mb->context2; 19311 + ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp; 19315 19312 /* Unregister the RPI when mailbox complete */ 19316 19313 mb->mbox_flag |= LPFC_MBX_IMED_UNREG; 19317 19314 restart_loop = 1; ··· 19331 19328 while (!list_empty(&mbox_cmd_list)) { 19332 19329 list_remove_head(&mbox_cmd_list, mb, LPFC_MBOXQ_t, list); 19333 19330 if (mb->u.mb.mbxCommand == MBX_REG_LOGIN64) { 19334 - mp = (struct lpfc_dmabuf *) (mb->context1); 19331 + mp = (struct lpfc_dmabuf *)(mb->ctx_buf); 19335 19332 if (mp) { 19336 19333 __lpfc_mbuf_free(phba, mp->virt, mp->phys); 19337 19334 kfree(mp); 19338 19335 } 19339 - ndlp = (struct lpfc_nodelist *) mb->context2; 19340 - mb->context2 = NULL; 19336 + mb->ctx_buf = NULL; 19337 + ndlp = (struct lpfc_nodelist *)mb->ctx_ndlp; 19338 + mb->ctx_ndlp = NULL; 19341 19339 if (ndlp) { 19342 19340 spin_lock(shost->host_lock); 19343 19341 ndlp->nlp_flag &= ~NLP_IGNR_REG_CMPL;
+3 -3
drivers/scsi/lpfc/lpfc_sli.h
··· 144 144 MAILBOX_t mb; /* Mailbox cmd */ 145 145 struct lpfc_mqe mqe; 146 146 } u; 147 - struct lpfc_vport *vport;/* virtual port pointer */ 148 - void *context1; /* caller context information */ 149 - void *context2; /* caller context information */ 147 + struct lpfc_vport *vport; /* virtual port pointer */ 148 + void *ctx_ndlp; /* caller ndlp information */ 149 + void *ctx_buf; /* caller buffer information */ 150 150 void *context3; 151 151 152 152 void (*mbox_cmpl) (struct lpfc_hba *, struct lpfcMboxq *);
+2 -2
drivers/scsi/lpfc/lpfc_vport.c
··· 138 138 * Grab buffer pointer and clear context1 so we can use 139 139 * lpfc_sli_issue_box_wait 140 140 */ 141 - mp = (struct lpfc_dmabuf *) pmb->context1; 142 - pmb->context1 = NULL; 141 + mp = (struct lpfc_dmabuf *)pmb->ctx_buf; 142 + pmb->ctx_buf = NULL; 143 143 144 144 pmb->vport = vport; 145 145 rc = lpfc_sli_issue_mbox_wait(phba, pmb, phba->fc_ratov * 2);