Lines Matching +full:sub +full:- +full:mailboxes

4  * Copyright (C) 2017-2022 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.
95 * Callers should use this routine for cleanup for all mailboxes prepped with
105 mp = (struct lpfc_dmabuf *)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.
209 mb = &pmb->u.mb; in lpfc_dump_mem()
210 ctx = pmb->ctx_buf; in lpfc_dump_mem()
214 mb->mbxCommand = MBX_DUMP_MEMORY; in lpfc_dump_mem()
215 mb->un.varDmp.cv = 1; in lpfc_dump_mem()
216 mb->un.varDmp.type = DMP_NV_PARAMS; in lpfc_dump_mem()
217 mb->un.varDmp.entry_index = offset; in lpfc_dump_mem()
218 mb->un.varDmp.region_id = region_id; in lpfc_dump_mem()
219 mb->un.varDmp.word_cnt = (DMP_RSP_SIZE / sizeof (uint32_t)); in lpfc_dump_mem()
220 mb->un.varDmp.co = 0; in lpfc_dump_mem()
221 mb->un.varDmp.resp_offset = 0; in lpfc_dump_mem()
222 pmb->ctx_buf = ctx; in lpfc_dump_mem()
223 mb->mbxOwner = OWN_HOST; in lpfc_dump_mem()
228 * lpfc_dump_wakeup_param - Prepare mailbox command for retrieving wakeup params
241 mb = &pmb->u.mb; in lpfc_dump_wakeup_param()
243 ctx = pmb->ctx_buf; in lpfc_dump_wakeup_param()
247 mb->mbxCommand = MBX_DUMP_MEMORY; in lpfc_dump_wakeup_param()
248 mb->mbxOwner = OWN_HOST; in lpfc_dump_wakeup_param()
249 mb->un.varDmp.cv = 1; in lpfc_dump_wakeup_param()
250 mb->un.varDmp.type = DMP_NV_PARAMS; in lpfc_dump_wakeup_param()
251 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_dump_wakeup_param()
252 mb->un.varDmp.entry_index = 0; in lpfc_dump_wakeup_param()
253 mb->un.varDmp.region_id = WAKE_UP_PARMS_REGION_ID; in lpfc_dump_wakeup_param()
254 mb->un.varDmp.word_cnt = WAKE_UP_PARMS_WORD_SIZE; in lpfc_dump_wakeup_param()
255 mb->un.varDmp.co = 0; in lpfc_dump_wakeup_param()
256 mb->un.varDmp.resp_offset = 0; in lpfc_dump_wakeup_param()
257 pmb->ctx_buf = ctx; in lpfc_dump_wakeup_param()
262 * lpfc_read_nv - Prepare a mailbox command for reading HBA's NVRAM param
266 * The read NVRAM mailbox command returns the HBA's non-volatile parameters
267 * that are used as defaults when the Fibre Channel link is brought on-line.
277 mb = &pmb->u.mb; in lpfc_read_nv()
279 mb->mbxCommand = MBX_READ_NV; in lpfc_read_nv()
280 mb->mbxOwner = OWN_HOST; in lpfc_read_nv()
285 * lpfc_config_async - Prepare a mailbox command for enabling HBA async event
303 mb = &pmb->u.mb; in lpfc_config_async()
305 mb->mbxCommand = MBX_ASYNCEVT_ENABLE; in lpfc_config_async()
306 mb->un.varCfgAsyncEvent.ring = ring; in lpfc_config_async()
307 mb->mbxOwner = OWN_HOST; in lpfc_config_async()
312 * lpfc_heart_beat - Prepare a mailbox command for heart beat
329 mb = &pmb->u.mb; in lpfc_heart_beat()
331 mb->mbxCommand = MBX_HEARTBEAT; in lpfc_heart_beat()
332 mb->mbxOwner = OWN_HOST; in lpfc_heart_beat()
337 * lpfc_read_topology - Prepare a mailbox command for reading HBA topology
344 * Attention (HSTATT) register is set to 1 (For SLI-3) or when an FC Link
345 * Attention ACQE is received from the port (For SLI-4). A Link Event
355 * 0 - Success (currently always return 0)
363 mb = &pmb->u.mb; in lpfc_read_topology()
366 INIT_LIST_HEAD(&mp->list); in lpfc_read_topology()
367 mb->mbxCommand = MBX_READ_TOPOLOGY; in lpfc_read_topology()
368 mb->un.varReadTop.lilpBde64.tus.f.bdeSize = LPFC_ALPA_MAP_SIZE; in lpfc_read_topology()
369 mb->un.varReadTop.lilpBde64.addrHigh = putPaddrHigh(mp->phys); in lpfc_read_topology()
370 mb->un.varReadTop.lilpBde64.addrLow = putPaddrLow(mp->phys); in lpfc_read_topology()
375 pmb->ctx_buf = (uint8_t *)mp; in lpfc_read_topology()
376 mb->mbxOwner = OWN_HOST; in lpfc_read_topology()
381 * lpfc_clear_la - Prepare a mailbox command for clearing HBA link attention
400 mb = &pmb->u.mb; in lpfc_clear_la()
403 mb->un.varClearLA.eventTag = phba->fc_eventTag; in lpfc_clear_la()
404 mb->mbxCommand = MBX_CLEAR_LA; in lpfc_clear_la()
405 mb->mbxOwner = OWN_HOST; in lpfc_clear_la()
410 * lpfc_config_link - Prepare a mailbox command for configuring link on a HBA
415 * mailbox command to override default value and to configure link-oriented
426 struct lpfc_vport *vport = phba->pport; in lpfc_config_link()
427 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_link()
431 * SLI-2, Coalescing Response Feature. in lpfc_config_link()
433 if (phba->cfg_cr_delay && (phba->sli_rev < LPFC_SLI_REV4)) { in lpfc_config_link()
434 mb->un.varCfgLnk.cr = 1; in lpfc_config_link()
435 mb->un.varCfgLnk.ci = 1; in lpfc_config_link()
436 mb->un.varCfgLnk.cr_delay = phba->cfg_cr_delay; in lpfc_config_link()
437 mb->un.varCfgLnk.cr_count = phba->cfg_cr_count; in lpfc_config_link()
440 mb->un.varCfgLnk.myId = vport->fc_myDID; in lpfc_config_link()
441 mb->un.varCfgLnk.edtov = phba->fc_edtov; in lpfc_config_link()
442 mb->un.varCfgLnk.arbtov = phba->fc_arbtov; in lpfc_config_link()
443 mb->un.varCfgLnk.ratov = phba->fc_ratov; in lpfc_config_link()
444 mb->un.varCfgLnk.rttov = phba->fc_rttov; in lpfc_config_link()
445 mb->un.varCfgLnk.altov = phba->fc_altov; in lpfc_config_link()
446 mb->un.varCfgLnk.crtov = phba->fc_crtov; in lpfc_config_link()
447 mb->un.varCfgLnk.cscn = 0; in lpfc_config_link()
448 if (phba->bbcredit_support && phba->cfg_enable_bbcr) { in lpfc_config_link()
449 mb->un.varCfgLnk.cscn = 1; in lpfc_config_link()
450 mb->un.varCfgLnk.bbscn = bf_get(lpfc_bbscn_def, in lpfc_config_link()
451 &phba->sli4_hba.bbscn_params); in lpfc_config_link()
454 if (phba->cfg_ack0 && (phba->sli_rev < LPFC_SLI_REV4)) in lpfc_config_link()
455 mb->un.varCfgLnk.ack0_enable = 1; in lpfc_config_link()
457 mb->mbxCommand = MBX_CONFIG_LINK; in lpfc_config_link()
458 mb->mbxOwner = OWN_HOST; in lpfc_config_link()
463 * lpfc_config_msi - Prepare a mailbox command for configuring msi-x
467 * The configure MSI-X mailbox command is used to configure the HBA's SLI-3
468 * MSI-X multi-message interrupt vector association to interrupt attention
472 * 0 - Success
473 * -EINVAL - Failure
478 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_msi()
482 if (phba->cfg_use_msi != 2) { in lpfc_config_msi()
484 "0475 Not configured for supporting MSI-X " in lpfc_config_msi()
485 "cfg_use_msi: 0x%x\n", phba->cfg_use_msi); in lpfc_config_msi()
486 return -EINVAL; in lpfc_config_msi()
489 if (phba->sli_rev < 3) { in lpfc_config_msi()
491 "0476 HBA not supporting SLI-3 or later " in lpfc_config_msi()
492 "SLI Revision: 0x%x\n", phba->sli_rev); in lpfc_config_msi()
493 return -EINVAL; in lpfc_config_msi()
500 * SLI-3, Message Signaled Interrupt Feature. in lpfc_config_msi()
503 /* Multi-message attention configuration */ in lpfc_config_msi()
508 mb->un.varCfgMSI.attentionConditions[0] = attentionConditions[0]; in lpfc_config_msi()
509 mb->un.varCfgMSI.attentionConditions[1] = attentionConditions[1]; in lpfc_config_msi()
516 mb->un.varCfgMSI.messageNumberByHA[HA_R0_POS] = 1; in lpfc_config_msi()
518 mb->un.varCfgMSI.messageNumberByHA[HA_R1_POS] = 1; in lpfc_config_msi()
521 mb->un.varCfgMSI.messageNumberByHA[HA_R0_POS^3] = 1; in lpfc_config_msi()
523 mb->un.varCfgMSI.messageNumberByHA[HA_R1_POS^3] = 1; in lpfc_config_msi()
525 /* Multi-message interrupt autoclear configuration*/ in lpfc_config_msi()
526 mb->un.varCfgMSI.autoClearHA[0] = attentionConditions[0]; in lpfc_config_msi()
527 mb->un.varCfgMSI.autoClearHA[1] = attentionConditions[1]; in lpfc_config_msi()
530 mb->un.varCfgMSI.autoClearHA[0] = 0; in lpfc_config_msi()
531 mb->un.varCfgMSI.autoClearHA[1] = 0; in lpfc_config_msi()
534 mb->mbxCommand = MBX_CONFIG_MSI; in lpfc_config_msi()
535 mb->mbxOwner = OWN_HOST; in lpfc_config_msi()
541 * lpfc_init_link - Prepare a mailbox command for initialize link on a HBA
561 mb = &pmb->u.mb; in lpfc_init_link()
566 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_LOOP; in lpfc_init_link()
567 mb->un.varInitLnk.link_flags |= FLAGS_TOPOLOGY_FAILOVER; in lpfc_init_link()
570 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_PT_PT; in lpfc_init_link()
573 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_LOOP; in lpfc_init_link()
576 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_PT_PT; in lpfc_init_link()
577 mb->un.varInitLnk.link_flags |= FLAGS_TOPOLOGY_FAILOVER; in lpfc_init_link()
580 mb->un.varInitLnk.link_flags = FLAGS_LOCAL_LB; in lpfc_init_link()
585 if ((phba->sli4_hba.pc_sli4_params.sli_family == LPFC_SLI_INTF_FAMILY_G6 || in lpfc_init_link()
586 phba->sli4_hba.pc_sli4_params.if_type == LPFC_SLI_INTF_IF_TYPE_6) && in lpfc_init_link()
587 !(phba->sli4_hba.pc_sli4_params.pls) && in lpfc_init_link()
588 mb->un.varInitLnk.link_flags & FLAGS_TOPOLOGY_MODE_LOOP) { in lpfc_init_link()
589 mb->un.varInitLnk.link_flags = FLAGS_TOPOLOGY_MODE_PT_PT; in lpfc_init_link()
590 phba->cfg_topology = FLAGS_TOPOLOGY_MODE_PT_PT; in lpfc_init_link()
594 if (phba->sli_rev == LPFC_SLI_REV3 && !phba->cfg_fcp_wait_abts_rsp) in lpfc_init_link()
595 mb->un.varInitLnk.link_flags |= FLAGS_IMED_ABORT; in lpfc_init_link()
600 vpd = &phba->vpd; in lpfc_init_link()
601 if (vpd->rev.feaLevelHigh >= 0x02){ in lpfc_init_link()
604 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
605 mb->un.varInitLnk.link_speed = LINK_SPEED_1G; in lpfc_init_link()
608 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
609 mb->un.varInitLnk.link_speed = LINK_SPEED_2G; in lpfc_init_link()
612 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
613 mb->un.varInitLnk.link_speed = LINK_SPEED_4G; in lpfc_init_link()
616 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
617 mb->un.varInitLnk.link_speed = LINK_SPEED_8G; in lpfc_init_link()
620 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
621 mb->un.varInitLnk.link_speed = LINK_SPEED_10G; in lpfc_init_link()
624 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
625 mb->un.varInitLnk.link_speed = LINK_SPEED_16G; in lpfc_init_link()
628 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
629 mb->un.varInitLnk.link_speed = LINK_SPEED_32G; in lpfc_init_link()
632 mb->un.varInitLnk.link_flags |= FLAGS_LINK_SPEED; in lpfc_init_link()
633 mb->un.varInitLnk.link_speed = LINK_SPEED_64G; in lpfc_init_link()
637 mb->un.varInitLnk.link_speed = LINK_SPEED_AUTO; in lpfc_init_link()
643 mb->un.varInitLnk.link_speed = LINK_SPEED_AUTO; in lpfc_init_link()
645 mb->mbxCommand = (volatile uint8_t)MBX_INIT_LINK; in lpfc_init_link()
646 mb->mbxOwner = OWN_HOST; in lpfc_init_link()
647 mb->un.varInitLnk.fabric_AL_PA = phba->fc_pref_ALPA; in lpfc_init_link()
652 * lpfc_read_sparam - Prepare a mailbox command for reading HBA parameters
669 * 0 - Success
670 * 1 - DMA memory allocation failed
689 mp = pmb->ctx_buf; in lpfc_read_sparam()
690 mb = &pmb->u.mb; in lpfc_read_sparam()
691 mb->mbxOwner = OWN_HOST; in lpfc_read_sparam()
692 mb->mbxCommand = MBX_READ_SPARM64; in lpfc_read_sparam()
693 mb->un.varRdSparm.un.sp64.tus.f.bdeSize = sizeof (struct serv_parm); in lpfc_read_sparam()
694 mb->un.varRdSparm.un.sp64.addrHigh = putPaddrHigh(mp->phys); in lpfc_read_sparam()
695 mb->un.varRdSparm.un.sp64.addrLow = putPaddrLow(mp->phys); in lpfc_read_sparam()
696 if (phba->sli_rev >= LPFC_SLI_REV3) in lpfc_read_sparam()
697 mb->un.varRdSparm.vpi = phba->vpi_ids[vpi]; in lpfc_read_sparam()
703 * lpfc_unreg_did - Prepare a mailbox command for unregistering DID
723 mb = &pmb->u.mb; in lpfc_unreg_did()
726 mb->un.varUnregDID.did = did; in lpfc_unreg_did()
727 mb->un.varUnregDID.vpi = vpi; in lpfc_unreg_did()
729 (phba->sli_rev == LPFC_SLI_REV4)) in lpfc_unreg_did()
730 mb->un.varUnregDID.vpi = phba->vpi_ids[vpi]; in lpfc_unreg_did()
732 mb->mbxCommand = MBX_UNREG_D_ID; in lpfc_unreg_did()
733 mb->mbxOwner = OWN_HOST; in lpfc_unreg_did()
738 * lpfc_read_config - Prepare a mailbox command for reading HBA configuration
755 mb = &pmb->u.mb; in lpfc_read_config()
758 mb->mbxCommand = MBX_READ_CONFIG; in lpfc_read_config()
759 mb->mbxOwner = OWN_HOST; in lpfc_read_config()
764 * lpfc_read_lnk_stat - Prepare a mailbox command for reading HBA link stats
769 * the HBA. Link status includes all link-related error counters. These
780 mb = &pmb->u.mb; in lpfc_read_lnk_stat()
783 mb->mbxCommand = MBX_READ_LNK_STAT; in lpfc_read_lnk_stat()
784 mb->mbxOwner = OWN_HOST; in lpfc_read_lnk_stat()
789 * lpfc_reg_rpi - Prepare a mailbox command for registering remote login
799 * service parameters internally and thereby make the appropriate FC-2
809 * 0 - Success
810 * 1 - DMA memory allocation failed
816 MAILBOX_t *mb = &pmb->u.mb; in lpfc_reg_rpi()
823 mb->un.varRegLogin.rpi = 0; in lpfc_reg_rpi()
824 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_reg_rpi()
825 mb->un.varRegLogin.rpi = phba->sli4_hba.rpi_ids[rpi]; in lpfc_reg_rpi()
826 if (phba->sli_rev >= LPFC_SLI_REV3) in lpfc_reg_rpi()
827 mb->un.varRegLogin.vpi = phba->vpi_ids[vpi]; in lpfc_reg_rpi()
828 mb->un.varRegLogin.did = did; in lpfc_reg_rpi()
829 mb->mbxOwner = OWN_HOST; in lpfc_reg_rpi()
834 mb->mbxCommand = MBX_REG_LOGIN64; in lpfc_reg_rpi()
843 mp = pmb->ctx_buf; in lpfc_reg_rpi()
844 sparam = mp->virt; in lpfc_reg_rpi()
848 mb->mbxCommand = MBX_REG_LOGIN64; in lpfc_reg_rpi()
849 mb->un.varRegLogin.un.sp64.tus.f.bdeSize = sizeof (struct serv_parm); in lpfc_reg_rpi()
850 mb->un.varRegLogin.un.sp64.addrHigh = putPaddrHigh(mp->phys); in lpfc_reg_rpi()
851 mb->un.varRegLogin.un.sp64.addrLow = putPaddrLow(mp->phys); in lpfc_reg_rpi()
857 * lpfc_unreg_login - Prepare a mailbox command for unregistering remote login
879 mb = &pmb->u.mb; in lpfc_unreg_login()
882 mb->un.varUnregLogin.rpi = rpi; in lpfc_unreg_login()
883 mb->un.varUnregLogin.rsvd1 = 0; in lpfc_unreg_login()
884 if (phba->sli_rev >= LPFC_SLI_REV3) in lpfc_unreg_login()
885 mb->un.varUnregLogin.vpi = phba->vpi_ids[vpi]; in lpfc_unreg_login()
887 mb->mbxCommand = MBX_UNREG_LOGIN; in lpfc_unreg_login()
888 mb->mbxOwner = OWN_HOST; in lpfc_unreg_login()
894 * lpfc_sli4_unreg_all_rpis - unregister all RPIs for a vport on SLI4 HBA.
903 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_unreg_all_rpis()
907 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_sli4_unreg_all_rpis()
916 lpfc_unreg_login(phba, vport->vpi, phba->vpi_ids[vport->vpi], in lpfc_sli4_unreg_all_rpis()
918 mbox->u.mb.un.varUnregLogin.rsvd1 = 0x4000; in lpfc_sli4_unreg_all_rpis()
919 mbox->vport = vport; in lpfc_sli4_unreg_all_rpis()
920 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; in lpfc_sli4_unreg_all_rpis()
921 mbox->ctx_ndlp = NULL; in lpfc_sli4_unreg_all_rpis()
924 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_sli4_unreg_all_rpis()
929 * lpfc_reg_vpi - Prepare a mailbox command for registering vport identifier
944 MAILBOX_t *mb = &pmb->u.mb; in lpfc_reg_vpi()
945 struct lpfc_hba *phba = vport->phba; in lpfc_reg_vpi()
949 * Set the re-reg VPI bit for f/w to update the MAC address. in lpfc_reg_vpi()
951 if ((phba->sli_rev == LPFC_SLI_REV4) && in lpfc_reg_vpi()
952 !(vport->fc_flag & FC_VPORT_NEEDS_REG_VPI)) in lpfc_reg_vpi()
953 mb->un.varRegVpi.upd = 1; in lpfc_reg_vpi()
955 mb->un.varRegVpi.vpi = phba->vpi_ids[vport->vpi]; in lpfc_reg_vpi()
956 mb->un.varRegVpi.sid = vport->fc_myDID; in lpfc_reg_vpi()
957 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_reg_vpi()
958 mb->un.varRegVpi.vfi = phba->sli4_hba.vfi_ids[vport->vfi]; in lpfc_reg_vpi()
960 mb->un.varRegVpi.vfi = vport->vfi + vport->phba->vfi_base; in lpfc_reg_vpi()
961 memcpy(mb->un.varRegVpi.wwn, &vport->fc_portname, in lpfc_reg_vpi()
963 mb->un.varRegVpi.wwn[0] = cpu_to_le32(mb->un.varRegVpi.wwn[0]); in lpfc_reg_vpi()
964 mb->un.varRegVpi.wwn[1] = cpu_to_le32(mb->un.varRegVpi.wwn[1]); in lpfc_reg_vpi()
966 mb->mbxCommand = MBX_REG_VPI; in lpfc_reg_vpi()
967 mb->mbxOwner = OWN_HOST; in lpfc_reg_vpi()
973 * lpfc_unreg_vpi - Prepare a mailbox command for unregistering vport id
991 MAILBOX_t *mb = &pmb->u.mb; in lpfc_unreg_vpi()
994 if (phba->sli_rev == LPFC_SLI_REV3) in lpfc_unreg_vpi()
995 mb->un.varUnregVpi.vpi = phba->vpi_ids[vpi]; in lpfc_unreg_vpi()
996 else if (phba->sli_rev >= LPFC_SLI_REV4) in lpfc_unreg_vpi()
997 mb->un.varUnregVpi.sli4_vpi = phba->vpi_ids[vpi]; in lpfc_unreg_vpi()
999 mb->mbxCommand = MBX_UNREG_VPI; in lpfc_unreg_vpi()
1000 mb->mbxOwner = OWN_HOST; in lpfc_unreg_vpi()
1006 * lpfc_config_pcb_setup - Set up IOCB rings in the Port Control Block (PCB)
1015 struct lpfc_sli *psli = &phba->sli; in lpfc_config_pcb_setup()
1017 PCB_t *pcbp = phba->pcb; in lpfc_config_pcb_setup()
1023 pcbp->maxRing = (psli->num_rings - 1); in lpfc_config_pcb_setup()
1025 for (i = 0; i < psli->num_rings; i++) { in lpfc_config_pcb_setup()
1026 pring = &psli->sli3_ring[i]; in lpfc_config_pcb_setup()
1028 pring->sli.sli3.sizeCiocb = in lpfc_config_pcb_setup()
1029 phba->sli_rev == 3 ? SLI3_IOCB_CMD_SIZE : in lpfc_config_pcb_setup()
1031 pring->sli.sli3.sizeRiocb = in lpfc_config_pcb_setup()
1032 phba->sli_rev == 3 ? SLI3_IOCB_RSP_SIZE : in lpfc_config_pcb_setup()
1036 if ((pring->sli.sli3.numCiocb == 0) || in lpfc_config_pcb_setup()
1037 (pring->sli.sli3.numRiocb == 0)) { in lpfc_config_pcb_setup()
1038 pcbp->rdsc[i].cmdEntries = 0; in lpfc_config_pcb_setup()
1039 pcbp->rdsc[i].rspEntries = 0; in lpfc_config_pcb_setup()
1040 pcbp->rdsc[i].cmdAddrHigh = 0; in lpfc_config_pcb_setup()
1041 pcbp->rdsc[i].rspAddrHigh = 0; in lpfc_config_pcb_setup()
1042 pcbp->rdsc[i].cmdAddrLow = 0; in lpfc_config_pcb_setup()
1043 pcbp->rdsc[i].rspAddrLow = 0; in lpfc_config_pcb_setup()
1044 pring->sli.sli3.cmdringaddr = NULL; in lpfc_config_pcb_setup()
1045 pring->sli.sli3.rspringaddr = NULL; in lpfc_config_pcb_setup()
1049 pring->sli.sli3.cmdringaddr = (void *)&phba->IOCBs[iocbCnt]; in lpfc_config_pcb_setup()
1050 pcbp->rdsc[i].cmdEntries = pring->sli.sli3.numCiocb; in lpfc_config_pcb_setup()
1052 offset = (uint8_t *) &phba->IOCBs[iocbCnt] - in lpfc_config_pcb_setup()
1053 (uint8_t *) phba->slim2p.virt; in lpfc_config_pcb_setup()
1054 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_pcb_setup()
1055 pcbp->rdsc[i].cmdAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_pcb_setup()
1056 pcbp->rdsc[i].cmdAddrLow = putPaddrLow(pdma_addr); in lpfc_config_pcb_setup()
1057 iocbCnt += pring->sli.sli3.numCiocb; in lpfc_config_pcb_setup()
1060 pring->sli.sli3.rspringaddr = (void *) &phba->IOCBs[iocbCnt]; in lpfc_config_pcb_setup()
1062 pcbp->rdsc[i].rspEntries = pring->sli.sli3.numRiocb; in lpfc_config_pcb_setup()
1063 offset = (uint8_t *)&phba->IOCBs[iocbCnt] - in lpfc_config_pcb_setup()
1064 (uint8_t *)phba->slim2p.virt; in lpfc_config_pcb_setup()
1065 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_pcb_setup()
1066 pcbp->rdsc[i].rspAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_pcb_setup()
1067 pcbp->rdsc[i].rspAddrLow = putPaddrLow(pdma_addr); in lpfc_config_pcb_setup()
1068 iocbCnt += pring->sli.sli3.numRiocb; in lpfc_config_pcb_setup()
1073 * lpfc_read_rev - Prepare a mailbox command for reading HBA revision
1079 * firmware, and available firmware. HBAs that supports SLI-3 mode of
1089 MAILBOX_t *mb = &pmb->u.mb; in lpfc_read_rev()
1091 mb->un.varRdRev.cv = 1; in lpfc_read_rev()
1092 mb->un.varRdRev.v3req = 1; /* Request SLI3 info */ in lpfc_read_rev()
1093 mb->mbxCommand = MBX_READ_REV; in lpfc_read_rev()
1094 mb->mbxOwner = OWN_HOST; in lpfc_read_rev()
1101 MAILBOX_t *mb = &pmb->u.mb; in lpfc_sli4_swap_str()
1104 switch (mb->mbxCommand) { in lpfc_sli4_swap_str()
1106 mqe = &pmb->u.mqe; in lpfc_sli4_swap_str()
1107 lpfc_sli_pcimem_bcopy(mqe->un.read_rev.fw_name, in lpfc_sli4_swap_str()
1108 mqe->un.read_rev.fw_name, 16); in lpfc_sli4_swap_str()
1109 lpfc_sli_pcimem_bcopy(mqe->un.read_rev.ulp_fw_name, in lpfc_sli4_swap_str()
1110 mqe->un.read_rev.ulp_fw_name, 16); in lpfc_sli4_swap_str()
1119 * lpfc_build_hbq_profile2 - Set up the HBQ Selection Profile 2
1132 hbqmb->profiles.profile2.seqlenbcnt = hbq_desc->seqlenbcnt; in lpfc_build_hbq_profile2()
1133 hbqmb->profiles.profile2.maxlen = hbq_desc->maxlen; in lpfc_build_hbq_profile2()
1134 hbqmb->profiles.profile2.seqlenoff = hbq_desc->seqlenoff; in lpfc_build_hbq_profile2()
1138 * lpfc_build_hbq_profile3 - Set up the HBQ Selection Profile 3
1151 hbqmb->profiles.profile3.seqlenbcnt = hbq_desc->seqlenbcnt; in lpfc_build_hbq_profile3()
1152 hbqmb->profiles.profile3.maxlen = hbq_desc->maxlen; in lpfc_build_hbq_profile3()
1153 hbqmb->profiles.profile3.cmdcodeoff = hbq_desc->cmdcodeoff; in lpfc_build_hbq_profile3()
1154 hbqmb->profiles.profile3.seqlenoff = hbq_desc->seqlenoff; in lpfc_build_hbq_profile3()
1155 memcpy(&hbqmb->profiles.profile3.cmdmatch, hbq_desc->cmdmatch, in lpfc_build_hbq_profile3()
1156 sizeof(hbqmb->profiles.profile3.cmdmatch)); in lpfc_build_hbq_profile3()
1160 * lpfc_build_hbq_profile5 - Set up the HBQ Selection Profile 5
1174 hbqmb->profiles.profile5.seqlenbcnt = hbq_desc->seqlenbcnt; in lpfc_build_hbq_profile5()
1175 hbqmb->profiles.profile5.maxlen = hbq_desc->maxlen; in lpfc_build_hbq_profile5()
1176 hbqmb->profiles.profile5.cmdcodeoff = hbq_desc->cmdcodeoff; in lpfc_build_hbq_profile5()
1177 hbqmb->profiles.profile5.seqlenoff = hbq_desc->seqlenoff; in lpfc_build_hbq_profile5()
1178 memcpy(&hbqmb->profiles.profile5.cmdmatch, hbq_desc->cmdmatch, in lpfc_build_hbq_profile5()
1179 sizeof(hbqmb->profiles.profile5.cmdmatch)); in lpfc_build_hbq_profile5()
1183 * lpfc_config_hbq - Prepare a mailbox command for configuring an HBQ
1202 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_hbq()
1203 struct config_hbq_var *hbqmb = &mb->un.varCfgHbq; in lpfc_config_hbq()
1206 hbqmb->hbqId = id; in lpfc_config_hbq()
1207 hbqmb->entry_count = hbq_desc->entry_count; /* # entries in HBQ */ in lpfc_config_hbq()
1208 hbqmb->recvNotify = hbq_desc->rn; /* Receive in lpfc_config_hbq()
1210 hbqmb->numMask = hbq_desc->mask_count; /* # R_CTL/TYPE masks in lpfc_config_hbq()
1211 * # in words 0-19 */ in lpfc_config_hbq()
1212 hbqmb->profile = hbq_desc->profile; /* Selection profile: in lpfc_config_hbq()
1215 hbqmb->ringMask = hbq_desc->ring_mask; /* Binds HBQ to a ring in lpfc_config_hbq()
1218 hbqmb->headerLen = hbq_desc->headerLen; /* 0 if not profile 4 in lpfc_config_hbq()
1220 hbqmb->logEntry = hbq_desc->logEntry; /* Set to 1 if this in lpfc_config_hbq()
1224 hbqmb->hbqaddrLow = putPaddrLow(phba->hbqslimp.phys) + in lpfc_config_hbq()
1226 hbqmb->hbqaddrHigh = putPaddrHigh(phba->hbqslimp.phys); in lpfc_config_hbq()
1228 mb->mbxCommand = MBX_CONFIG_HBQ; in lpfc_config_hbq()
1229 mb->mbxOwner = OWN_HOST; in lpfc_config_hbq()
1234 if (hbq_desc->profile == 2) in lpfc_config_hbq()
1236 else if (hbq_desc->profile == 3) in lpfc_config_hbq()
1238 else if (hbq_desc->profile == 5) in lpfc_config_hbq()
1242 if (!hbq_desc->mask_count) in lpfc_config_hbq()
1246 for (i = 0; i < hbq_desc->mask_count; i++) { in lpfc_config_hbq()
1247 hbqmb->hbqMasks[i].tmatch = hbq_desc->hbqMasks[i].tmatch; in lpfc_config_hbq()
1248 hbqmb->hbqMasks[i].tmask = hbq_desc->hbqMasks[i].tmask; in lpfc_config_hbq()
1249 hbqmb->hbqMasks[i].rctlmatch = hbq_desc->hbqMasks[i].rctlmatch; in lpfc_config_hbq()
1250 hbqmb->hbqMasks[i].rctlmask = hbq_desc->hbqMasks[i].rctlmask; in lpfc_config_hbq()
1257 * lpfc_config_ring - Prepare a mailbox command for configuring an IOCB ring
1277 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_ring()
1283 mb->un.varCfgRing.ring = ring; in lpfc_config_ring()
1284 mb->un.varCfgRing.maxOrigXchg = 0; in lpfc_config_ring()
1285 mb->un.varCfgRing.maxRespXchg = 0; in lpfc_config_ring()
1286 mb->un.varCfgRing.recvNotify = 1; in lpfc_config_ring()
1288 psli = &phba->sli; in lpfc_config_ring()
1289 pring = &psli->sli3_ring[ring]; in lpfc_config_ring()
1290 mb->un.varCfgRing.numMask = pring->num_mask; in lpfc_config_ring()
1291 mb->mbxCommand = MBX_CONFIG_RING; in lpfc_config_ring()
1292 mb->mbxOwner = OWN_HOST; in lpfc_config_ring()
1295 if (pring->prt[0].profile) { in lpfc_config_ring()
1296 mb->un.varCfgRing.profile = pring->prt[0].profile; in lpfc_config_ring()
1301 for (i = 0; i < pring->num_mask; i++) { in lpfc_config_ring()
1302 mb->un.varCfgRing.rrRegs[i].rval = pring->prt[i].rctl; in lpfc_config_ring()
1303 if (mb->un.varCfgRing.rrRegs[i].rval != FC_RCTL_ELS_REQ) in lpfc_config_ring()
1304 mb->un.varCfgRing.rrRegs[i].rmask = 0xff; in lpfc_config_ring()
1306 mb->un.varCfgRing.rrRegs[i].rmask = 0xfe; in lpfc_config_ring()
1307 mb->un.varCfgRing.rrRegs[i].tval = pring->prt[i].type; in lpfc_config_ring()
1308 mb->un.varCfgRing.rrRegs[i].tmask = 0xff; in lpfc_config_ring()
1315 * lpfc_config_port - Prepare a mailbox command for configuring port
1331 MAILBOX_t __iomem *mb_slim = (MAILBOX_t __iomem *) phba->MBslimaddr; in lpfc_config_port()
1332 MAILBOX_t *mb = &pmb->u.mb; in lpfc_config_port()
1341 mb->mbxCommand = MBX_CONFIG_PORT; in lpfc_config_port()
1342 mb->mbxOwner = OWN_HOST; in lpfc_config_port()
1344 mb->un.varCfgPort.pcbLen = sizeof(PCB_t); in lpfc_config_port()
1346 offset = (uint8_t *)phba->pcb - (uint8_t *)phba->slim2p.virt; in lpfc_config_port()
1347 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_port()
1348 mb->un.varCfgPort.pcbLow = putPaddrLow(pdma_addr); in lpfc_config_port()
1349 mb->un.varCfgPort.pcbHigh = putPaddrHigh(pdma_addr); in lpfc_config_port()
1352 mb->un.varCfgPort.hps = 1; in lpfc_config_port()
1356 if (phba->sli_rev == LPFC_SLI_REV3 && phba->vpd.sli3Feat.cerbm) { in lpfc_config_port()
1357 if (phba->cfg_enable_bg) in lpfc_config_port()
1358 mb->un.varCfgPort.cbg = 1; /* configure BlockGuard */ in lpfc_config_port()
1359 mb->un.varCfgPort.cerbm = 1; /* Request HBQs */ in lpfc_config_port()
1360 mb->un.varCfgPort.ccrp = 1; /* Command Ring Polling */ in lpfc_config_port()
1361 mb->un.varCfgPort.max_hbq = lpfc_sli_hbq_count(); in lpfc_config_port()
1362 if (phba->max_vpi && phba->cfg_enable_npiv && in lpfc_config_port()
1363 phba->vpd.sli3Feat.cmv) { in lpfc_config_port()
1364 mb->un.varCfgPort.max_vpi = LPFC_MAX_VPI; in lpfc_config_port()
1365 mb->un.varCfgPort.cmv = 1; in lpfc_config_port()
1367 mb->un.varCfgPort.max_vpi = phba->max_vpi = 0; in lpfc_config_port()
1369 phba->sli_rev = LPFC_SLI_REV2; in lpfc_config_port()
1370 mb->un.varCfgPort.sli_mode = phba->sli_rev; in lpfc_config_port()
1373 if (phba->sli_rev == LPFC_SLI_REV3) in lpfc_config_port()
1374 mb->un.varCfgPort.casabt = 1; in lpfc_config_port()
1377 phba->pcb->type = TYPE_NATIVE_SLI2; in lpfc_config_port()
1378 phba->pcb->feature = FEATURE_INITIAL_SLI2; in lpfc_config_port()
1381 phba->pcb->mailBoxSize = sizeof(MAILBOX_t) + MAILBOX_EXT_SIZE; in lpfc_config_port()
1382 offset = (uint8_t *)phba->mbox - (uint8_t *)phba->slim2p.virt; in lpfc_config_port()
1383 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_port()
1384 phba->pcb->mbAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_port()
1385 phba->pcb->mbAddrLow = putPaddrLow(pdma_addr); in lpfc_config_port()
1406 pci_read_config_dword(phba->pcidev, PCI_BASE_ADDRESS_0, &bar_low); in lpfc_config_port()
1407 pci_read_config_dword(phba->pcidev, PCI_BASE_ADDRESS_1, &bar_high); in lpfc_config_port()
1410 * Set up HGP - Port Memory in lpfc_config_port()
1413 * following the "non-diagnostic" mode mailbox (32 words, 0x80 bytes) in lpfc_config_port()
1414 * area of SLIM. In SLI-2 mode, there's an additional 16 reserved in lpfc_config_port()
1416 * configured in SLI-3. in lpfc_config_port()
1418 * CR0Put - SLI2(no HBQs) = 0xc0, With HBQs = 0x80 in lpfc_config_port()
1427 * Reserved 0xa0-0xbf in lpfc_config_port()
1433 * HBQ(M-1)Put Pointer 0xc0+(M-1)*4 in lpfc_config_port()
1437 if (phba->cfg_hostmem_hgp && phba->sli_rev != 3) { in lpfc_config_port()
1438 phba->host_gp = (struct lpfc_hgp __iomem *) in lpfc_config_port()
1439 &phba->mbox->us.s2.host[0]; in lpfc_config_port()
1440 phba->hbq_put = NULL; in lpfc_config_port()
1441 offset = (uint8_t *)&phba->mbox->us.s2.host - in lpfc_config_port()
1442 (uint8_t *)phba->slim2p.virt; in lpfc_config_port()
1443 pdma_addr = phba->slim2p.phys + offset; in lpfc_config_port()
1444 phba->pcb->hgpAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_port()
1445 phba->pcb->hgpAddrLow = putPaddrLow(pdma_addr); in lpfc_config_port()
1448 mb->un.varCfgPort.hps = 1; in lpfc_config_port()
1450 if (phba->sli_rev == 3) { in lpfc_config_port()
1451 phba->host_gp = &mb_slim->us.s3.host[0]; in lpfc_config_port()
1452 phba->hbq_put = &mb_slim->us.s3.hbq_put[0]; in lpfc_config_port()
1454 phba->host_gp = &mb_slim->us.s2.host[0]; in lpfc_config_port()
1455 phba->hbq_put = NULL; in lpfc_config_port()
1458 /* mask off BAR0's flag bits 0 - 3 */ in lpfc_config_port()
1459 phba->pcb->hgpAddrLow = (bar_low & PCI_BASE_ADDRESS_MEM_MASK) + in lpfc_config_port()
1460 (void __iomem *)phba->host_gp - in lpfc_config_port()
1461 (void __iomem *)phba->MBslimaddr; in lpfc_config_port()
1463 phba->pcb->hgpAddrHigh = bar_high; in lpfc_config_port()
1465 phba->pcb->hgpAddrHigh = 0; in lpfc_config_port()
1469 for (i = 0; i < phba->sli.num_rings; i++) { in lpfc_config_port()
1470 lpfc_memcpy_to_slim(phba->host_gp + i, &hgp, in lpfc_config_port()
1471 sizeof(*phba->host_gp)); in lpfc_config_port()
1476 if (phba->sli_rev == 3) in lpfc_config_port()
1481 pdma_addr = phba->slim2p.phys + pgp_offset; in lpfc_config_port()
1482 phba->pcb->pgpAddrHigh = putPaddrHigh(pdma_addr); in lpfc_config_port()
1483 phba->pcb->pgpAddrLow = putPaddrLow(pdma_addr); in lpfc_config_port()
1489 if (lpfc_is_LC_HBA(phba->pcidev->device)) { in lpfc_config_port()
1494 memcpy(&mb->un.varCfgPort.hbainit, hbainit, 20); in lpfc_config_port()
1498 lpfc_sli_pcimem_bcopy(phba->pcb, phba->pcb, sizeof(PCB_t)); in lpfc_config_port()
1502 * lpfc_kill_board - Prepare a mailbox command for killing board
1519 MAILBOX_t *mb = &pmb->u.mb; in lpfc_kill_board()
1522 mb->mbxCommand = MBX_KILL_BOARD; in lpfc_kill_board()
1523 mb->mbxOwner = OWN_HOST; in lpfc_kill_board()
1528 * lpfc_mbox_put - Put a mailbox cmd into the tail of driver's mailbox queue
1542 psli = &phba->sli; in lpfc_mbox_put()
1544 list_add_tail(&mbq->list, &psli->mboxq); in lpfc_mbox_put()
1546 psli->mboxq_cnt++; in lpfc_mbox_put()
1552 * lpfc_mbox_get - Remove a mailbox cmd from the head of driver's mailbox queue
1569 struct lpfc_sli *psli = &phba->sli; in lpfc_mbox_get()
1571 list_remove_head((&psli->mboxq), mbq, LPFC_MBOXQ_t, list); in lpfc_mbox_get()
1573 psli->mboxq_cnt--; in lpfc_mbox_get()
1579 * __lpfc_mbox_cmpl_put - Put mailbox cmd into mailbox cmd complete list
1591 list_add_tail(&mbq->list, &phba->sli.mboxq_cmpl); in __lpfc_mbox_cmpl_put()
1595 * lpfc_mbox_cmpl_put - Put mailbox command into mailbox command complete list
1610 spin_lock_irqsave(&phba->hbalock, iflag); in lpfc_mbox_cmpl_put()
1612 spin_unlock_irqrestore(&phba->hbalock, iflag); in lpfc_mbox_cmpl_put()
1617 * lpfc_mbox_cmd_check - Check the validality of a mailbox command
1625 * Return 0 - pass the check, -ENODEV - fail the check
1633 if (mboxq->mbox_cmpl && mboxq->mbox_cmpl != lpfc_sli_def_mbox_cmpl && in lpfc_mbox_cmd_check()
1634 mboxq->mbox_cmpl != lpfc_sli_wake_mbox_wait) { in lpfc_mbox_cmd_check()
1635 if (!mboxq->vport) { in lpfc_mbox_cmd_check()
1638 mboxq->u.mb.mbxCommand); in lpfc_mbox_cmd_check()
1640 return -ENODEV; in lpfc_mbox_cmd_check()
1647 * lpfc_mbox_dev_check - Check the device state for issuing a mailbox command
1654 * Return 0 - pass the check, -ENODEV - fail the check
1660 if (unlikely(pci_channel_offline(phba->pcidev))) in lpfc_mbox_dev_check()
1661 return -ENODEV; in lpfc_mbox_dev_check()
1664 if (phba->link_state == LPFC_HBA_ERROR) in lpfc_mbox_dev_check()
1665 return -ENODEV; in lpfc_mbox_dev_check()
1671 * lpfc_mbox_tmo_val - Retrieve mailbox command timeout value
1684 MAILBOX_t *mbox = &mboxq->u.mb; in lpfc_mbox_tmo_val()
1687 switch (mbox->mbxCommand) { in lpfc_mbox_tmo_val()
1734 * lpfc_sli4_mbx_sge_set - Set a sge entry in non-embedded mailbox command
1740 * This routine sets up an entry in the non-embedded mailbox command at the sge
1750 &mbox->u.mqe.un.nembed_cmd; in lpfc_sli4_mbx_sge_set()
1751 nembed_sge->sge[sgentry].pa_lo = putPaddrLow(phyaddr); in lpfc_sli4_mbx_sge_set()
1752 nembed_sge->sge[sgentry].pa_hi = putPaddrHigh(phyaddr); in lpfc_sli4_mbx_sge_set()
1753 nembed_sge->sge[sgentry].length = length; in lpfc_sli4_mbx_sge_set()
1757 * lpfc_sli4_mbx_sge_get - Get a sge entry from non-embedded mailbox command
1762 * This routine gets an entry from the non-embedded mailbox command at the sge
1772 &mbox->u.mqe.un.nembed_cmd; in lpfc_sli4_mbx_sge_get()
1773 sge->pa_lo = nembed_sge->sge[sgentry].pa_lo; in lpfc_sli4_mbx_sge_get()
1774 sge->pa_hi = nembed_sge->sge[sgentry].pa_hi; in lpfc_sli4_mbx_sge_get()
1775 sge->length = nembed_sge->sge[sgentry].length; in lpfc_sli4_mbx_sge_get()
1779 * lpfc_sli4_mbox_cmd_free - Free a sli4 mailbox command
1785 * non-embedded config types.
1795 sli4_cfg = &mbox->u.mqe.un.sli4_config; in lpfc_sli4_mbox_cmd_free()
1798 if (bf_get(lpfc_mbox_hdr_emb, &sli4_cfg->header.cfg_mhdr)) { in lpfc_sli4_mbox_cmd_free()
1799 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_sli4_mbox_cmd_free()
1803 /* For non-embedded mbox command, we need to free the pages first */ in lpfc_sli4_mbox_cmd_free()
1804 sgecount = bf_get(lpfc_mbox_hdr_sge_cnt, &sli4_cfg->header.cfg_mhdr); in lpfc_sli4_mbox_cmd_free()
1806 if (unlikely(!mbox->sge_array)) { in lpfc_sli4_mbox_cmd_free()
1807 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_sli4_mbox_cmd_free()
1810 /* Each non-embedded DMA memory was allocated in the length of a page */ in lpfc_sli4_mbox_cmd_free()
1814 dma_free_coherent(&phba->pcidev->dev, SLI4_PAGE_SIZE, in lpfc_sli4_mbox_cmd_free()
1815 mbox->sge_array->addr[sgentry], phyaddr); in lpfc_sli4_mbox_cmd_free()
1818 kfree(mbox->sge_array); in lpfc_sli4_mbox_cmd_free()
1820 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_sli4_mbox_cmd_free()
1824 * lpfc_sli4_config - Initialize the SLI4 Config Mailbox command
1827 * @subsystem: The sli4 config sub mailbox subsystem.
1828 * @opcode: The sli4 config sub mailbox command opcode.
1829 * @length: Length of the sli4 config mailbox command (including sub-header).
1852 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_SLI4_CONFIG); in lpfc_sli4_config()
1855 sli4_config = &mbox->u.mqe.un.sli4_config; in lpfc_sli4_config()
1860 bf_set(lpfc_mbox_hdr_emb, &sli4_config->header.cfg_mhdr, 1); in lpfc_sli4_config()
1861 sli4_config->header.cfg_mhdr.payload_length = length; in lpfc_sli4_config()
1862 /* Set up sub-header fields following main header */ in lpfc_sli4_config()
1864 &sli4_config->header.cfg_shdr.request, opcode); in lpfc_sli4_config()
1866 &sli4_config->header.cfg_shdr.request, subsystem); in lpfc_sli4_config()
1867 sli4_config->header.cfg_shdr.request.request_length = in lpfc_sli4_config()
1868 length - LPFC_MBX_CMD_HDR_LENGTH; in lpfc_sli4_config()
1872 /* Setup for the non-embedded mbox command */ in lpfc_sli4_config()
1877 mbox->sge_array = kzalloc(sizeof(struct lpfc_mbx_nembed_sge_virt), in lpfc_sli4_config()
1879 if (!mbox->sge_array) { in lpfc_sli4_config()
1881 "2527 Failed to allocate non-embedded SGE " in lpfc_sli4_config()
1891 viraddr = dma_alloc_coherent(&phba->pcidev->dev, in lpfc_sli4_config()
1897 mbox->sge_array->addr[pagen] = viraddr; in lpfc_sli4_config()
1898 /* Keep the first page for later sub-header construction */ in lpfc_sli4_config()
1901 resid_len = length - alloc_len; in lpfc_sli4_config()
1914 sli4_config->header.cfg_mhdr.payload_length = alloc_len; in lpfc_sli4_config()
1915 bf_set(lpfc_mbox_hdr_sge_cnt, &sli4_config->header.cfg_mhdr, pagen); in lpfc_sli4_config()
1917 /* Set up sub-header fields into the first page */ in lpfc_sli4_config()
1919 bf_set(lpfc_mbox_hdr_opcode, &cfg_shdr->request, opcode); in lpfc_sli4_config()
1920 bf_set(lpfc_mbox_hdr_subsystem, &cfg_shdr->request, subsystem); in lpfc_sli4_config()
1921 cfg_shdr->request.request_length = in lpfc_sli4_config()
1922 alloc_len - sizeof(union lpfc_sli4_cfg_shdr); in lpfc_sli4_config()
1924 /* The sub-header is in DMA memory, which needs endian converstion */ in lpfc_sli4_config()
1932 * lpfc_sli4_mbox_rsrc_extent - Initialize the opcode resource extent.
1956 /* Get the first SGE entry from the non-embedded DMA memory */ in lpfc_sli4_mbox_rsrc_extent()
1957 virtaddr = mbox->sge_array->addr[0]; in lpfc_sli4_mbox_rsrc_extent()
1969 &mbox->u.mqe.un.alloc_rsrc_extents.u.req, in lpfc_sli4_mbox_rsrc_extent()
1975 lpfc_sli_pcimem_bcopy(&n_rsrc_extnt->word4, in lpfc_sli4_mbox_rsrc_extent()
1976 &n_rsrc_extnt->word4, in lpfc_sli4_mbox_rsrc_extent()
1986 &mbox->u.mqe.un.alloc_rsrc_extents.u.req, in lpfc_sli4_mbox_rsrc_extent()
2008 * lpfc_sli_config_mbox_subsys_get - Get subsystem from a sli_config mbox cmd
2014 * sub-header is not present, subsystem LPFC_MBOX_SUBSYSTEM_NA (0x0) shall
2023 if (mbox->u.mb.mbxCommand != MBX_SLI4_CONFIG) in lpfc_sli_config_mbox_subsys_get()
2025 sli4_cfg = &mbox->u.mqe.un.sli4_config; in lpfc_sli_config_mbox_subsys_get()
2027 /* For embedded mbox command, get opcode from embedded sub-header*/ in lpfc_sli_config_mbox_subsys_get()
2028 if (bf_get(lpfc_mbox_hdr_emb, &sli4_cfg->header.cfg_mhdr)) { in lpfc_sli_config_mbox_subsys_get()
2029 cfg_shdr = &mbox->u.mqe.un.sli4_config.header.cfg_shdr; in lpfc_sli_config_mbox_subsys_get()
2030 return bf_get(lpfc_mbox_hdr_subsystem, &cfg_shdr->request); in lpfc_sli_config_mbox_subsys_get()
2033 /* For non-embedded mbox command, get opcode from first dma page */ in lpfc_sli_config_mbox_subsys_get()
2034 if (unlikely(!mbox->sge_array)) in lpfc_sli_config_mbox_subsys_get()
2036 cfg_shdr = (union lpfc_sli4_cfg_shdr *)mbox->sge_array->addr[0]; in lpfc_sli_config_mbox_subsys_get()
2037 return bf_get(lpfc_mbox_hdr_subsystem, &cfg_shdr->request); in lpfc_sli_config_mbox_subsys_get()
2041 * lpfc_sli_config_mbox_opcode_get - Get opcode from a sli_config mbox cmd
2047 * the sub-header is not present, opcode LPFC_MBOX_OPCODE_NA (0x0) be
2056 if (mbox->u.mb.mbxCommand != MBX_SLI4_CONFIG) in lpfc_sli_config_mbox_opcode_get()
2058 sli4_cfg = &mbox->u.mqe.un.sli4_config; in lpfc_sli_config_mbox_opcode_get()
2060 /* For embedded mbox command, get opcode from embedded sub-header*/ in lpfc_sli_config_mbox_opcode_get()
2061 if (bf_get(lpfc_mbox_hdr_emb, &sli4_cfg->header.cfg_mhdr)) { in lpfc_sli_config_mbox_opcode_get()
2062 cfg_shdr = &mbox->u.mqe.un.sli4_config.header.cfg_shdr; in lpfc_sli_config_mbox_opcode_get()
2063 return bf_get(lpfc_mbox_hdr_opcode, &cfg_shdr->request); in lpfc_sli_config_mbox_opcode_get()
2066 /* For non-embedded mbox command, get opcode from first dma page */ in lpfc_sli_config_mbox_opcode_get()
2067 if (unlikely(!mbox->sge_array)) in lpfc_sli_config_mbox_opcode_get()
2069 cfg_shdr = (union lpfc_sli4_cfg_shdr *)mbox->sge_array->addr[0]; in lpfc_sli_config_mbox_opcode_get()
2070 return bf_get(lpfc_mbox_hdr_opcode, &cfg_shdr->request); in lpfc_sli_config_mbox_opcode_get()
2074 * lpfc_sli4_mbx_read_fcf_rec - Allocate and construct read fcf mbox cmd
2079 * This routine routine allocates and constructs non-embedded mailbox command
2097 return -ENOMEM; in lpfc_sli4_mbx_read_fcf_rec()
2102 /* Set up READ_FCF SLI4_CONFIG mailbox-ioctl command */ in lpfc_sli4_mbx_read_fcf_rec()
2112 return -ENOMEM; in lpfc_sli4_mbx_read_fcf_rec()
2115 /* Get the first SGE entry from the non-embedded DMA memory. This in lpfc_sli4_mbx_read_fcf_rec()
2119 virt_addr = mboxq->sge_array->addr[0]; in lpfc_sli4_mbx_read_fcf_rec()
2123 bf_set(lpfc_mbx_read_fcf_tbl_indx, &read_fcf->u.request, fcf_index); in lpfc_sli4_mbx_read_fcf_rec()
2144 bf_set(lpfc_mqe_command, &mboxq->u.mqe, MBX_SLI4_REQ_FTRS); in lpfc_request_features()
2147 bf_set(lpfc_mbx_rq_ftr_rq_fcpi, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2148 bf_set(lpfc_mbx_rq_ftr_rq_perfh, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2151 if (phba->cfg_enable_bg) in lpfc_request_features()
2152 bf_set(lpfc_mbx_rq_ftr_rq_dif, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2155 if (phba->max_vpi && phba->cfg_enable_npiv) in lpfc_request_features()
2156 bf_set(lpfc_mbx_rq_ftr_rq_npiv, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2158 if (phba->nvmet_support) { in lpfc_request_features()
2159 bf_set(lpfc_mbx_rq_ftr_rq_mrqp, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2161 bf_set(lpfc_mbx_rq_ftr_rq_iaab, &mboxq->u.mqe.un.req_ftrs, 0); in lpfc_request_features()
2162 bf_set(lpfc_mbx_rq_ftr_rq_iaar, &mboxq->u.mqe.un.req_ftrs, 0); in lpfc_request_features()
2166 if (phba->cfg_vmid_app_header) { in lpfc_request_features()
2167 bf_set(lpfc_mbx_rq_ftr_rq_ashdr, &mboxq->u.mqe.un.req_ftrs, 1); in lpfc_request_features()
2168 bf_set(lpfc_ftr_ashdr, &phba->sli4_hba.sli4_flags, 1); in lpfc_request_features()
2174 * lpfc_init_vfi - Initialize the INIT_VFI mailbox command
2190 mbox->vport = vport; in lpfc_init_vfi()
2191 init_vfi = &mbox->u.mqe.un.init_vfi; in lpfc_init_vfi()
2192 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_INIT_VFI); in lpfc_init_vfi()
2197 vport->phba->sli4_hba.vfi_ids[vport->vfi]); in lpfc_init_vfi()
2199 vport->phba->vpi_ids[vport->vpi]); in lpfc_init_vfi()
2201 vport->phba->fcf.fcfi); in lpfc_init_vfi()
2205 * lpfc_reg_vfi - Initialize the REG_VFI mailbox command
2219 struct lpfc_hba *phba = vport->phba; in lpfc_reg_vfi()
2223 reg_vfi = &mbox->u.mqe.un.reg_vfi; in lpfc_reg_vfi()
2224 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_REG_VFI); in lpfc_reg_vfi()
2227 phba->sli4_hba.vfi_ids[vport->vfi]); in lpfc_reg_vfi()
2228 bf_set(lpfc_reg_vfi_fcfi, reg_vfi, phba->fcf.fcfi); in lpfc_reg_vfi()
2229 bf_set(lpfc_reg_vfi_vpi, reg_vfi, phba->vpi_ids[vport->vpi]); in lpfc_reg_vfi()
2230 memcpy(reg_vfi->wwn, &vport->fc_portname, sizeof(struct lpfc_name)); in lpfc_reg_vfi()
2231 reg_vfi->wwn[0] = cpu_to_le32(reg_vfi->wwn[0]); in lpfc_reg_vfi()
2232 reg_vfi->wwn[1] = cpu_to_le32(reg_vfi->wwn[1]); in lpfc_reg_vfi()
2233 reg_vfi->e_d_tov = phba->fc_edtov; in lpfc_reg_vfi()
2234 reg_vfi->r_a_tov = phba->fc_ratov; in lpfc_reg_vfi()
2236 reg_vfi->bde.addrHigh = putPaddrHigh(phys); in lpfc_reg_vfi()
2237 reg_vfi->bde.addrLow = putPaddrLow(phys); in lpfc_reg_vfi()
2238 reg_vfi->bde.tus.f.bdeSize = sizeof(vport->fc_sparam); in lpfc_reg_vfi()
2239 reg_vfi->bde.tus.f.bdeFlags = BUFF_TYPE_BDE_64; in lpfc_reg_vfi()
2241 bf_set(lpfc_reg_vfi_nport_id, reg_vfi, vport->fc_myDID); in lpfc_reg_vfi()
2244 if ((phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_FC) && in lpfc_reg_vfi()
2245 (vport->fc_flag & FC_VFI_REGISTERED) && in lpfc_reg_vfi()
2246 (!phba->fc_topology_changed)) in lpfc_reg_vfi()
2251 bbscn_fabric = (phba->fc_fabparam.cmn.bbRcvSizeMsb >> 4) & 0xF; in lpfc_reg_vfi()
2253 if (phba->bbcredit_support && phba->cfg_enable_bbcr && in lpfc_reg_vfi()
2256 &phba->sli4_hba.bbscn_params); in lpfc_reg_vfi()
2259 &phba->sli4_hba.bbscn_params); in lpfc_reg_vfi()
2274 vport->fc_myDID, in lpfc_reg_vfi()
2275 phba->fcf.fcfi, in lpfc_reg_vfi()
2276 phba->sli4_hba.vfi_ids[vport->vfi], in lpfc_reg_vfi()
2277 phba->vpi_ids[vport->vpi], in lpfc_reg_vfi()
2278 reg_vfi->wwn[0], reg_vfi->wwn[1], vport->fc_flag, in lpfc_reg_vfi()
2279 vport->port_state, phba->fc_topology_changed, in lpfc_reg_vfi()
2284 * lpfc_init_vpi - Initialize the INIT_VPI mailbox command
2299 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_INIT_VPI); in lpfc_init_vpi()
2300 bf_set(lpfc_init_vpi_vpi, &mbox->u.mqe.un.init_vpi, in lpfc_init_vpi()
2301 phba->vpi_ids[vpi]); in lpfc_init_vpi()
2302 bf_set(lpfc_init_vpi_vfi, &mbox->u.mqe.un.init_vpi, in lpfc_init_vpi()
2303 phba->sli4_hba.vfi_ids[phba->pport->vfi]); in lpfc_init_vpi()
2307 * lpfc_unreg_vfi - Initialize the UNREG_VFI mailbox command
2321 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_UNREG_VFI); in lpfc_unreg_vfi()
2322 bf_set(lpfc_unreg_vfi_vfi, &mbox->u.mqe.un.unreg_vfi, in lpfc_unreg_vfi()
2323 vport->phba->sli4_hba.vfi_ids[vport->vfi]); in lpfc_unreg_vfi()
2327 * lpfc_sli4_dump_cfg_rg23 - Dump sli4 port config region 23
2342 mb = &mbox->u.mb; in lpfc_sli4_dump_cfg_rg23()
2352 mb->mbxCommand = MBX_DUMP_MEMORY; in lpfc_sli4_dump_cfg_rg23()
2353 mb->un.varDmp.type = DMP_NV_PARAMS; in lpfc_sli4_dump_cfg_rg23()
2354 mb->un.varDmp.region_id = DMP_REGION_23; in lpfc_sli4_dump_cfg_rg23()
2355 mb->un.varDmp.sli4_length = DMP_RGN23_SIZE; in lpfc_sli4_dump_cfg_rg23()
2356 mp = mbox->ctx_buf; in lpfc_sli4_dump_cfg_rg23()
2357 mb->un.varWords[3] = putPaddrLow(mp->phys); in lpfc_sli4_dump_cfg_rg23()
2358 mb->un.varWords[4] = putPaddrHigh(mp->phys); in lpfc_sli4_dump_cfg_rg23()
2368 (struct lpfc_rdp_context *)(mboxq->ctx_ndlp); in lpfc_mbx_cmpl_rdp_link_stat()
2370 mb = &mboxq->u.mb; in lpfc_mbx_cmpl_rdp_link_stat()
2371 if (mb->mbxStatus) in lpfc_mbx_cmpl_rdp_link_stat()
2374 memcpy(&rdp_context->link_stat, &mb->un.varRdLnk, sizeof(READ_LNK_VAR)); in lpfc_mbx_cmpl_rdp_link_stat()
2380 rdp_context->cmpl(phba, rdp_context, rc); in lpfc_mbx_cmpl_rdp_link_stat()
2386 struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)mbox->ctx_buf; in lpfc_mbx_cmpl_rdp_page_a2()
2388 (struct lpfc_rdp_context *)(mbox->ctx_ndlp); in lpfc_mbx_cmpl_rdp_page_a2()
2390 if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) in lpfc_mbx_cmpl_rdp_page_a2()
2393 lpfc_sli_bemem_bcopy(mp->virt, &rdp_context->page_a2, in lpfc_mbx_cmpl_rdp_page_a2()
2397 mbox->vport = rdp_context->ndlp->vport; in lpfc_mbx_cmpl_rdp_page_a2()
2400 mbox->ctx_buf = mp; in lpfc_mbx_cmpl_rdp_page_a2()
2401 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_link_stat; in lpfc_mbx_cmpl_rdp_page_a2()
2402 mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; in lpfc_mbx_cmpl_rdp_page_a2()
2410 rdp_context->cmpl(phba, rdp_context, FAILURE); in lpfc_mbx_cmpl_rdp_page_a2()
2417 struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *)(mbox->ctx_buf); in lpfc_mbx_cmpl_rdp_page_a0()
2419 (struct lpfc_rdp_context *)(mbox->ctx_ndlp); in lpfc_mbx_cmpl_rdp_page_a0()
2421 if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) in lpfc_mbx_cmpl_rdp_page_a0()
2424 lpfc_sli_bemem_bcopy(mp->virt, &rdp_context->page_a0, in lpfc_mbx_cmpl_rdp_page_a0()
2429 memset(mp->virt, 0, DMP_SFF_PAGE_A2_SIZE); in lpfc_mbx_cmpl_rdp_page_a0()
2430 INIT_LIST_HEAD(&mp->list); in lpfc_mbx_cmpl_rdp_page_a0()
2433 mbox->ctx_buf = mp; in lpfc_mbx_cmpl_rdp_page_a0()
2434 mbox->vport = rdp_context->ndlp->vport; in lpfc_mbx_cmpl_rdp_page_a0()
2436 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_DUMP_MEMORY); in lpfc_mbx_cmpl_rdp_page_a0()
2438 &mbox->u.mqe.un.mem_dump_type3, DMP_LMSD); in lpfc_mbx_cmpl_rdp_page_a0()
2440 &mbox->u.mqe.un.mem_dump_type3, phba->sli4_hba.physical_port); in lpfc_mbx_cmpl_rdp_page_a0()
2442 &mbox->u.mqe.un.mem_dump_type3, DMP_PAGE_A2); in lpfc_mbx_cmpl_rdp_page_a0()
2444 &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A2_SIZE); in lpfc_mbx_cmpl_rdp_page_a0()
2445 mbox->u.mqe.un.mem_dump_type3.addr_lo = putPaddrLow(mp->phys); in lpfc_mbx_cmpl_rdp_page_a0()
2446 mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); in lpfc_mbx_cmpl_rdp_page_a0()
2448 mbox->mbox_cmpl = lpfc_mbx_cmpl_rdp_page_a2; in lpfc_mbx_cmpl_rdp_page_a0()
2449 mbox->ctx_ndlp = (struct lpfc_rdp_context *)rdp_context; in lpfc_mbx_cmpl_rdp_page_a0()
2458 rdp_context->cmpl(phba, rdp_context, FAILURE); in lpfc_mbx_cmpl_rdp_page_a0()
2463 * lpfc_sli4_dump_page_a0 - Dump sli4 read SFP Diagnostic.
2485 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_DUMP_MEMORY); in lpfc_sli4_dump_page_a0()
2487 &mbox->u.mqe.un.mem_dump_type3, DMP_LMSD); in lpfc_sli4_dump_page_a0()
2489 &mbox->u.mqe.un.mem_dump_type3, phba->sli4_hba.physical_port); in lpfc_sli4_dump_page_a0()
2491 &mbox->u.mqe.un.mem_dump_type3, DMP_PAGE_A0); in lpfc_sli4_dump_page_a0()
2493 &mbox->u.mqe.un.mem_dump_type3, DMP_SFF_PAGE_A0_SIZE); in lpfc_sli4_dump_page_a0()
2495 mp = mbox->ctx_buf; in lpfc_sli4_dump_page_a0()
2496 mbox->u.mqe.un.mem_dump_type3.addr_lo = putPaddrLow(mp->phys); in lpfc_sli4_dump_page_a0()
2497 mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys); in lpfc_sli4_dump_page_a0()
2503 * lpfc_reg_fcfi - Initialize the REG_FCFI mailbox command
2521 reg_fcfi = &mbox->u.mqe.un.reg_fcfi; in lpfc_reg_fcfi()
2522 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_REG_FCFI); in lpfc_reg_fcfi()
2523 if (phba->nvmet_support == 0) { in lpfc_reg_fcfi()
2525 phba->sli4_hba.hdr_rq->queue_id); in lpfc_reg_fcfi()
2526 /* Match everything - rq_id0 */ in lpfc_reg_fcfi()
2536 (~phba->fcf.addr_mode) & 0x3); in lpfc_reg_fcfi()
2539 if (phba->cfg_nvmet_mrq != 1) in lpfc_reg_fcfi()
2543 phba->sli4_hba.nvmet_mrq_hdr[0]->queue_id); in lpfc_reg_fcfi()
2544 /* Match type FCP - rq_id0 */ in lpfc_reg_fcfi()
2551 phba->sli4_hba.hdr_rq->queue_id); in lpfc_reg_fcfi()
2552 /* Match everything else - rq_id1 */ in lpfc_reg_fcfi()
2561 phba->fcf.current_rec.fcf_indx); in lpfc_reg_fcfi()
2562 if (phba->fcf.current_rec.vlan_id != LPFC_FCOE_NULL_VID) { in lpfc_reg_fcfi()
2565 phba->fcf.current_rec.vlan_id); in lpfc_reg_fcfi()
2570 * lpfc_reg_fcfi_mrq - Initialize the REG_FCFI_MRQ mailbox command
2589 if (phba->cfg_nvmet_mrq <= 1) in lpfc_reg_fcfi_mrq()
2593 reg_fcfi = &mbox->u.mqe.un.reg_fcfi_mrq; in lpfc_reg_fcfi_mrq()
2594 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_REG_FCFI_MRQ); in lpfc_reg_fcfi_mrq()
2597 phba->fcf.current_rec.fcf_indx); in lpfc_reg_fcfi_mrq()
2598 if (phba->fcf.current_rec.vlan_id != LPFC_FCOE_NULL_VID) { in lpfc_reg_fcfi_mrq()
2601 phba->fcf.current_rec.vlan_id); in lpfc_reg_fcfi_mrq()
2607 phba->sli4_hba.nvmet_mrq_hdr[0]->queue_id); in lpfc_reg_fcfi_mrq()
2608 /* Match NVME frames of type FCP (protocol NVME) - rq_id0 */ in lpfc_reg_fcfi_mrq()
2619 bf_set(lpfc_reg_fcfi_mrq_npairs, reg_fcfi, phba->cfg_nvmet_mrq); in lpfc_reg_fcfi_mrq()
2622 phba->sli4_hba.hdr_rq->queue_id); in lpfc_reg_fcfi_mrq()
2623 /* Match everything - rq_id1 */ in lpfc_reg_fcfi_mrq()
2634 * lpfc_unreg_fcfi - Initialize the UNREG_FCFI mailbox command
2645 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_UNREG_FCFI); in lpfc_unreg_fcfi()
2646 bf_set(lpfc_unreg_fcfi, &mbox->u.mqe.un.unreg_fcfi, fcfi); in lpfc_unreg_fcfi()
2650 * lpfc_resume_rpi - Initialize the RESUME_RPI mailbox command
2660 struct lpfc_hba *phba = ndlp->phba; in lpfc_resume_rpi()
2664 resume_rpi = &mbox->u.mqe.un.resume_rpi; in lpfc_resume_rpi()
2665 bf_set(lpfc_mqe_command, &mbox->u.mqe, MBX_RESUME_RPI); in lpfc_resume_rpi()
2667 phba->sli4_hba.rpi_ids[ndlp->nlp_rpi]); in lpfc_resume_rpi()
2669 resume_rpi->event_tag = ndlp->phba->fc_eventTag; in lpfc_resume_rpi()