FreeBSD/sys/dev/ntb/ntb_hw/ntb_hw.c
/*
 * ntb_link_disable() - disable the link on the secondary side of the ntb
 * @ntb:        NTB device context
 *
 * Disable the link on the secondary side of the ntb.  This can only be done
 * from the primary side of the ntb in primary or b2b topology.  The ntb device
 * should disable the link.  Returning from this call must indicate that a
 * barrier has passed, though with no more writes may pass in either direction
 * across the link, except if this call returns an error number.
 *
 * Return: Zero on success, otherwise an error number.
 */
disable the link on the secondary side of the ntb
@ntb:        NTB device context

Disable the link on the secondary side of the ntb.  This can only be done
from the primary side of the ntb in primary or b2b topology.  The ntb device
should disable the link.  Returning from this call must indicate that a
barrier has passed, though with no more writes may pass in either direction
across the link, except if this call returns an error number.

Zero on success, otherwise an error number.
disable the link on the secondary side of the ntb @ntb : NTB device context Disable the link on the secondary side of the ntb . This can only be done from the primary side of the ntb in primary or b2b topology . The ntb device should disable the link . Returning from this call must indicate that a barrier has passed though with no more writes may pass in either direction across the link except if this call returns an error number . Zero on success otherwise an error number .
int
ntb_link_disable(struct ntb_softc *ntb)
{
	uint32_t cntl;
	ntb_printf(2, "%s\n", __func__);
	if (ntb->conn_type == NTB_CONN_TRANSPARENT) {
		ntb_link_event(ntb);
		return (0);
	}
	cntl = ntb_reg_read(4, ntb->reg->ntb_ctl);
	cntl &= ~(NTB_CNTL_P2S_BAR23_SNOOP | NTB_CNTL_S2P_BAR23_SNOOP);
	cntl &= ~(NTB_CNTL_P2S_BAR4_SNOOP | NTB_CNTL_S2P_BAR4_SNOOP);
	if (HAS_FEATURE(NTB_SPLIT_BAR))
		cntl &= ~(NTB_CNTL_P2S_BAR5_SNOOP | NTB_CNTL_S2P_BAR5_SNOOP);
	cntl |= NTB_CNTL_LINK_DISABLE | NTB_CNTL_CFG_LOCK;
	ntb_reg_write(4, ntb->reg->ntb_ctl, cntl);
	return (0);
}
int ntb_link_disable ( struct ntb_softc * ntb ) { uint32_t cntl ; ntb_printf ( 2 , " \n " , __func__ ) ; if ( ntb -> conn_type == NTB_CONN_TRANSPARENT ) { ntb_link_event ( ntb ) ; return ( 0 ) ; } cntl = ntb_reg_read ( 4 , ntb -> reg -> ntb_ctl ) ; cntl &= ~ ( NTB_CNTL_P2S_BAR23_SNOOP | NTB_CNTL_S2P_BAR23_SNOOP ) ; cntl &= ~ ( NTB_CNTL_P2S_BAR4_SNOOP | NTB_CNTL_S2P_BAR4_SNOOP ) ; if ( HAS_FEATURE ( NTB_SPLIT_BAR ) ) cntl &= ~ ( NTB_CNTL_P2S_BAR5_SNOOP | NTB_CNTL_S2P_BAR5_SNOOP ) ; cntl |= NTB_CNTL_LINK_DISABLE | NTB_CNTL_CFG_LOCK ; ntb_reg_write ( 4 , ntb -> reg -> ntb_ctl , cntl ) ; return ( 0 ) ; }
ntb_link_disable() - disable the link on the secondary side of the ntb
 @ntb:        NTB device context
ntb_link_disable () - disable the link on the secondary side of the ntb @ntb : NTB device context