Lines Matching +full:un +full:-
4 * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term *
6 * Copyright (C) 2004-2016 Emulex. All rights reserved. *
9 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
17 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
47 * lpfc_mbox_rsrc_prep - Prepare a mailbox with DMA buffer memory.
69 return -ENOMEM; in lpfc_mbox_rsrc_prep()
71 mp->virt = lpfc_mbuf_alloc(phba, 0, &mp->phys); in lpfc_mbox_rsrc_prep()
72 if (!mp->virt) { in lpfc_mbox_rsrc_prep()
74 return -ENOMEM; in lpfc_mbox_rsrc_prep()
77 memset(mp->virt, 0, LPFC_BPL_SIZE); in lpfc_mbox_rsrc_prep()
80 INIT_LIST_HEAD(&mp->list); in lpfc_mbox_rsrc_prep()
81 mbox->ctx_buf = mp; in lpfc_mbox_rsrc_prep()
86 * lpfc_mbox_rsrc_cleanup - Free the mailbox DMA buffer and virtual memory.
105 mp = mbox->ctx_buf; in lpfc_mbox_rsrc_cleanup()
106 mbox->ctx_buf = NULL; in lpfc_mbox_rsrc_cleanup()
111 __lpfc_mbuf_free(phba, mp->virt, mp->phys); in lpfc_mbox_rsrc_cleanup()
113 lpfc_mbuf_free(phba, mp->virt, mp->phys); in lpfc_mbox_rsrc_cleanup()
117 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_mbox_rsrc_cleanup()
121 * lpfc_dump_static_vport - Dump HBA's static vport information.
140 mb = &pmb->u.mb; in lpfc_dump_static_vport()
144 mb->mbxCommand = MBX_DUMP_MEMORY; in lpfc_dump_static_vport()
145 mb->un.varDmp.type = DMP_NV_PARAMS; in lpfc_dump_static_vport()
146 mb->un.varDmp.entry_index = offset; in lpfc_dump_static_vport()
147 mb->un.varDmp.region_id = DMP_REGION_VPORT; in lpfc_dump_static_vport()
148 mb->mbxOwner = OWN_HOST; in lpfc_dump_static_vport()
151 if (phba->sli_rev != LPFC_SLI_REV4) { in lpfc_dump_static_vport()
152 mb->un.varDmp.cv = 1; in lpfc_dump_static_vport()
153 mb->un.varDmp.word_cnt = DMP_RSP_SIZE/sizeof(uint32_t); in lpfc_dump_static_vport()
165 mp = pmb->ctx_buf; in lpfc_dump_static_vport()
166 mb->un.varWords[3] = putPaddrLow(mp->phys); in lpfc_dump_static_vport()
167 mb->un.varWords[4] = putPaddrHigh(mp->phys); in lpfc_dump_static_vport()
168 mb->un.varDmp.sli4_length = sizeof(struct static_vport_info); in lpfc_dump_static_vport()
174 * lpfc_down_link - Bring down HBAs link.
185 mb = &pmb->u.mb; in lpfc_down_link()
186 mb->mbxCommand = MBX_DOWN_LINK; in lpfc_down_link()
187 mb->mbxOwner = OWN_HOST; in lpfc_down_link()
191 * lpfc_dump_mem - Prepare a mailbox command for reading a region.
208 mb = &pmb->u.mb; in lpfc_dump_mem()
212 mb->mbxCommand = MBX_DUMP_MEMORY; in lpfc_dump_mem()
213 mb->un.varDmp.cv = 1; in lpfc_dump_mem()
214 mb->un.varDmp.type = DMP_NV_PARAMS; in lpfc_dump_mem()
215 mb->un.varDmp.entry_index = offset; in lpfc_dump_mem()
216 mb->un.varDmp.region_id = region_id; in lpfc_dump_mem()
217 mb->un.varDmp.word_cnt = (DMP_RSP_SIZE / sizeof (uint32_t)); in lpfc_dump_mem()
218 mb->un.varDmp.co = 0; in lpfc_dump_mem()
219 mb->un.varDmp.resp_offset = 0; in lpfc_dump_mem()
220 mb->mbxOwner = OWN_HOST; in lpfc_dump_mem()
225 * lpfc_dump_wakeup_param - Prepare mailbox command for retrieving wakeup params
237 mb = &pmb->u.mb; in lpfc_dump_wakeup_param()
241 mb->mbxCommand = MBX_DUMP_MEMORY; in lpfc_dump_wakeup_param()
242 mb->mbxOwner = OWN_HOST; in lpfc_dump_wakeup_param()
243 mb->un.varDmp.cv = 1; in lpfc_dump_wakeup_param()
244 mb->un.varDmp.type = DMP_NV_PARAMS; in lpfc_dump_wakeup_param()
245 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_dump_wakeup_param()
246 mb->un.varDmp.entry_index = 0; in lpfc_dump_wakeup_param()
247 mb->un.varDmp.region_id = WAKE_UP_PARMS_REGION_ID; in lpfc_dump_wakeup_param()
248 mb->un.varDmp.word_cnt = WAKE_UP_PARMS_WORD_SIZE; in lpfc_dump_wakeup_param()
249 mb->un.varDmp.co = 0; in lpfc_dump_wakeup_param()
250 mb->un.varDmp.resp_offset = 0; in lpfc_dump_wakeup_param()
255 * lpfc_read_nv - Prepare a mailbox command for reading HBA's NVRAM param
259 * The read NVRAM mailbox command returns the HBA's non-volatile parameters
260 * that are used as defaults when the Fibre Channel link is brought on-line.
270 mb = &pmb->u.mb; in lpfc_read_nv()
272 mb->mbxCommand = MBX_READ_NV; in lpfc_read_nv()
273 mb->mbxOwner = OWN_HOST; in lpfc_read_nv()
278 * lpfc_config_async - Prepare a mailbox command for enabling HBA async event
296 mb = &pmb->u.mb; in lpfc_config_async()
298 mb->mbxCommand = MBX_ASYNCEVT_ENABLE; in lpfc_config_async()
299 mb->un.varCfgAsyncEvent.ring = ring; in lpfc_config_async()
300 mb->mbxOwner = OWN_HOST; in lpfc_config_async()
305 * lpfc_heart_beat - Prepare a mailbox command for heart beat
322 mb = &pmb->u.mb; in lpfc_heart_beat()
324 mb->mbxCommand = MBX_HEARTBEAT; in lpfc_heart_beat()
325 mb->mbxOwner = OWN_HOST; in lpfc_heart_beat()
330 * lpfc_read_topology - Prepare a mailbox command for reading HBA topology
337 * Attention (HSTATT) register is set to 1 (For SLI-3) or when an FC Link
338 * Attention ACQE is received from the port (For SLI-4). A Link Event
348 * 0 - Success (currently always return 0)
356 mb = &pmb->u.mb; in lpfc_read_topology()
359 INIT_LIST_HEAD(&mp->list); in lpfc_read_topology()
360 mb->mbxCommand = MBX_READ_TOPOLOGY; in lpfc_read_topology()
361 mb->un.varReadTop.lilpBde64.tus.f.bdeSize = LPFC_ALPA_MAP_SIZE; in lpfc_read_topology()
362 mb->un.varReadTop.lilpBde64.addrHigh = putPaddrHigh(mp->phys); in lpfc_read_topology()
363 mb->un.varReadTop.lilpBde64.addrLow = putPaddrLow(mp->phys); in lpfc_read_topology()
368 pmb->ctx_buf = mp; in lpfc_read_topology()
369 mb->mbxOwner = OWN_HOST; in lpfc_read_topology()
374 * lpfc_clear_la - Prepare a mailbox command for clearing HBA link attention
393 mb = &pmb->u.mb; in lpfc_clear_la()
396 mb->un.varClearLA.eventTag = phba->fc_eventTag; in lpfc_clear_la()
397 mb->mbxCommand = MBX_CLEAR_LA; in lpfc_clear_la()
398 mb->mbxOwner = OWN_HOST; in lpfc_clear_la()
403 * lpfc_config_link - Prepare a mailbox command for configuring link on a HBA
408 * mailbox command to override default value and to configure link-oriented
419 struct lpfc_vport *vport = phba->pport; in lpfc_config_link()
420 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_link()
424 * SLI-2, Coalescing Response Feature. in lpfc_config_link()
426 if (phba->cfg_cr_delay && (phba->sli_rev < LPFC_SLI_REV4)) { in lpfc_config_link()
427 mb->un.varCfgLnk.cr = 1; in lpfc_config_link()
428 mb->un.varCfgLnk.ci = 1; in lpfc_config_link()
429 mb->un.varCfgLnk.cr_delay = phba->cfg_cr_delay; in lpfc_config_link()
430 mb->un.varCfgLnk.cr_count = phba->cfg_cr_count; in lpfc_config_link()
433 mb->un.varCfgLnk.myId = vport->fc_myDID; in lpfc_config_link()
434 mb->un.varCfgLnk.edtov = phba->fc_edtov; in lpfc_config_link()
435 mb->un.varCfgLnk.arbtov = phba->fc_arbtov; in lpfc_config_link()
436 mb->un.varCfgLnk.ratov = phba->fc_ratov; in lpfc_config_link()
437 mb->un.varCfgLnk.rttov = phba->fc_rttov; in lpfc_config_link()
438 mb->un.varCfgLnk.altov = phba->fc_altov; in lpfc_config_link()
439 mb->un.varCfgLnk.crtov = phba->fc_crtov; in lpfc_config_link()
440 mb->un.varCfgLnk.cscn = 0; in lpfc_config_link()
441 if (phba->bbcredit_support && phba->cfg_enable_bbcr) { in lpfc_config_link()
442 mb->un.varCfgLnk.cscn = 1; in lpfc_config_link()
443 mb->un.varCfgLnk.bbscn = bf_get(lpfc_bbscn_def, in lpfc_config_link()
444 &phba->sli4_hba.bbscn_params); in lpfc_config_link()
447 if (phba->cfg_ack0 && (phba->sli_rev < LPFC_SLI_REV4)) in lpfc_config_link()
448 mb->un.varCfgLnk.ack0_enable = 1; in lpfc_config_link()
450 mb->mbxCommand = MBX_CONFIG_LINK; in lpfc_config_link()
451 mb->mbxOwner = OWN_HOST; in lpfc_config_link()
456 * lpfc_config_msi - Prepare a mailbox command for configuring msi-x
460 * The configure MSI-X mailbox command is used to configure the HBA's SLI-3
461 * MSI-X multi-message interrupt vector association to interrupt attention
465 * 0 - Success
466 * -EINVAL - Failure
471 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_msi()
475 if (phba->cfg_use_msi != 2) { in lpfc_config_msi()
477 "0475 Not configured for supporting MSI-X " in lpfc_config_msi()
478 "cfg_use_msi: 0x%x\n", phba->cfg_use_msi); in lpfc_config_msi()
479 return -EINVAL; in lpfc_config_msi()
482 if (phba->sli_rev < 3) { in lpfc_config_msi()
484 "0476 HBA not supporting SLI-3 or later " in lpfc_config_msi()
485 "SLI Revision: 0x%x\n", phba->sli_rev); in lpfc_config_msi()
486 return -EINVAL; in lpfc_config_msi()
493 * SLI-3, Message Signaled Interrupt Feature. in lpfc_config_msi()
496 /* Multi-message attention configuration */ in lpfc_config_msi()
501 mb->un.varCfgMSI.attentionConditions[0] = attentionConditions[0]; in lpfc_config_msi()
502 mb->un.varCfgMSI.attentionConditions[1] = attentionConditions[1]; in lpfc_config_msi()
509 mb->un.varCfgMSI.messageNumberByHA[HA_R0_POS] = 1; in lpfc_config_msi()
511 mb->un.varCfgMSI.messageNumberByHA[HA_R1_POS] = 1; in lpfc_config_msi()
514 mb->un.varCfgMSI.messageNumberByHA[HA_R0_POS^3] = 1; in lpfc_config_msi()
516 mb->un.varCfgMSI.messageNumberByHA[HA_R1_POS^3] = 1; in lpfc_config_msi()
518 /* Multi-message interrupt autoclear configuration*/ in lpfc_config_msi()
519 mb->un.varCfgMSI.autoClearHA[0] = attentionConditions[0]; in lpfc_config_msi()
520 mb->un.varCfgMSI.autoClearHA[1] = attentionConditions[1]; in lpfc_config_msi()
523 mb->un.varCfgMSI.autoClearHA[0] = 0; in lpfc_config_msi()
524 mb->un.varCfgMSI.autoClearHA[1] = 0; in lpfc_config_msi()
527 mb->mbxCommand = MBX_CONFIG_MSI; in lpfc_config_msi()
528 mb->mbxOwner = OWN_HOST; in lpfc_config_msi()
534 * lpfc_init_link - Prepare a mailbox command for initialize link on a HBA
554 mb = &pmb->u.mb; in lpfc_init_link()
559 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_LOOP; in lpfc_init_link()
560 mb->un.varInitLnk.link_flags |= FLAGS_TOPOLOGY_FAILOVER; in lpfc_init_link()
563 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_PT_PT; in lpfc_init_link()
566 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_LOOP; in lpfc_init_link()
569 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_PT_PT; in lpfc_init_link()
570 mb->un.varInitLnk.link_flags |= FLAGS_TOPOLOGY_FAILOVER; in lpfc_init_link()
573 mb->un.varInitLnk.link_flags = FLAGS_LOCAL_LB; in lpfc_init_link()
578 if ((phba->sli4_hba.pc_sli4_params.sli_family == LPFC_SLI_INTF_FAMILY_G6 || in lpfc_init_link()
579 phba->sli4_hba.pc_sli4_params.if_type == LPFC_SLI_INTF_IF_TYPE_6) && in lpfc_init_link()
580 !(phba->sli4_hba.pc_sli4_params.pls) && in lpfc_init_link()
581 mb->un.varInitLnk.link_flags & FLAGS_TOPOLOGY_MODE_LOOP) { in lpfc_init_link()
582 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_PT_PT; in lpfc_init_link()
583 phba->cfg_topology = FLAGS_TOPOLOGY_MODE_PT_PT; in lpfc_init_link()
587 if (phba->sli_rev == LPFC_SLI_REV3 && !phba->cfg_fcp_wait_abts_rsp) in lpfc_init_link()
588 mb->un.varInitLnk.link_flags |= FLAGS_IMED_ABORT; in lpfc_init_link()
593 vpd = &phba->vpd; in lpfc_init_link()
594 if (vpd->rev.feaLevelHigh >= 0x02){ in lpfc_init_link()
597 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
598 mb->un.varInitLnk.link_speed = LINK_SPEED_1G; in lpfc_init_link()
601 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
602 mb->un.varInitLnk.link_speed = LINK_SPEED_2G; in lpfc_init_link()
605 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
606 mb->un.varInitLnk.link_speed = LINK_SPEED_4G; in lpfc_init_link()
609 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
610 mb->un.varInitLnk.link_speed = LINK_SPEED_8G; in lpfc_init_link()
613 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
614 mb->un.varInitLnk.link_speed = LINK_SPEED_10G; in lpfc_init_link()
617 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
618 mb->un.varInitLnk.link_speed = LINK_SPEED_16G; in lpfc_init_link()
621 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
622 mb->un.varInitLnk.link_speed = LINK_SPEED_32G; in lpfc_init_link()
625 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
626 mb->un.varInitLnk.link_speed = LINK_SPEED_64G; in lpfc_init_link()
630 mb->un.varInitLnk.link_speed = LINK_SPEED_AUTO; in lpfc_init_link()
636 mb->un.varInitLnk.link_speed = LINK_SPEED_AUTO; in lpfc_init_link()
638 mb->mbxCommand = (volatile uint8_t)MBX_INIT_LINK; in lpfc_init_link()
639 mb->mbxOwner = OWN_HOST; in lpfc_init_link()
640 mb->un.varInitLnk.fabric_AL_PA = phba->fc_pref_ALPA; in lpfc_init_link()
645 * lpfc_read_sparam - Prepare a mailbox command for reading HBA parameters
662 * 0 - Success
663 * 1 - DMA memory allocation failed
682 mp = pmb->ctx_buf; in lpfc_read_sparam()
683 mb = &pmb->u.mb; in lpfc_read_sparam()
684 mb->mbxOwner = OWN_HOST; in lpfc_read_sparam()
685 mb->mbxCommand = MBX_READ_SPARM64; in lpfc_read_sparam()
686 mb->un.varRdSparm.un.sp64.tus.f.bdeSize = sizeof (struct serv_parm); in lpfc_read_sparam()
687 mb->un.varRdSparm.un.sp64.addrHigh = putPaddrHigh(mp->phys); in lpfc_read_sparam()
688 mb->un.varRdSparm.un.sp64.addrLow = putPaddrLow(mp->phys); in lpfc_read_sparam()
689 if (phba->sli_rev >= LPFC_SLI_REV3) in lpfc_read_sparam()
690 mb->un.varRdSparm.vpi = phba->vpi_ids[vpi]; in lpfc_read_sparam()
696 * lpfc_unreg_did - Prepare a mailbox command for unregistering DID
716 mb = &pmb->u.mb; in lpfc_unreg_did()
719 mb->un.varUnregDID.did = did; in lpfc_unreg_did()
720 mb->un.varUnregDID.vpi = vpi; in lpfc_unreg_did()
722 (phba->sli_rev == LPFC_SLI_REV4)) in lpfc_unreg_did()
723 mb->un.varUnregDID.vpi = phba->vpi_ids[vpi]; in lpfc_unreg_did()
725 mb->mbxCommand = MBX_UNREG_D_ID; in lpfc_unreg_did()
726 mb->mbxOwner = OWN_HOST; in lpfc_unreg_did()
731 * lpfc_read_config - Prepare a mailbox command for reading HBA configuration
748 mb = &pmb->u.mb; in lpfc_read_config()
751 mb->mbxCommand = MBX_READ_CONFIG; in lpfc_read_config()
752 mb->mbxOwner = OWN_HOST; in lpfc_read_config()
757 * lpfc_read_lnk_stat - Prepare a mailbox command for reading HBA link stats
762 * the HBA. Link status includes all link-related error counters. These
773 mb = &pmb->u.mb; in lpfc_read_lnk_stat()
776 mb->mbxCommand = MBX_READ_LNK_STAT; in lpfc_read_lnk_stat()
777 mb->mbxOwner = OWN_HOST; in lpfc_read_lnk_stat()
782 * lpfc_reg_rpi - Prepare a mailbox command for registering remote login
792 * service parameters internally and thereby make the appropriate FC-2
802 * 0 - Success
803 * 1 - DMA memory allocation failed
809 MAILBOX_t *mb = &pmb->u.mb; in lpfc_reg_rpi()
816 mb->un.varRegLogin.rpi = 0; in lpfc_reg_rpi()
817 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_reg_rpi()
818 mb->un.varRegLogin.rpi = phba->sli4_hba.rpi_ids[rpi]; in lpfc_reg_rpi()
819 if (phba->sli_rev >= LPFC_SLI_REV3) in lpfc_reg_rpi()
820 mb->un.varRegLogin.vpi = phba->vpi_ids[vpi]; in lpfc_reg_rpi()
821 mb->un.varRegLogin.did = did; in lpfc_reg_rpi()
822 mb->mbxOwner = OWN_HOST; in lpfc_reg_rpi()
827 mb->mbxCommand = MBX_REG_LOGIN64; in lpfc_reg_rpi()
836 mp = pmb->ctx_buf; in lpfc_reg_rpi()
837 sparam = mp->virt; in lpfc_reg_rpi()
841 mb->mbxCommand = MBX_REG_LOGIN64; in lpfc_reg_rpi()
842 mb->un.varRegLogin.un.sp64.tus.f.bdeSize = sizeof (struct serv_parm); in lpfc_reg_rpi()
843 mb->un.varRegLogin.un.sp64.addrHigh = putPaddrHigh(mp->phys); in lpfc_reg_rpi()
844 mb->un.varRegLogin.un.sp64.addrLow = putPaddrLow(mp->phys); in lpfc_reg_rpi()
850 * lpfc_unreg_login - Prepare a mailbox command for unregistering remote login
872 mb = &pmb->u.mb; in lpfc_unreg_login()
875 mb->un.varUnregLogin.rpi = rpi; in lpfc_unreg_login()
876 mb->un.varUnregLogin.rsvd1 = 0; in lpfc_unreg_login()
877 if (phba->sli_rev >= LPFC_SLI_REV3) in lpfc_unreg_login()
878 mb->un.varUnregLogin.vpi = phba->vpi_ids[vpi]; in lpfc_unreg_login()
880 mb->mbxCommand = MBX_UNREG_LOGIN; in lpfc_unreg_login()
881 mb->mbxOwner = OWN_HOST; in lpfc_unreg_login()
887 * lpfc_sli4_unreg_all_rpis - unregister all RPIs for a vport on SLI4 HBA.
896 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_unreg_all_rpis()
900 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_sli4_unreg_all_rpis()
909 lpfc_unreg_login(phba, vport->vpi, phba->vpi_ids[vport->vpi], in lpfc_sli4_unreg_all_rpis()
911 mbox->u.mb.un.varUnregLogin.rsvd1 = 0x4000; in lpfc_sli4_unreg_all_rpis()
912 mbox->vport = vport; in lpfc_sli4_unreg_all_rpis()
913 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; in lpfc_sli4_unreg_all_rpis()
914 mbox->ctx_ndlp = NULL; in lpfc_sli4_unreg_all_rpis()
917 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_sli4_unreg_all_rpis()
922 * lpfc_reg_vpi - Prepare a mailbox command for registering vport identifier
937 MAILBOX_t *mb = &pmb->u.mb; in lpfc_reg_vpi()
938 struct lpfc_hba *phba = vport->phba; in lpfc_reg_vpi()
942 * Set the re-reg VPI bit for f/w to update the MAC address. in lpfc_reg_vpi()
944 if ((phba->sli_rev == LPFC_SLI_REV4) && in lpfc_reg_vpi()
945 !test_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag)) in lpfc_reg_vpi()
946 mb->un.varRegVpi.upd = 1; in lpfc_reg_vpi()
948 mb->un.varRegVpi.vpi = phba->vpi_ids[vport->vpi]; in lpfc_reg_vpi()
949 mb->un.varRegVpi.sid = vport->fc_myDID; in lpfc_reg_vpi()
950 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_reg_vpi()
951 mb->un.varRegVpi.vfi = phba->sli4_hba.vfi_ids[vport->vfi]; in lpfc_reg_vpi()
953 mb->un.varRegVpi.vfi = vport->vfi + vport->phba->vfi_base; in lpfc_reg_vpi()
954 memcpy(mb->un.varRegVpi.wwn, &vport->fc_portname, in lpfc_reg_vpi()
956 mb->un.varRegVpi.wwn[0] = cpu_to_le32(mb->un.varRegVpi.wwn[0]); in lpfc_reg_vpi()
957 mb->un.varRegVpi.wwn[1] = cpu_to_le32(mb->un.varRegVpi.wwn[1]); in lpfc_reg_vpi()
959 mb->mbxCommand = MBX_REG_VPI; in lpfc_reg_vpi()
960 mb->mbxOwner = OWN_HOST; in lpfc_reg_vpi()
966 * lpfc_unreg_vpi - Prepare a mailbox command for unregistering vport id
984 MAILBOX_t *mb = &pmb->u.mb; in lpfc_unreg_vpi()
987 if (phba->sli_rev == LPFC_SLI_REV3) in lpfc_unreg_vpi()
988 mb->un.varUnregVpi.vpi = phba->vpi_ids[vpi]; in lpfc_unreg_vpi()
989 else if (phba->sli_rev >= LPFC_SLI_REV4) in lpfc_unreg_vpi()
990 mb->un.varUnregVpi.sli4_vpi = phba->vpi_ids[vpi]; in lpfc_unreg_vpi()
992 mb->mbxCommand = MBX_UNREG_VPI; in lpfc_unreg_vpi()
993 mb->mbxOwner = OWN_HOST; in lpfc_unreg_vpi()
999 * lpfc_config_pcb_setup - Set up IOCB rings in the Port Control Block (PCB)
1008 struct lpfc_sli *psli = &phba->sli; in lpfc_config_pcb_setup()
1010 PCB_t *pcbp = phba->pcb; in lpfc_config_pcb_setup()
1016 pcbp->maxRing = (psli->num_rings - 1); in lpfc_config_pcb_setup()
1018 for (i = 0; i < psli->num_rings; i++) { in lpfc_config_pcb_setup()
1019 pring = &psli->sli3_ring[i]; in lpfc_config_pcb_setup()
1021 pring->sli.sli3.sizeCiocb = in lpfc_config_pcb_setup()
1022 phba->sli_rev == 3 ? SLI3_IOCB_CMD_SIZE : in lpfc_config_pcb_setup()
1024 pring->sli.sli3.sizeRiocb = in lpfc_config_pcb_setup()
1025 phba->sli_rev == 3 ? SLI3_IOCB_RSP_SIZE : in lpfc_config_pcb_setup()
1029 if ((pring->sli.sli3.numCiocb == 0) || in lpfc_config_pcb_setup()
1030 (pring->sli.sli3.numRiocb == 0)) { in lpfc_config_pcb_setup()
1031 pcbp->rdsc[i].cmdEntries = 0; in lpfc_config_pcb_setup()
1032 pcbp->rdsc[i].rspEntries = 0; in lpfc_config_pcb_setup()
1033 pcbp->rdsc[i].cmdAddrHigh = 0; in lpfc_config_pcb_setup()
1034 pcbp->rdsc[i].rspAddrHigh = 0; in lpfc_config_pcb_setup()
1035 pcbp->rdsc[i].cmdAddrLow = 0; in lpfc_config_pcb_setup()
1036 pcbp->rdsc[i].rspAddrLow = 0; in lpfc_config_pcb_setup()
1037 pring->sli.sli3.cmdringaddr = NULL; in lpfc_config_pcb_setup()
1038 pring->sli.sli3.rspringaddr = NULL; in lpfc_config_pcb_setup()
1042 pring->sli.sli3.cmdringaddr = (void *)&phba->IOCBs[iocbCnt]; in lpfc_config_pcb_setup()
1043 pcbp->rdsc[i].cmdEntries = pring->sli.sli3.numCiocb; in lpfc_config_pcb_setup()
1045 offset = (uint8_t *) &phba->IOCBs[iocbCnt] - in lpfc_config_pcb_setup()
1046 (uint8_t *) phba->slim2p.virt; in lpfc_config_pcb_setup()
1047 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_pcb_setup()
1048 pcbp->rdsc[i].cmdAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_pcb_setup()
1049 pcbp->rdsc[i].cmdAddrLow = putPaddrLow(pdma_addr); in lpfc_config_pcb_setup()
1050 iocbCnt += pring->sli.sli3.numCiocb; in lpfc_config_pcb_setup()
1053 pring->sli.sli3.rspringaddr = (void *) &phba->IOCBs[iocbCnt]; in lpfc_config_pcb_setup()
1055 pcbp->rdsc[i].rspEntries = pring->sli.sli3.numRiocb; in lpfc_config_pcb_setup()
1056 offset = (uint8_t *)&phba->IOCBs[iocbCnt] - in lpfc_config_pcb_setup()
1057 (uint8_t *)phba->slim2p.virt; in lpfc_config_pcb_setup()
1058 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_pcb_setup()
1059 pcbp->rdsc[i].rspAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_pcb_setup()
1060 pcbp->rdsc[i].rspAddrLow = putPaddrLow(pdma_addr); in lpfc_config_pcb_setup()
1061 iocbCnt += pring->sli.sli3.numRiocb; in lpfc_config_pcb_setup()
1066 * lpfc_read_rev - Prepare a mailbox command for reading HBA revision
1072 * firmware, and available firmware. HBAs that supports SLI-3 mode of
1082 MAILBOX_t *mb = &pmb->u.mb; in lpfc_read_rev()
1084 mb->un.varRdRev.cv = 1; in lpfc_read_rev()
1085 mb->un.varRdRev.v3req = 1; /* Request SLI3 info */ in lpfc_read_rev()
1086 mb->mbxCommand = MBX_READ_REV; in lpfc_read_rev()
1087 mb->mbxOwner = OWN_HOST; in lpfc_read_rev()
1094 MAILBOX_t *mb = &pmb->u.mb; in lpfc_sli4_swap_str()
1097 switch (mb->mbxCommand) { in lpfc_sli4_swap_str()
1099 mqe = &pmb->u.mqe; in lpfc_sli4_swap_str()
1100 lpfc_sli_pcimem_bcopy(mqe->un.read_rev.fw_name, in lpfc_sli4_swap_str()
1101 mqe->un.read_rev.fw_name, 16); in lpfc_sli4_swap_str()
1102 lpfc_sli_pcimem_bcopy(mqe->un.read_rev.ulp_fw_name, in lpfc_sli4_swap_str()
1103 mqe->un.read_rev.ulp_fw_name, 16); in lpfc_sli4_swap_str()
1112 * lpfc_build_hbq_profile2 - Set up the HBQ Selection Profile 2
1125 hbqmb->profiles.profile2.seqlenbcnt = hbq_desc->seqlenbcnt; in lpfc_build_hbq_profile2()
1126 hbqmb->profiles.profile2.maxlen = hbq_desc->maxlen; in lpfc_build_hbq_profile2()
1127 hbqmb->profiles.profile2.seqlenoff = hbq_desc->seqlenoff; in lpfc_build_hbq_profile2()
1131 * lpfc_build_hbq_profile3 - Set up the HBQ Selection Profile 3
1144 hbqmb->profiles.profile3.seqlenbcnt = hbq_desc->seqlenbcnt; in lpfc_build_hbq_profile3()
1145 hbqmb->profiles.profile3.maxlen = hbq_desc->maxlen; in lpfc_build_hbq_profile3()
1146 hbqmb->profiles.profile3.cmdcodeoff = hbq_desc->cmdcodeoff; in lpfc_build_hbq_profile3()
1147 hbqmb->profiles.profile3.seqlenoff = hbq_desc->seqlenoff; in lpfc_build_hbq_profile3()
1148 memcpy(&hbqmb->profiles.profile3.cmdmatch, hbq_desc->cmdmatch, in lpfc_build_hbq_profile3()
1149 sizeof(hbqmb->profiles.profile3.cmdmatch)); in lpfc_build_hbq_profile3()
1153 * lpfc_build_hbq_profile5 - Set up the HBQ Selection Profile 5
1167 hbqmb->profiles.profile5.seqlenbcnt = hbq_desc->seqlenbcnt; in lpfc_build_hbq_profile5()
1168 hbqmb->profiles.profile5.maxlen = hbq_desc->maxlen; in lpfc_build_hbq_profile5()
1169 hbqmb->profiles.profile5.cmdcodeoff = hbq_desc->cmdcodeoff; in lpfc_build_hbq_profile5()
1170 hbqmb->profiles.profile5.seqlenoff = hbq_desc->seqlenoff; in lpfc_build_hbq_profile5()
1171 memcpy(&hbqmb->profiles.profile5.cmdmatch, hbq_desc->cmdmatch, in lpfc_build_hbq_profile5()
1172 sizeof(hbqmb->profiles.profile5.cmdmatch)); in lpfc_build_hbq_profile5()
1176 * lpfc_config_hbq - Prepare a mailbox command for configuring an HBQ
1195 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_hbq()
1196 struct config_hbq_var *hbqmb = &mb->un.varCfgHbq; in lpfc_config_hbq()
1199 hbqmb->hbqId = id; in lpfc_config_hbq()
1200 hbqmb->entry_count = hbq_desc->entry_count; /* # entries in HBQ */ in lpfc_config_hbq()
1201 hbqmb->recvNotify = hbq_desc->rn; /* Receive in lpfc_config_hbq()
1203 hbqmb->numMask = hbq_desc->mask_count; /* # R_CTL/TYPE masks in lpfc_config_hbq()
1204 * # in words 0-19 */ in lpfc_config_hbq()
1205 hbqmb->profile = hbq_desc->profile; /* Selection profile: in lpfc_config_hbq()
1208 hbqmb->ringMask = hbq_desc->ring_mask; /* Binds HBQ to a ring in lpfc_config_hbq()
1211 hbqmb->headerLen = hbq_desc->headerLen; /* 0 if not profile 4 in lpfc_config_hbq()
1213 hbqmb->logEntry = hbq_desc->logEntry; /* Set to 1 if this in lpfc_config_hbq()
1217 hbqmb->hbqaddrLow = putPaddrLow(phba->hbqslimp.phys) + in lpfc_config_hbq()
1219 hbqmb->hbqaddrHigh = putPaddrHigh(phba->hbqslimp.phys); in lpfc_config_hbq()
1221 mb->mbxCommand = MBX_CONFIG_HBQ; in lpfc_config_hbq()
1222 mb->mbxOwner = OWN_HOST; in lpfc_config_hbq()
1227 if (hbq_desc->profile == 2) in lpfc_config_hbq()
1229 else if (hbq_desc->profile == 3) in lpfc_config_hbq()
1231 else if (hbq_desc->profile == 5) in lpfc_config_hbq()
1235 if (!hbq_desc->mask_count) in lpfc_config_hbq()
1239 for (i = 0; i < hbq_desc->mask_count; i++) { in lpfc_config_hbq()
1240 hbqmb->hbqMasks[i].tmatch = hbq_desc->hbqMasks[i].tmatch; in lpfc_config_hbq()
1241 hbqmb->hbqMasks[i].tmask = hbq_desc->hbqMasks[i].tmask; in lpfc_config_hbq()
1242 hbqmb->hbqMasks[i].rctlmatch = hbq_desc->hbqMasks[i].rctlmatch; in lpfc_config_hbq()
1243 hbqmb->hbqMasks[i].rctlmask = hbq_desc->hbqMasks[i].rctlmask; in lpfc_config_hbq()
1250 * lpfc_config_ring - Prepare a mailbox command for configuring an IOCB ring
1270 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_ring()
1276 mb->un.varCfgRing.ring = ring; in lpfc_config_ring()
1277 mb->un.varCfgRing.maxOrigXchg = 0; in lpfc_config_ring()
1278 mb->un.varCfgRing.maxRespXchg = 0; in lpfc_config_ring()
1279 mb->un.varCfgRing.recvNotify = 1; in lpfc_config_ring()
1281 psli = &phba->sli; in lpfc_config_ring()
1282 pring = &psli->sli3_ring[ring]; in lpfc_config_ring()
1283 mb->un.varCfgRing.numMask = pring->num_mask; in lpfc_config_ring()
1284 mb->mbxCommand = MBX_CONFIG_RING; in lpfc_config_ring()
1285 mb->mbxOwner = OWN_HOST; in lpfc_config_ring()
1288 if (pring->prt[0].profile) { in lpfc_config_ring()
1289 mb->un.varCfgRing.profile = pring->prt[0].profile; in lpfc_config_ring()
1294 for (i = 0; i < pring->num_mask; i++) { in lpfc_config_ring()
1295 mb->un.varCfgRing.rrRegs[i].rval = pring->prt[i].rctl; in lpfc_config_ring()
1296 if (mb->un.varCfgRing.rrRegs[i].rval != FC_RCTL_ELS_REQ) in lpfc_config_ring()
1297 mb->un.varCfgRing.rrRegs[i].rmask = 0xff; in lpfc_config_ring()
1299 mb->un.varCfgRing.rrRegs[i].rmask = 0xfe; in lpfc_config_ring()
1300 mb->un.varCfgRing.rrRegs[i].tval = pring->prt[i].type; in lpfc_config_ring()
1301 mb->un.varCfgRing.rrRegs[i].tmask = 0xff; in lpfc_config_ring()
1308 * lpfc_config_port - Prepare a mailbox command for configuring port
1324 MAILBOX_t __iomem *mb_slim = (MAILBOX_t __iomem *) phba->MBslimaddr; in lpfc_config_port()
1325 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_port()
1334 mb->mbxCommand = MBX_CONFIG_PORT; in lpfc_config_port()
1335 mb->mbxOwner = OWN_HOST; in lpfc_config_port()
1337 mb->un.varCfgPort.pcbLen = sizeof(PCB_t); in lpfc_config_port()
1339 offset = (uint8_t *)phba->pcb - (uint8_t *)phba->slim2p.virt; in lpfc_config_port()
1340 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_port()
1341 mb->un.varCfgPort.pcbLow = putPaddrLow(pdma_addr); in lpfc_config_port()
1342 mb->un.varCfgPort.pcbHigh = putPaddrHigh(pdma_addr); in lpfc_config_port()
1345 mb->un.varCfgPort.hps = 1; in lpfc_config_port()
1349 if (phba->sli_rev == LPFC_SLI_REV3 && phba->vpd.sli3Feat.cerbm) { in lpfc_config_port()
1350 if (phba->cfg_enable_bg) in lpfc_config_port()
1351 mb->un.varCfgPort.cbg = 1; /* configure BlockGuard */ in lpfc_config_port()
1352 mb->un.varCfgPort.cerbm = 1; /* Request HBQs */ in lpfc_config_port()
1353 mb->un.varCfgPort.ccrp = 1; /* Command Ring Polling */ in lpfc_config_port()
1354 mb->un.varCfgPort.max_hbq = lpfc_sli_hbq_count(); in lpfc_config_port()
1355 if (phba->max_vpi && phba->cfg_enable_npiv && in lpfc_config_port()
1356 phba->vpd.sli3Feat.cmv) { in lpfc_config_port()
1357 mb->un.varCfgPort.max_vpi = LPFC_MAX_VPI; in lpfc_config_port()
1358 mb->un.varCfgPort.cmv = 1; in lpfc_config_port()
1360 mb->un.varCfgPort.max_vpi = phba->max_vpi = 0; in lpfc_config_port()
1362 phba->sli_rev = LPFC_SLI_REV2; in lpfc_config_port()
1363 mb->un.varCfgPort.sli_mode = phba->sli_rev; in lpfc_config_port()
1366 if (phba->sli_rev == LPFC_SLI_REV3) in lpfc_config_port()
1367 mb->un.varCfgPort.casabt = 1; in lpfc_config_port()
1370 phba->pcb->type = TYPE_NATIVE_SLI2; in lpfc_config_port()
1371 phba->pcb->feature = FEATURE_INITIAL_SLI2; in lpfc_config_port()
1374 phba->pcb->mailBoxSize = sizeof(MAILBOX_t) + MAILBOX_EXT_SIZE; in lpfc_config_port()
1375 offset = (uint8_t *)phba->mbox - (uint8_t *)phba->slim2p.virt; in lpfc_config_port()
1376 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_port()
1377 phba->pcb->mbAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_port()
1378 phba->pcb->mbAddrLow = putPaddrLow(pdma_addr); in lpfc_config_port()
1399 pci_read_config_dword(phba->pcidev, PCI_BASE_ADDRESS_0, &bar_low); in lpfc_config_port()
1400 pci_read_config_dword(phba->pcidev, PCI_BASE_ADDRESS_1, &bar_high); in lpfc_config_port()
1403 * Set up HGP - Port Memory in lpfc_config_port()
1406 * following the "non-diagnostic" mode mailbox (32 words, 0x80 bytes) in lpfc_config_port()
1407 * area of SLIM. In SLI-2 mode, there's an additional 16 reserved in lpfc_config_port()
1409 * configured in SLI-3. in lpfc_config_port()
1411 * CR0Put - SLI2(no HBQs) = 0xc0, With HBQs = 0x80 in lpfc_config_port()
1420 * Reserved 0xa0-0xbf in lpfc_config_port()
1426 * HBQ(M-1)Put Pointer 0xc0+(M-1)*4 in lpfc_config_port()
1430 if (phba->cfg_hostmem_hgp && phba->sli_rev != 3) { in lpfc_config_port()
1431 phba->host_gp = (struct lpfc_hgp __iomem *) in lpfc_config_port()
1432 &phba->mbox->us.s2.host[0]; in lpfc_config_port()
1433 phba->hbq_put = NULL; in lpfc_config_port()
1434 offset = (uint8_t *)&phba->mbox->us.s2.host - in lpfc_config_port()
1435 (uint8_t *)phba->slim2p.virt; in lpfc_config_port()
1436 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_port()
1437 phba->pcb->hgpAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_port()
1438 phba->pcb->hgpAddrLow = putPaddrLow(pdma_addr); in lpfc_config_port()
1441 mb->un.varCfgPort.hps = 1; in lpfc_config_port()
1443 if (phba->sli_rev == 3) { in lpfc_config_port()
1444 phba->host_gp = &mb_slim->us.s3.host[0]; in lpfc_config_port()
1445 phba->hbq_put = &mb_slim->us.s3.hbq_put[0]; in lpfc_config_port()
1447 phba->host_gp = &mb_slim->us.s2.host[0]; in lpfc_config_port()
1448 phba->hbq_put = NULL; in lpfc_config_port()
1451 /* mask off BAR0's flag bits 0 - 3 */ in lpfc_config_port()
1452 phba->pcb->hgpAddrLow = (bar_low & PCI_BASE_ADDRESS_MEM_MASK) + in lpfc_config_port()
1453 (void __iomem *)phba->host_gp - in lpfc_config_port()
1454 (void __iomem *)phba->MBslimaddr; in lpfc_config_port()
1456 phba->pcb->hgpAddrHigh = bar_high; in lpfc_config_port()
1458 phba->pcb->hgpAddrHigh = 0; in lpfc_config_port()
1462 for (i = 0; i < phba->sli.num_rings; i++) { in lpfc_config_port()
1463 lpfc_memcpy_to_slim(phba->host_gp + i, &hgp, in lpfc_config_port()
1464 sizeof(*phba->host_gp)); in lpfc_config_port()
1469 if (phba->sli_rev == 3) in lpfc_config_port()
1474 pdma_addr = phba->slim2p.phys + pgp_offset; in lpfc_config_port()
1475 phba->pcb->pgpAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_port()
1476 phba->pcb->pgpAddrLow = putPaddrLow(pdma_addr); in lpfc_config_port()
1482 if (lpfc_is_LC_HBA(phba->pcidev->device)) { in lpfc_config_port()
1487 memcpy(&mb->un.varCfgPort.hbainit, hbainit, 20); in lpfc_config_port()
1491 lpfc_sli_pcimem_bcopy(phba->pcb, phba->pcb, sizeof(PCB_t)); in lpfc_config_port()
1495 * lpfc_kill_board - Prepare a mailbox command for killing board
1512 MAILBOX_t *mb = &pmb->u.mb; in lpfc_kill_board()
1515 mb->mbxCommand = MBX_KILL_BOARD; in lpfc_kill_board()
1516 mb->mbxOwner = OWN_HOST; in lpfc_kill_board()
1521 * lpfc_mbox_put - Put a mailbox cmd into the tail of driver's mailbox queue
1535 psli = &phba->sli; in lpfc_mbox_put()
1537 list_add_tail(&mbq->list, &psli->mboxq); in lpfc_mbox_put()
1539 psli->mboxq_cnt++; in lpfc_mbox_put()
1545 * lpfc_mbox_get - Remove a mailbox cmd from the head of driver's mailbox queue
1562 struct lpfc_sli *psli = &phba->sli; in lpfc_mbox_get()
1564 list_remove_head((&psli->mboxq), mbq, LPFC_MBOXQ_t, list); in lpfc_mbox_get()
1566 psli->mboxq_cnt--; in lpfc_mbox_get()
1572 * __lpfc_mbox_cmpl_put - Put mailbox cmd into mailbox cmd complete list
1584 list_add_tail(&mbq->list, &phba->sli.mboxq_cmpl); in __lpfc_mbox_cmpl_put()
1588 * lpfc_mbox_cmpl_put - Put mailbox command into mailbox command complete list
1603 spin_lock_irqsave(&phba->hbalock, iflag); in lpfc_mbox_cmpl_put()
1605 spin_unlock_irqrestore(&phba->hbalock, iflag); in lpfc_mbox_cmpl_put()
1610 * lpfc_mbox_cmd_check - Check the validality of a mailbox command
1618 * Return 0 - pass the check, -ENODEV - fail the check
1626 if (mboxq->mbox_cmpl && mboxq->mbox_cmpl != lpfc_sli_def_mbox_cmpl && in lpfc_mbox_cmd_check()
1627 mboxq->mbox_cmpl != lpfc_sli_wake_mbox_wait) { in lpfc_mbox_cmd_check()
1628 if (!mboxq->vport) { in lpfc_mbox_cmd_check()
1631 mboxq->u.mb.mbxCommand); in lpfc_mbox_cmd_check()
1633 return -ENODEV; in lpfc_mbox_cmd_check()
1640 * lpfc_mbox_dev_check - Check the device state for issuing a mailbox command
1647 * Return 0 - pass the check, -ENODEV - fail the check
1653 if (unlikely(pci_channel_offline(phba->pcidev))) in lpfc_mbox_dev_check()
1654 return -ENODEV; in lpfc_mbox_dev_check()
1657 if (phba->link_state == LPFC_HBA_ERROR) in lpfc_mbox_dev_check()
1658 return -ENODEV; in lpfc_mbox_dev_check()
1664 * lpfc_mbox_tmo_val - Retrieve mailbox command timeout value
1677 MAILBOX_t *mbox = &mboxq->u.mb; in lpfc_mbox_tmo_val()
1680 switch (mbox->mbxCommand) { in lpfc_mbox_tmo_val()
1727 * lpfc_sli4_mbx_sge_set - Set a sge entry in non-embedded mailbox command
1733 * This routine sets up an entry in the non-embedded mailbox command at the sge
1743 &mbox->u.mqe.un.nembed_cmd; in lpfc_sli4_mbx_sge_set()
1744 nembed_sge->sge[sgentry].pa_lo = putPaddrLow(phyaddr); in lpfc_sli4_mbx_sge_set()
1745 nembed_sge->sge[sgentry].pa_hi = putPaddrHigh(phyaddr); in lpfc_sli4_mbx_sge_set()
1746 nembed_sge->sge[sgentry].length = length; in lpfc_sli4_mbx_sge_set()
1750 * lpfc_sli4_mbx_sge_get - Get a sge entry from non-embedded mailbox command
1755 * This routine gets an entry from the non-embedded mailbox command at the sge
1765 &mbox->u.mqe.un.nembed_cmd; in lpfc_sli4_mbx_sge_get()
1766 sge->pa_lo = nembed_sge->sge[sgentry].pa_lo; in lpfc_sli4_mbx_sge_get()
1767 sge->pa_hi = nembed_sge->sge[sgentry].pa_hi; in lpfc_sli4_mbx_sge_get()
1768 sge->length = nembed_sge->sge[sgentry].length; in lpfc_sli4_mbx_sge_get()
1772 * lpfc_sli4_mbox_cmd_free - Free a sli4 mailbox command
1778 * non-embedded config types.
1788 sli4_cfg = &mbox->u.mqe.un.sli4_config; in lpfc_sli4_mbox_cmd_free()
1791 if (bf_get(lpfc_mbox_hdr_emb, &sli4_cfg->header.cfg_mhdr)) { in lpfc_sli4_mbox_cmd_free()
1792 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_sli4_mbox_cmd_free()
1796 /* For non-embedded mbox command, we need to free the pages first */ in lpfc_sli4_mbox_cmd_free()
1797 sgecount = bf_get(lpfc_mbox_hdr_sge_cnt, &sli4_cfg->header.cfg_mhdr); in lpfc_sli4_mbox_cmd_free()
1799 if (unlikely(!mbox->sge_array)) { in lpfc_sli4_mbox_cmd_free()
1800 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_sli4_mbox_cmd_free()
1803 /* Each non-embedded DMA memory was allocated in the length of a page */ in lpfc_sli4_mbox_cmd_free()
1807 dma_free_coherent(&phba->pcidev->dev, SLI4_PAGE_SIZE, in lpfc_sli4_mbox_cmd_free()
1808 mbox->sge_array->addr[sgentry], phyaddr); in lpfc_sli4_mbox_cmd_free()
1811 mbox->ctx_buf = NULL; in lpfc_sli4_mbox_cmd_free()
1812 memset(&mbox->ctx_u, 0, sizeof(mbox->ctx_u)); in lpfc_sli4_mbox_cmd_free()
1813 kfree(mbox->sge_array); in lpfc_sli4_mbox_cmd_free()
1815 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_sli4_mbox_cmd_free()
1819 * lpfc_sli4_config - Initialize the SLI4 Config Mailbox command
1824 * @length: Length of the sli4 config mailbox command (including sub-header).
1847 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_SLI4_CONFIG); in lpfc_sli4_config()
1850 sli4_config = &mbox->u.mqe.un.sli4_config; in lpfc_sli4_config()
1855 bf_set(lpfc_mbox_hdr_emb, &sli4_config->header.cfg_mhdr, 1); in lpfc_sli4_config()
1856 sli4_config->header.cfg_mhdr.payload_length = length; in lpfc_sli4_config()
1857 /* Set up sub-header fields following main header */ in lpfc_sli4_config()
1859 &sli4_config->header.cfg_shdr.request, opcode); in lpfc_sli4_config()
1861 &sli4_config->header.cfg_shdr.request, subsystem); in lpfc_sli4_config()
1862 sli4_config->header.cfg_shdr.request.request_length = in lpfc_sli4_config()
1863 length - LPFC_MBX_CMD_HDR_LENGTH; in lpfc_sli4_config()
1867 /* Setup for the non-embedded mbox command */ in lpfc_sli4_config()
1872 mbox->sge_array = kzalloc(sizeof(struct lpfc_mbx_nembed_sge_virt), in lpfc_sli4_config()
1874 if (!mbox->sge_array) { in lpfc_sli4_config()
1876 "2527 Failed to allocate non-embedded SGE " in lpfc_sli4_config()
1886 viraddr = dma_alloc_coherent(&phba->pcidev->dev, in lpfc_sli4_config()
1892 mbox->sge_array->addr[pagen] = viraddr; in lpfc_sli4_config()
1893 /* Keep the first page for later sub-header construction */ in lpfc_sli4_config()
1896 resid_len = length - alloc_len; in lpfc_sli4_config()
1909 sli4_config->header.cfg_mhdr.payload_length = alloc_len; in lpfc_sli4_config()
1910 bf_set(lpfc_mbox_hdr_sge_cnt, &sli4_config->header.cfg_mhdr, pagen); in lpfc_sli4_config()
1912 /* Set up sub-header fields into the first page */ in lpfc_sli4_config()
1914 bf_set(lpfc_mbox_hdr_opcode, &cfg_shdr->request, opcode); in lpfc_sli4_config()
1915 bf_set(lpfc_mbox_hdr_subsystem, &cfg_shdr->request, subsystem); in lpfc_sli4_config()
1916 cfg_shdr->request.request_length = in lpfc_sli4_config()
1917 alloc_len - sizeof(union lpfc_sli4_cfg_shdr); in lpfc_sli4_config()
1919 /* The sub-header is in DMA memory, which needs endian converstion */ in lpfc_sli4_config()
1927 * lpfc_sli4_mbox_rsrc_extent - Initialize the opcode resource extent.
1951 /* Get the first SGE entry from the non-embedded DMA memory */ in lpfc_sli4_mbox_rsrc_extent()
1952 virtaddr = mbox->sge_array->addr[0]; in lpfc_sli4_mbox_rsrc_extent()
1964 &mbox->u.mqe.un.alloc_rsrc_extents.u.req, in lpfc_sli4_mbox_rsrc_extent()
1970 lpfc_sli_pcimem_bcopy(&n_rsrc_extnt->word4, in lpfc_sli4_mbox_rsrc_extent()
1971 &n_rsrc_extnt->word4, in lpfc_sli4_mbox_rsrc_extent()
1981 &mbox->u.mqe.un.alloc_rsrc_extents.u.req, in lpfc_sli4_mbox_rsrc_extent()
2003 * lpfc_sli_config_mbox_subsys_get - Get subsystem from a sli_config mbox cmd
2009 * sub-header is not present, subsystem LPFC_MBOX_SUBSYSTEM_NA (0x0) shall
2018 if (mbox->u.mb.mbxCommand != MBX_SLI4_CONFIG) in lpfc_sli_config_mbox_subsys_get()
2020 sli4_cfg = &mbox->u.mqe.un.sli4_config; in lpfc_sli_config_mbox_subsys_get()
2022 /* For embedded mbox command, get opcode from embedded sub-header*/ in lpfc_sli_config_mbox_subsys_get()
2023 if (bf_get(lpfc_mbox_hdr_emb, &sli4_cfg->header.cfg_mhdr)) { in lpfc_sli_config_mbox_subsys_get()
2024 cfg_shdr = &mbox->u.mqe.un.sli4_config.header.cfg_shdr; in lpfc_sli_config_mbox_subsys_get()
2025 return bf_get(lpfc_mbox_hdr_subsystem, &cfg_shdr->request); in lpfc_sli_config_mbox_subsys_get()
2028 /* For non-embedded mbox command, get opcode from first dma page */ in lpfc_sli_config_mbox_subsys_get()
2029 if (unlikely(!mbox->sge_array)) in lpfc_sli_config_mbox_subsys_get()
2031 cfg_shdr = (union lpfc_sli4_cfg_shdr *)mbox->sge_array->addr[0]; in lpfc_sli_config_mbox_subsys_get()
2032 return bf_get(lpfc_mbox_hdr_subsystem, &cfg_shdr->request); in lpfc_sli_config_mbox_subsys_get()
2036 * lpfc_sli_config_mbox_opcode_get - Get opcode from a sli_config mbox cmd
2042 * the sub-header is not present, opcode LPFC_MBOX_OPCODE_NA (0x0) be
2051 if (mbox->u.mb.mbxCommand != MBX_SLI4_CONFIG) in lpfc_sli_config_mbox_opcode_get()
2053 sli4_cfg = &mbox->u.mqe.un.sli4_config; in lpfc_sli_config_mbox_opcode_get()
2055 /* For embedded mbox command, get opcode from embedded sub-header*/ in lpfc_sli_config_mbox_opcode_get()
2056 if (bf_get(lpfc_mbox_hdr_emb, &sli4_cfg->header.cfg_mhdr)) { in lpfc_sli_config_mbox_opcode_get()
2057 cfg_shdr = &mbox->u.mqe.un.sli4_config.header.cfg_shdr; in lpfc_sli_config_mbox_opcode_get()
2058 return bf_get(lpfc_mbox_hdr_opcode, &cfg_shdr->request); in lpfc_sli_config_mbox_opcode_get()
2061 /* For non-embedded mbox command, get opcode from first dma page */ in lpfc_sli_config_mbox_opcode_get()
2062 if (unlikely(!mbox->sge_array)) in lpfc_sli_config_mbox_opcode_get()
2064 cfg_shdr = (union lpfc_sli4_cfg_shdr *)mbox->sge_array->addr[0]; in lpfc_sli_config_mbox_opcode_get()
2065 return bf_get(lpfc_mbox_hdr_opcode, &cfg_shdr->request); in lpfc_sli_config_mbox_opcode_get()
2069 * lpfc_sli4_mbx_read_fcf_rec - Allocate and construct read fcf mbox cmd
2074 * This routine routine allocates and constructs non-embedded mailbox command
2092 return -ENOMEM; in lpfc_sli4_mbx_read_fcf_rec()
2097 /* Set up READ_FCF SLI4_CONFIG mailbox-ioctl command */ in lpfc_sli4_mbx_read_fcf_rec()
2107 return -ENOMEM; in lpfc_sli4_mbx_read_fcf_rec()
2110 /* Get the first SGE entry from the non-embedded DMA memory. This in lpfc_sli4_mbx_read_fcf_rec()
2114 virt_addr = mboxq->sge_array->addr[0]; in lpfc_sli4_mbx_read_fcf_rec()
2118 bf_set(lpfc_mbx_read_fcf_tbl_indx, &read_fcf->u.request, fcf_index); in lpfc_sli4_mbx_read_fcf_rec()
2139 bf_set(lpfc_mqe_command, &mboxq->u.mqe, MBX_SLI4_REQ_FTRS); in lpfc_request_features()
2142 bf_set(lpfc_mbx_rq_ftr_rq_fcpi, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2143 bf_set(lpfc_mbx_rq_ftr_rq_perfh, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2146 if (phba->cfg_enable_bg) in lpfc_request_features()
2147 bf_set(lpfc_mbx_rq_ftr_rq_dif, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2150 if (phba->max_vpi && phba->cfg_enable_npiv) in lpfc_request_features()
2151 bf_set(lpfc_mbx_rq_ftr_rq_npiv, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2153 if (phba->nvmet_support) { in lpfc_request_features()
2154 bf_set(lpfc_mbx_rq_ftr_rq_mrqp, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2156 bf_set(lpfc_mbx_rq_ftr_rq_iaab, &mboxq->u.mqe.un.req_ftrs, 0); in lpfc_request_features()
2157 bf_set(lpfc_mbx_rq_ftr_rq_iaar, &mboxq->u.mqe.un.req_ftrs, 0); in lpfc_request_features()
2161 if (phba->cfg_vmid_app_header) { in lpfc_request_features()
2162 bf_set(lpfc_mbx_rq_ftr_rq_ashdr, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2163 bf_set(lpfc_ftr_ashdr, &phba->sli4_hba.sli4_flags, 1); in lpfc_request_features()
2169 * lpfc_init_vfi - Initialize the INIT_VFI mailbox command
2185 mbox->vport = vport; in lpfc_init_vfi()
2186 init_vfi = &mbox->u.mqe.un.init_vfi; in lpfc_init_vfi()
2187 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_INIT_VFI); in lpfc_init_vfi()
2192 vport->phba->sli4_hba.vfi_ids[vport->vfi]); in lpfc_init_vfi()
2194 vport->phba->vpi_ids[vport->vpi]); in lpfc_init_vfi()
2196 vport->phba->fcf.fcfi); in lpfc_init_vfi()
2200 * lpfc_reg_vfi - Initialize the REG_VFI mailbox command
2214 struct lpfc_hba *phba = vport->phba; in lpfc_reg_vfi()
2218 reg_vfi = &mbox->u.mqe.un.reg_vfi; in lpfc_reg_vfi()
2219 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_REG_VFI); in lpfc_reg_vfi()
2222 phba->sli4_hba.vfi_ids[vport->vfi]); in lpfc_reg_vfi()
2223 bf_set(lpfc_reg_vfi_fcfi, reg_vfi, phba->fcf.fcfi); in lpfc_reg_vfi()
2224 bf_set(lpfc_reg_vfi_vpi, reg_vfi, phba->vpi_ids[vport->vpi]); in lpfc_reg_vfi()
2225 memcpy(reg_vfi->wwn, &vport->fc_portname, sizeof(struct lpfc_name)); in lpfc_reg_vfi()
2226 reg_vfi->wwn[0] = cpu_to_le32(reg_vfi->wwn[0]); in lpfc_reg_vfi()
2227 reg_vfi->wwn[1] = cpu_to_le32(reg_vfi->wwn[1]); in lpfc_reg_vfi()
2228 reg_vfi->e_d_tov = phba->fc_edtov; in lpfc_reg_vfi()
2229 reg_vfi->r_a_tov = phba->fc_ratov; in lpfc_reg_vfi()
2231 reg_vfi->bde.addrHigh = putPaddrHigh(phys); in lpfc_reg_vfi()
2232 reg_vfi->bde.addrLow = putPaddrLow(phys); in lpfc_reg_vfi()
2233 reg_vfi->bde.tus.f.bdeSize = sizeof(vport->fc_sparam); in lpfc_reg_vfi()
2234 reg_vfi->bde.tus.f.bdeFlags = BUFF_TYPE_BDE_64; in lpfc_reg_vfi()
2236 bf_set(lpfc_reg_vfi_nport_id, reg_vfi, vport->fc_myDID); in lpfc_reg_vfi()
2239 if ((phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_FC) && in lpfc_reg_vfi()
2240 test_bit(FC_VFI_REGISTERED, &vport->fc_flag) && in lpfc_reg_vfi()
2241 (!phba->fc_topology_changed)) in lpfc_reg_vfi()
2246 bbscn_fabric = (phba->fc_fabparam.cmn.bbRcvSizeMsb >> 4) & 0xF; in lpfc_reg_vfi()
2248 if (phba->bbcredit_support && phba->cfg_enable_bbcr && in lpfc_reg_vfi()
2251 &phba->sli4_hba.bbscn_params); in lpfc_reg_vfi()
2254 &phba->sli4_hba.bbscn_params); in lpfc_reg_vfi()
2269 vport->fc_myDID, in lpfc_reg_vfi()
2270 phba->fcf.fcfi, in lpfc_reg_vfi()
2271 phba->sli4_hba.vfi_ids[vport->vfi], in lpfc_reg_vfi()
2272 phba->vpi_ids[vport->vpi], in lpfc_reg_vfi()
2273 reg_vfi->wwn[0], reg_vfi->wwn[1], vport->fc_flag, in lpfc_reg_vfi()
2274 vport->port_state, phba->fc_topology_changed, in lpfc_reg_vfi()
2279 * lpfc_init_vpi - Initialize the INIT_VPI mailbox command
2294 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_INIT_VPI); in lpfc_init_vpi()
2295 bf_set(lpfc_init_vpi_vpi, &mbox->u.mqe.un.init_vpi, in lpfc_init_vpi()
2296 phba->vpi_ids[vpi]); in lpfc_init_vpi()
2297 bf_set(lpfc_init_vpi_vfi, &mbox->u.mqe.un.init_vpi, in lpfc_init_vpi()
2298 phba->sli4_hba.vfi_ids[phba->pport->vfi]); in lpfc_init_vpi()
2302 * lpfc_unreg_vfi - Initialize the UNREG_VFI mailbox command
2316 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_UNREG_VFI); in lpfc_unreg_vfi()
2317 bf_set(lpfc_unreg_vfi_vfi, &mbox->u.mqe.un.unreg_vfi, in lpfc_unreg_vfi()
2318 vport->phba->sli4_hba.vfi_ids[vport->vfi]); in lpfc_unreg_vfi()
2322 * lpfc_sli4_dump_cfg_rg23 - Dump sli4 port config region 23
2337 mb = &mbox->u.mb; in lpfc_sli4_dump_cfg_rg23()
2347 mb->mbxCommand = MBX_DUMP_MEMORY; in lpfc_sli4_dump_cfg_rg23()
2348 mb->un.varDmp.type = DMP_NV_PARAMS; in lpfc_sli4_dump_cfg_rg23()
2349 mb->un.varDmp.region_id = DMP_REGION_23; in lpfc_sli4_dump_cfg_rg23()
2350 mb->un.varDmp.sli4_length = DMP_RGN23_SIZE; in lpfc_sli4_dump_cfg_rg23()
2351 mp = mbox->ctx_buf; in lpfc_sli4_dump_cfg_rg23()
2352 mb->un.varWords[3] = putPaddrLow(mp->phys); in lpfc_sli4_dump_cfg_rg23()
2353 mb->un.varWords[4] = putPaddrHigh(mp->phys); in lpfc_sli4_dump_cfg_rg23()
2362 struct lpfc_rdp_context *rdp_context = mboxq->ctx_u.rdp; in lpfc_mbx_cmpl_rdp_link_stat()
2364 mb = &mboxq->u.mb; in lpfc_mbx_cmpl_rdp_link_stat()
2365 if (mb->mbxStatus) in lpfc_mbx_cmpl_rdp_link_stat()
2368 memcpy(&rdp_context->link_stat, &mb->un.varRdLnk, sizeof(READ_LNK_VAR)); in lpfc_mbx_cmpl_rdp_link_stat()
2374 rdp_context->cmpl(phba, rdp_context, rc); in lpfc_mbx_cmpl_rdp_link_stat()
2380 struct lpfc_dmabuf *mp = mbox->ctx_buf; in lpfc_mbx_cmpl_rdp_page_a2()
2381 struct lpfc_rdp_context *rdp_context = mbox->ctx_u.rdp; in lpfc_mbx_cmpl_rdp_page_a2()
2383 if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) in lpfc_mbx_cmpl_rdp_page_a2()
2386 lpfc_sli_bemem_bcopy(mp->virt, &rdp_context->page_a2, in lpfc_mbx_cmpl_rdp_page_a2()
2390 mbox->vport = rdp_context->ndlp->vport; in lpfc_mbx_cmpl_rdp_page_a2()
2393 mbox->ctx_buf = mp; in lpfc_mbx_cmpl_rdp_page_a2()
2394 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat; in lpfc_mbx_cmpl_rdp_page_a2()
2395 mbox->ctx_u.rdp = rdp_context; in lpfc_mbx_cmpl_rdp_page_a2()
2403 rdp_context->cmpl(phba, rdp_context, FAILURE); in lpfc_mbx_cmpl_rdp_page_a2()
2410 struct lpfc_dmabuf *mp = mbox->ctx_buf; in lpfc_mbx_cmpl_rdp_page_a0()
2411 struct lpfc_rdp_context *rdp_context = mbox->ctx_u.rdp; in lpfc_mbx_cmpl_rdp_page_a0()
2413 if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) in lpfc_mbx_cmpl_rdp_page_a0()
2416 lpfc_sli_bemem_bcopy(mp->virt, &rdp_context->page_a0, in lpfc_mbx_cmpl_rdp_page_a0()
2421 memset(mp->virt, 0, DMP_SFF_PAGE_A2_SIZE); in lpfc_mbx_cmpl_rdp_page_a0()
2422 INIT_LIST_HEAD(&mp->list); in lpfc_mbx_cmpl_rdp_page_a0()
2425 mbox->ctx_buf = mp; in lpfc_mbx_cmpl_rdp_page_a0()
2426 mbox->vport = rdp_context->ndlp->vport; in lpfc_mbx_cmpl_rdp_page_a0()
2428 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_DUMP_MEMORY); in lpfc_mbx_cmpl_rdp_page_a0()
2430 &mbox->u.mqe.un.mem_dump_type3, DMP_LMSD); in lpfc_mbx_cmpl_rdp_page_a0()
2432 &mbox->u.mqe.un.mem_dump_type3, phba->sli4_hba.physical_port); in lpfc_mbx_cmpl_rdp_page_a0()
2434 &mbox->u.mqe.un.mem_dump_type3, DMP_PAGE_A2); in lpfc_mbx_cmpl_rdp_page_a0()
2436 &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A2_SIZE); in lpfc_mbx_cmpl_rdp_page_a0()
2437 mbox->u.mqe.un.mem_dump_type3.addr_lo = putPaddrLow(mp->phys); in lpfc_mbx_cmpl_rdp_page_a0()
2438 mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); in lpfc_mbx_cmpl_rdp_page_a0()
2440 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a2; in lpfc_mbx_cmpl_rdp_page_a0()
2441 mbox->ctx_u.rdp = rdp_context; in lpfc_mbx_cmpl_rdp_page_a0()
2450 rdp_context->cmpl(phba, rdp_context, FAILURE); in lpfc_mbx_cmpl_rdp_page_a0()
2455 * lpfc_sli4_dump_page_a0 - Dump sli4 read SFP Diagnostic.
2477 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_DUMP_MEMORY); in lpfc_sli4_dump_page_a0()
2479 &mbox->u.mqe.un.mem_dump_type3, DMP_LMSD); in lpfc_sli4_dump_page_a0()
2481 &mbox->u.mqe.un.mem_dump_type3, phba->sli4_hba.physical_port); in lpfc_sli4_dump_page_a0()
2483 &mbox->u.mqe.un.mem_dump_type3, DMP_PAGE_A0); in lpfc_sli4_dump_page_a0()
2485 &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A0_SIZE); in lpfc_sli4_dump_page_a0()
2487 mp = mbox->ctx_buf; in lpfc_sli4_dump_page_a0()
2488 mbox->u.mqe.un.mem_dump_type3.addr_lo = putPaddrLow(mp->phys); in lpfc_sli4_dump_page_a0()
2489 mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); in lpfc_sli4_dump_page_a0()
2495 * lpfc_reg_fcfi - Initialize the REG_FCFI mailbox command
2513 reg_fcfi = &mbox->u.mqe.un.reg_fcfi; in lpfc_reg_fcfi()
2514 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_REG_FCFI); in lpfc_reg_fcfi()
2515 if (phba->nvmet_support == 0) { in lpfc_reg_fcfi()
2517 phba->sli4_hba.hdr_rq->queue_id); in lpfc_reg_fcfi()
2518 /* Match everything - rq_id0 */ in lpfc_reg_fcfi()
2528 (~phba->fcf.addr_mode) & 0x3); in lpfc_reg_fcfi()
2531 if (phba->cfg_nvmet_mrq != 1) in lpfc_reg_fcfi()
2535 phba->sli4_hba.nvmet_mrq_hdr[0]->queue_id); in lpfc_reg_fcfi()
2536 /* Match type FCP - rq_id0 */ in lpfc_reg_fcfi()
2543 phba->sli4_hba.hdr_rq->queue_id); in lpfc_reg_fcfi()
2544 /* Match everything else - rq_id1 */ in lpfc_reg_fcfi()
2553 phba->fcf.current_rec.fcf_indx); in lpfc_reg_fcfi()
2554 if (phba->fcf.current_rec.vlan_id != LPFC_FCOE_NULL_VID) { in lpfc_reg_fcfi()
2557 phba->fcf.current_rec.vlan_id); in lpfc_reg_fcfi()
2562 * lpfc_reg_fcfi_mrq - Initialize the REG_FCFI_MRQ mailbox command
2581 if (phba->cfg_nvmet_mrq <= 1) in lpfc_reg_fcfi_mrq()
2585 reg_fcfi = &mbox->u.mqe.un.reg_fcfi_mrq; in lpfc_reg_fcfi_mrq()
2586 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_REG_FCFI_MRQ); in lpfc_reg_fcfi_mrq()
2589 phba->fcf.current_rec.fcf_indx); in lpfc_reg_fcfi_mrq()
2590 if (phba->fcf.current_rec.vlan_id != LPFC_FCOE_NULL_VID) { in lpfc_reg_fcfi_mrq()
2593 phba->fcf.current_rec.vlan_id); in lpfc_reg_fcfi_mrq()
2599 phba->sli4_hba.nvmet_mrq_hdr[0]->queue_id); in lpfc_reg_fcfi_mrq()
2600 /* Match NVME frames of type FCP (protocol NVME) - rq_id0 */ in lpfc_reg_fcfi_mrq()
2611 bf_set(lpfc_reg_fcfi_mrq_npairs, reg_fcfi, phba->cfg_nvmet_mrq); in lpfc_reg_fcfi_mrq()
2614 phba->sli4_hba.hdr_rq->queue_id); in lpfc_reg_fcfi_mrq()
2615 /* Match everything - rq_id1 */ in lpfc_reg_fcfi_mrq()
2626 * lpfc_unreg_fcfi - Initialize the UNREG_FCFI mailbox command
2637 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_UNREG_FCFI); in lpfc_unreg_fcfi()
2638 bf_set(lpfc_unreg_fcfi, &mbox->u.mqe.un.unreg_fcfi, fcfi); in lpfc_unreg_fcfi()
2642 * lpfc_resume_rpi - Initialize the RESUME_RPI mailbox command
2652 struct lpfc_hba *phba = ndlp->phba; in lpfc_resume_rpi()
2656 resume_rpi = &mbox->u.mqe.un.resume_rpi; in lpfc_resume_rpi()
2657 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_RESUME_RPI); in lpfc_resume_rpi()
2659 phba->sli4_hba.rpi_ids[ndlp->nlp_rpi]); in lpfc_resume_rpi()
2661 resume_rpi->event_tag = ndlp->phba->fc_eventTag; in lpfc_resume_rpi()