FreeBSD/sys/dev/ntb/ntb_hw/ntb_hw.c
/**
 * ntb_peer_db_set() - Set the doorbell on the secondary/external side
 * @ntb: pointer to ntb_softc instance
 * @bit: doorbell bits to ring
 *
 * This function allows triggering of a doorbell on the secondary/external
 * side that will initiate an interrupt on the remote host
 */
Set the doorbell on the secondary/external side
@ntb: pointer to ntb_softc instance
@bit: doorbell bits to ring

This function allows triggering of a doorbell on the secondary/external
side that will initiate an interrupt on the remote host
Set the doorbell on the secondary / external side @ntb : pointer to ntb_softc instance @bit : doorbell bits to ring This function allows triggering of a doorbell on the secondary / external side that will initiate an interrupt on the remote host
void
ntb_peer_db_set(struct ntb_softc *ntb, uint64_t bit)
{
	if (HAS_FEATURE(NTB_SB01BASE_LOCKUP)) {
		struct ntb_pci_bar_info *lapic;
		unsigned i;
		lapic = ntb->peer_lapic_bar;
		for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) {
			if ((bit & ntb_db_vector_mask(ntb, i)) != 0)
				bus_space_write_4(lapic->pci_bus_tag,
				    lapic->pci_bus_handle,
				    ntb->peer_msix_data[i].nmd_ofs,
				    ntb->peer_msix_data[i].nmd_data);
		}
		return;
	}
	if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) {
		ntb_mw_write(2, XEON_PDOORBELL_OFFSET, bit);
		return;
	}
	db_iowrite(ntb, ntb->peer_reg->db_bell, bit);
}
void ntb_peer_db_set ( struct ntb_softc * ntb , uint64_t bit ) { if ( HAS_FEATURE ( NTB_SB01BASE_LOCKUP ) ) { struct ntb_pci_bar_info * lapic ; unsigned i ; lapic = ntb -> peer_lapic_bar ; for ( i = 0 ; i < XEON_NONLINK_DB_MSIX_BITS ; i ++ ) { if ( ( bit & ntb_db_vector_mask ( ntb , i ) ) != 0 ) bus_space_write_4 ( lapic -> pci_bus_tag , lapic -> pci_bus_handle , ntb -> peer_msix_data [ i ] . nmd_ofs , ntb -> peer_msix_data [ i ] . nmd_data ) ; } return ; } if ( HAS_FEATURE ( NTB_SDOORBELL_LOCKUP ) ) { ntb_mw_write ( 2 , XEON_PDOORBELL_OFFSET , bit ) ; return ; } db_iowrite ( ntb , ntb -> peer_reg -> db_bell , bit ) ; }
ntb_peer_db_set() - Set the doorbell on the secondary/external side
 @ntb: pointer to ntb_softc instance
 @bit: doorbell bits to ring
ntb_peer_db_set () - Set the doorbell on the secondary / external side @ntb : pointer to ntb_softc instance @bit : doorbell bits to ring