FreeBSD/sys/dev/ipmi/ipmi_kcs.c
/*
 * Start to write a request.  Waits for IBF to clear and then sends the
 * WR_START command.
 */
Start to write a request.  Waits for IBF to clear and then sends the
WR_START command.
Start to write a request . Waits for IBF to clear and then sends the WR_START command .
static int
kcs_start_write(struct ipmi_softc *sc)
{
	int retry, status;
	for (retry = 0; retry < 10; retry++) {
		status = kcs_wait_for_ibf(sc, 0);
		if (status & KCS_STATUS_IBF)
			return (0);
		kcs_clear_obf(sc, status);
		OUTB(sc, KCS_CTL_STS, KCS_CONTROL_WRITE_START);
		status = kcs_wait_for_ibf(sc, 0);
		if (status & KCS_STATUS_IBF)
			return (0);
		if (KCS_STATUS_STATE(status) == KCS_STATUS_STATE_WRITE)
			break;
		DELAY(1000000);
	}
	if (KCS_STATUS_STATE(status) != KCS_STATUS_STATE_WRITE)
		return (0);
	kcs_clear_obf(sc, status);
	return (1);
}
static int kcs_start_write ( struct ipmi_softc * sc ) { int retry , status ; for ( retry = 0 ; retry < 10 ; retry ++ ) { status = kcs_wait_for_ibf ( sc , 0 ) ; if ( status & KCS_STATUS_IBF ) return ( 0 ) ; kcs_clear_obf ( sc , status ) ; OUTB ( sc , KCS_CTL_STS , KCS_CONTROL_WRITE_START ) ; status = kcs_wait_for_ibf ( sc , 0 ) ; if ( status & KCS_STATUS_IBF ) return ( 0 ) ; if ( KCS_STATUS_STATE ( status ) == KCS_STATUS_STATE_WRITE ) break ; DELAY ( 1000000 ) ; } if ( KCS_STATUS_STATE ( status ) != KCS_STATUS_STATE_WRITE ) return ( 0 ) ; kcs_clear_obf ( sc , status ) ; return ( 1 ) ; }
Start to write a request.
Start to write a request .
/* Wait for IBF = 0 */ /* Clear OBF */ /* Write start to command */ /* Wait for IBF = 0 */ /* error state */ /* Clear OBF */