| .. | .. |
|---|
| 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 | } |
|---|
| .. | .. |
|---|
| 515 | 515 | |
|---|
| 516 | 516 | if ((phba->pcidev->device == PCI_DEVICE_ID_LANCER_G6_FC || |
|---|
| 517 | 517 | phba->pcidev->device == PCI_DEVICE_ID_LANCER_G7_FC) && |
|---|
| 518 | + !(phba->sli4_hba.pc_sli4_params.pls) && |
|---|
| 518 | 519 | mb->un.varInitLnk.link_flags & FLAGS_TOPOLOGY_MODE_LOOP) { |
|---|
| 519 | 520 | mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_PT_PT; |
|---|
| 520 | 521 | phba->cfg_topology = FLAGS_TOPOLOGY_MODE_PT_PT; |
|---|
| .. | .. |
|---|
| 631 | 632 | mb->un.varRdSparm.vpi = phba->vpi_ids[vpi]; |
|---|
| 632 | 633 | |
|---|
| 633 | 634 | /* save address for completion */ |
|---|
| 634 | | - pmb->context1 = mp; |
|---|
| 635 | + pmb->ctx_buf = mp; |
|---|
| 635 | 636 | |
|---|
| 636 | 637 | return (0); |
|---|
| 637 | 638 | } |
|---|
| .. | .. |
|---|
| 783 | 784 | memcpy(sparam, param, sizeof (struct serv_parm)); |
|---|
| 784 | 785 | |
|---|
| 785 | 786 | /* save address for completion */ |
|---|
| 786 | | - pmb->context1 = (uint8_t *) mp; |
|---|
| 787 | + pmb->ctx_buf = (uint8_t *)mp; |
|---|
| 787 | 788 | |
|---|
| 788 | 789 | mb->mbxCommand = MBX_REG_LOGIN64; |
|---|
| 789 | 790 | mb->un.varRegLogin.un.sp64.tus.f.bdeSize = sizeof (struct serv_parm); |
|---|
| .. | .. |
|---|
| 858 | 859 | mbox->u.mb.un.varUnregLogin.rsvd1 = 0x4000; |
|---|
| 859 | 860 | mbox->vport = vport; |
|---|
| 860 | 861 | mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; |
|---|
| 861 | | - mbox->context1 = NULL; |
|---|
| 862 | + mbox->ctx_ndlp = NULL; |
|---|
| 862 | 863 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); |
|---|
| 863 | 864 | if (rc == MBX_NOT_FINISHED) |
|---|
| 864 | 865 | mempool_free(mbox, phba->mbox_mem_pool); |
|---|
| .. | .. |
|---|
| 867 | 868 | |
|---|
| 868 | 869 | /** |
|---|
| 869 | 870 | * lpfc_reg_vpi - Prepare a mailbox command for registering vport identifier |
|---|
| 870 | | - * @phba: pointer to lpfc hba data structure. |
|---|
| 871 | | - * @vpi: virtual N_Port identifier. |
|---|
| 872 | | - * @sid: Fibre Channel S_ID (N_Port_ID assigned to a virtual N_Port). |
|---|
| 871 | + * @vport: pointer to a vport object. |
|---|
| 873 | 872 | * @pmb: pointer to the driver internal queue element for mailbox command. |
|---|
| 874 | 873 | * |
|---|
| 875 | 874 | * The registration vport identifier mailbox command is used to activate a |
|---|
| .. | .. |
|---|
| 1198 | 1197 | /** |
|---|
| 1199 | 1198 | * lpfc_config_ring - Prepare a mailbox command for configuring an IOCB ring |
|---|
| 1200 | 1199 | * @phba: pointer to lpfc hba data structure. |
|---|
| 1201 | | - * @ring: |
|---|
| 1200 | + * @ring: ring number/index |
|---|
| 1202 | 1201 | * @pmb: pointer to the driver internal queue element for mailbox command. |
|---|
| 1203 | 1202 | * |
|---|
| 1204 | 1203 | * The configure ring mailbox command is used to configure an IOCB ring. This |
|---|
| .. | .. |
|---|
| 1298 | 1297 | if (phba->sli_rev == LPFC_SLI_REV3 && phba->vpd.sli3Feat.cerbm) { |
|---|
| 1299 | 1298 | if (phba->cfg_enable_bg) |
|---|
| 1300 | 1299 | mb->un.varCfgPort.cbg = 1; /* configure BlockGuard */ |
|---|
| 1301 | | - if (phba->cfg_enable_dss) |
|---|
| 1302 | | - mb->un.varCfgPort.cdss = 1; /* Configure Security */ |
|---|
| 1303 | 1300 | mb->un.varCfgPort.cerbm = 1; /* Request HBQs */ |
|---|
| 1304 | 1301 | mb->un.varCfgPort.ccrp = 1; /* Command Ring Polling */ |
|---|
| 1305 | 1302 | mb->un.varCfgPort.max_hbq = lpfc_sli_hbq_count(); |
|---|
| .. | .. |
|---|
| 1379 | 1376 | */ |
|---|
| 1380 | 1377 | |
|---|
| 1381 | 1378 | if (phba->cfg_hostmem_hgp && phba->sli_rev != 3) { |
|---|
| 1382 | | - phba->host_gp = &phba->mbox->us.s2.host[0]; |
|---|
| 1379 | + phba->host_gp = (struct lpfc_hgp __iomem *) |
|---|
| 1380 | + &phba->mbox->us.s2.host[0]; |
|---|
| 1383 | 1381 | phba->hbq_put = NULL; |
|---|
| 1384 | 1382 | offset = (uint8_t *)&phba->mbox->us.s2.host - |
|---|
| 1385 | 1383 | (uint8_t *)phba->slim2p.virt; |
|---|
| .. | .. |
|---|
| 1613 | 1611 | /** |
|---|
| 1614 | 1612 | * lpfc_mbox_tmo_val - Retrieve mailbox command timeout value |
|---|
| 1615 | 1613 | * @phba: pointer to lpfc hba data structure. |
|---|
| 1616 | | - * @cmd: mailbox command code. |
|---|
| 1614 | + * @mboxq: pointer to the driver internal queue element for mailbox command. |
|---|
| 1617 | 1615 | * |
|---|
| 1618 | 1616 | * This routine retrieves the proper timeout value according to the mailbox |
|---|
| 1619 | 1617 | * command code. |
|---|
| .. | .. |
|---|
| 1700 | 1698 | * lpfc_sli4_mbx_sge_get - Get a sge entry from non-embedded mailbox command |
|---|
| 1701 | 1699 | * @mbox: pointer to lpfc mbox command. |
|---|
| 1702 | 1700 | * @sgentry: sge entry index. |
|---|
| 1701 | + * @sge: pointer to lpfc mailbox sge to load into. |
|---|
| 1703 | 1702 | * |
|---|
| 1704 | 1703 | * This routine gets an entry from the non-embedded mailbox command at the sge |
|---|
| 1705 | 1704 | * index location. |
|---|
| .. | .. |
|---|
| 1767 | 1766 | * @subsystem: The sli4 config sub mailbox subsystem. |
|---|
| 1768 | 1767 | * @opcode: The sli4 config sub mailbox command opcode. |
|---|
| 1769 | 1768 | * @length: Length of the sli4 config mailbox command (including sub-header). |
|---|
| 1769 | + * @emb: True if embedded mbox command should be setup. |
|---|
| 1770 | 1770 | * |
|---|
| 1771 | 1771 | * This routine sets up the header fields of SLI4 specific mailbox command |
|---|
| 1772 | 1772 | * for sending IOCTL command. |
|---|
| .. | .. |
|---|
| 1827 | 1827 | * page, this is used as a priori size of SLI4_PAGE_SIZE for |
|---|
| 1828 | 1828 | * the later DMA memory free. |
|---|
| 1829 | 1829 | */ |
|---|
| 1830 | | - viraddr = dma_zalloc_coherent(&phba->pcidev->dev, |
|---|
| 1831 | | - SLI4_PAGE_SIZE, &phyaddr, |
|---|
| 1832 | | - GFP_KERNEL); |
|---|
| 1830 | + viraddr = dma_alloc_coherent(&phba->pcidev->dev, |
|---|
| 1831 | + SLI4_PAGE_SIZE, &phyaddr, |
|---|
| 1832 | + GFP_KERNEL); |
|---|
| 1833 | 1833 | /* In case of malloc fails, proceed with whatever we have */ |
|---|
| 1834 | 1834 | if (!viraddr) |
|---|
| 1835 | 1835 | break; |
|---|
| .. | .. |
|---|
| 2012 | 2012 | /** |
|---|
| 2013 | 2013 | * lpfc_sli4_mbx_read_fcf_rec - Allocate and construct read fcf mbox cmd |
|---|
| 2014 | 2014 | * @phba: pointer to lpfc hba data structure. |
|---|
| 2015 | + * @mboxq: pointer to lpfc mbox command. |
|---|
| 2015 | 2016 | * @fcf_index: index to fcf table. |
|---|
| 2016 | 2017 | * |
|---|
| 2017 | 2018 | * This routine routine allocates and constructs non-embedded mailbox command |
|---|
| .. | .. |
|---|
| 2068 | 2069 | |
|---|
| 2069 | 2070 | /** |
|---|
| 2070 | 2071 | * lpfc_request_features: Configure SLI4 REQUEST_FEATURES mailbox |
|---|
| 2072 | + * @phba: pointer to lpfc hba data structure. |
|---|
| 2071 | 2073 | * @mboxq: pointer to lpfc mbox command. |
|---|
| 2072 | 2074 | * |
|---|
| 2073 | 2075 | * This routine sets up the mailbox for an SLI4 REQUEST_FEATURES |
|---|
| .. | .. |
|---|
| 2095 | 2097 | if (phba->nvmet_support) { |
|---|
| 2096 | 2098 | bf_set(lpfc_mbx_rq_ftr_rq_mrqp, &mboxq->u.mqe.un.req_ftrs, 1); |
|---|
| 2097 | 2099 | /* iaab/iaar NOT set for now */ |
|---|
| 2098 | | - bf_set(lpfc_mbx_rq_ftr_rq_iaab, &mboxq->u.mqe.un.req_ftrs, 0); |
|---|
| 2099 | | - bf_set(lpfc_mbx_rq_ftr_rq_iaar, &mboxq->u.mqe.un.req_ftrs, 0); |
|---|
| 2100 | + bf_set(lpfc_mbx_rq_ftr_rq_iaab, &mboxq->u.mqe.un.req_ftrs, 0); |
|---|
| 2101 | + bf_set(lpfc_mbx_rq_ftr_rq_iaar, &mboxq->u.mqe.un.req_ftrs, 0); |
|---|
| 2100 | 2102 | } |
|---|
| 2101 | 2103 | return; |
|---|
| 2102 | 2104 | } |
|---|
| .. | .. |
|---|
| 2288 | 2290 | INIT_LIST_HEAD(&mp->list); |
|---|
| 2289 | 2291 | |
|---|
| 2290 | 2292 | /* save address for completion */ |
|---|
| 2291 | | - mbox->context1 = (uint8_t *) mp; |
|---|
| 2293 | + mbox->ctx_buf = (uint8_t *)mp; |
|---|
| 2292 | 2294 | |
|---|
| 2293 | 2295 | mb->mbxCommand = MBX_DUMP_MEMORY; |
|---|
| 2294 | 2296 | mb->un.varDmp.type = DMP_NV_PARAMS; |
|---|
| .. | .. |
|---|
| 2305 | 2307 | MAILBOX_t *mb; |
|---|
| 2306 | 2308 | int rc = FAILURE; |
|---|
| 2307 | 2309 | struct lpfc_rdp_context *rdp_context = |
|---|
| 2308 | | - (struct lpfc_rdp_context *)(mboxq->context2); |
|---|
| 2310 | + (struct lpfc_rdp_context *)(mboxq->ctx_ndlp); |
|---|
| 2309 | 2311 | |
|---|
| 2310 | 2312 | mb = &mboxq->u.mb; |
|---|
| 2311 | 2313 | if (mb->mbxStatus) |
|---|
| .. | .. |
|---|
| 2323 | 2325 | static void |
|---|
| 2324 | 2326 | lpfc_mbx_cmpl_rdp_page_a2(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) |
|---|
| 2325 | 2327 | { |
|---|
| 2326 | | - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) mbox->context1; |
|---|
| 2328 | + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)mbox->ctx_buf; |
|---|
| 2327 | 2329 | struct lpfc_rdp_context *rdp_context = |
|---|
| 2328 | | - (struct lpfc_rdp_context *)(mbox->context2); |
|---|
| 2330 | + (struct lpfc_rdp_context *)(mbox->ctx_ndlp); |
|---|
| 2329 | 2331 | |
|---|
| 2330 | 2332 | if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) |
|---|
| 2331 | 2333 | goto error_mbuf_free; |
|---|
| .. | .. |
|---|
| 2341 | 2343 | lpfc_read_lnk_stat(phba, mbox); |
|---|
| 2342 | 2344 | mbox->vport = rdp_context->ndlp->vport; |
|---|
| 2343 | 2345 | mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat; |
|---|
| 2344 | | - mbox->context2 = (struct lpfc_rdp_context *) rdp_context; |
|---|
| 2346 | + mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; |
|---|
| 2345 | 2347 | if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) == MBX_NOT_FINISHED) |
|---|
| 2346 | 2348 | goto error_cmd_free; |
|---|
| 2347 | 2349 | |
|---|
| .. | .. |
|---|
| 2359 | 2361 | lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) |
|---|
| 2360 | 2362 | { |
|---|
| 2361 | 2363 | int rc; |
|---|
| 2362 | | - struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (mbox->context1); |
|---|
| 2364 | + struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); |
|---|
| 2363 | 2365 | struct lpfc_rdp_context *rdp_context = |
|---|
| 2364 | | - (struct lpfc_rdp_context *)(mbox->context2); |
|---|
| 2366 | + (struct lpfc_rdp_context *)(mbox->ctx_ndlp); |
|---|
| 2365 | 2367 | |
|---|
| 2366 | 2368 | if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) |
|---|
| 2367 | 2369 | goto error; |
|---|
| .. | .. |
|---|
| 2375 | 2377 | INIT_LIST_HEAD(&mp->list); |
|---|
| 2376 | 2378 | |
|---|
| 2377 | 2379 | /* save address for completion */ |
|---|
| 2378 | | - mbox->context1 = mp; |
|---|
| 2380 | + mbox->ctx_buf = mp; |
|---|
| 2379 | 2381 | mbox->vport = rdp_context->ndlp->vport; |
|---|
| 2380 | 2382 | |
|---|
| 2381 | 2383 | bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_DUMP_MEMORY); |
|---|
| .. | .. |
|---|
| 2391 | 2393 | mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); |
|---|
| 2392 | 2394 | |
|---|
| 2393 | 2395 | mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a2; |
|---|
| 2394 | | - mbox->context2 = (struct lpfc_rdp_context *) rdp_context; |
|---|
| 2396 | + mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; |
|---|
| 2395 | 2397 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); |
|---|
| 2396 | 2398 | if (rc == MBX_NOT_FINISHED) |
|---|
| 2397 | 2399 | goto error; |
|---|
| .. | .. |
|---|
| 2436 | 2438 | |
|---|
| 2437 | 2439 | bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_DUMP_MEMORY); |
|---|
| 2438 | 2440 | /* save address for completion */ |
|---|
| 2439 | | - mbox->context1 = mp; |
|---|
| 2441 | + mbox->ctx_buf = mp; |
|---|
| 2440 | 2442 | |
|---|
| 2441 | 2443 | bf_set(lpfc_mbx_memory_dump_type3_type, |
|---|
| 2442 | 2444 | &mbox->u.mqe.un.mem_dump_type3, DMP_LMSD); |
|---|