FreeBSD/sys/dev/ntb/ntb_hw/ntb_hw.c
/*
 * ntb_get_peer_db_addr() - Return the address of the remote doorbell register,
 * as well as the size of the register (via *sz_out).
 *
 * This function allows a caller using I/OAT DMA to chain the remote doorbell
 * ring to its memory window write.
 *
 * Note that writing the peer doorbell via a memory window will *not* generate
 * an interrupt on the remote host; that must be done separately.
 */
Return the address of the remote doorbell register,
as well as the size of the register (via *sz_out).

This function allows a caller using I/OAT DMA to chain the remote doorbell
ring to its memory window write.

Note that writing the peer doorbell via a memory window will *not* generate
an interrupt on the remote host; that must be done separately.
Return the address of the remote doorbell register as well as the size of the register ( via * sz_out ) . This function allows a caller using I / OAT DMA to chain the remote doorbell ring to its memory window write . Note that writing the peer doorbell via a memory window will * not * generate an interrupt on the remote host ; that must be done separately .
bus_addr_t
ntb_get_peer_db_addr(struct ntb_softc *ntb, vm_size_t *sz_out)
{
	struct ntb_pci_bar_info *bar;
	uint64_t regoff;
	KASSERT(sz_out != NULL, ("must be non-NULL"));
	if (!HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) {
		bar = &ntb->bar_info[NTB_CONFIG_BAR];
		regoff = ntb->peer_reg->db_bell;
	} else {
		KASSERT(ntb->b2b_mw_idx != B2B_MW_DISABLED,
		    ("invalid b2b idx"));
		bar = &ntb->bar_info[ntb_mw_to_bar(ntb, ntb->b2b_mw_idx)];
		regoff = XEON_PDOORBELL_OFFSET;
	}
	KASSERT(bar->pci_bus_tag != X86_BUS_SPACE_IO, ("uh oh"));
	*sz_out = ntb->reg->db_size;
	return ((uint64_t)bar->pci_bus_handle + regoff);
}
bus_addr_t ntb_get_peer_db_addr ( struct ntb_softc * ntb , vm_size_t * sz_out ) { struct ntb_pci_bar_info * bar ; uint64_t regoff ; KASSERT ( sz_out != NULL , ( " " ) ) ; if ( ! HAS_FEATURE ( NTB_SDOORBELL_LOCKUP ) ) { bar = & ntb -> bar_info [ NTB_CONFIG_BAR ] ; regoff = ntb -> peer_reg -> db_bell ; } else { KASSERT ( ntb -> b2b_mw_idx != B2B_MW_DISABLED , ( " " ) ) ; bar = & ntb -> bar_info [ ntb_mw_to_bar ( ntb , ntb -> b2b_mw_idx ) ] ; regoff = XEON_PDOORBELL_OFFSET ; } KASSERT ( bar -> pci_bus_tag != X86_BUS_SPACE_IO , ( " " ) ) ; * sz_out = ntb -> reg -> db_size ; return ( ( uint64_t ) bar -> pci_bus_handle + regoff ) ; }
ntb_get_peer_db_addr() - Return the address of the remote doorbell register,
 as well as the size of the register (via *sz_out).
ntb_get_peer_db_addr () - Return the address of the remote doorbell register as well as the size of the register ( via * sz_out ) .
/* HACK: Specific to current x86 bus implementation. */