FreeBSD/sys/dev/esp/ncr53c9x.c
/*
 * Convert Synchronous Transfer Period to chip register Clock Per Byte value.
 */
Convert Synchronous Transfer Period to chip register Clock Per Byte value.
Convert Synchronous Transfer Period to chip register Clock Per Byte value .
static inline int
ncr53c9x_stp2cpb(struct ncr53c9x_softc *sc, int period)
{
	int v;
	NCR_LOCK_ASSERT(sc, MA_OWNED);
	v = (sc->sc_freq * period) / 250;
	if (ncr53c9x_cpb2stp(sc, v) < period)
		v++;
	return (v);
}
static inline int ncr53c9x_stp2cpb ( struct ncr53c9x_softc * sc , int period ) { int v ; NCR_LOCK_ASSERT ( sc , MA_OWNED ) ; v = ( sc -> sc_freq * period ) / 250 ; if ( ncr53c9x_cpb2stp ( sc , v ) < period ) v ++ ; return ( v ) ; }
Convert Synchronous Transfer Period to chip register Clock Per Byte value.
Convert Synchronous Transfer Period to chip register Clock Per Byte value .
/* Correct round-down error. */