FreeBSD/sys/dev/ntb/ntb_hw/ntb_hw.c
/**
 * ntb_peer_spad_write() - write to the secondary scratchpad register
 * @ntb: pointer to ntb_softc instance
 * @idx: index to the scratchpad register, 0 based
 * @val: the data value to put into the register
 *
 * This function allows writing of a 32bit value to the indexed scratchpad
 * register. The register resides on the secondary (external) side.
 *
 * RETURNS: An appropriate ERRNO error value on error, or zero for success.
 */
write to the secondary scratchpad register
@ntb: pointer to ntb_softc instance
@idx: index to the scratchpad register, 0 based
@val: the data value to put into the register

This function allows writing of a 32bit value to the indexed scratchpad
register. The register resides on the secondary (external) side.

An appropriate ERRNO error value on error, or zero for success.
write to the secondary scratchpad register @ntb : pointer to ntb_softc instance @idx : index to the scratchpad register 0 based @val : the data value to put into the register This function allows writing of a 32bit value to the indexed scratchpad register . The register resides on the secondary ( external ) side . An appropriate ERRNO error value on error or zero for success .
int
ntb_peer_spad_write(struct ntb_softc *ntb, unsigned int idx, uint32_t val)
{
	if (idx >= ntb->spad_count)
		return (EINVAL);
	if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP))
		ntb_mw_write(4, XEON_SPAD_OFFSET + idx * 4, val);
	else
		ntb_reg_write(4, ntb->peer_reg->spad + idx * 4, val);
	return (0);
}
int ntb_peer_spad_write ( struct ntb_softc * ntb , unsigned int idx , uint32_t val ) { if ( idx >= ntb -> spad_count ) return ( EINVAL ) ; if ( HAS_FEATURE ( NTB_SDOORBELL_LOCKUP ) ) ntb_mw_write ( 4 , XEON_SPAD_OFFSET + idx * 4 , val ) ; else ntb_reg_write ( 4 , ntb -> peer_reg -> spad + idx * 4 , val ) ; return ( 0 ) ; }
ntb_peer_spad_write() - write to the secondary scratchpad register
 @ntb: pointer to ntb_softc instance
 @idx: index to the scratchpad register, 0 based
 @val: the data value to put into the register
ntb_peer_spad_write () - write to the secondary scratchpad register @ntb : pointer to ntb_softc instance @idx : index to the scratchpad register 0 based @val : the data value to put into the register