FreeBSD/sys/dev/wbwd/wbwd.c
/*
 * Read the current values before returning them.  Given this might poke
 * the registers the same time as the watchdog, this sysctl handler should
 * be marked CTLFLAG_SKIP to not show up by default.
 */
Read the current values before returning them.  Given this might poke
the registers the same time as the watchdog, this sysctl handler should
be marked CTLFLAG_SKIP to not show up by default.
Read the current values before returning them . Given this might poke the registers the same time as the watchdog this sysctl handler should be marked CTLFLAG_SKIP to not show up by default .
static int
sysctl_wb_debug_current(SYSCTL_HANDLER_ARGS)
{
	struct wb_softc *sc;
	sc = arg1;
	if ((*sc->ext_cfg_enter_f)(sc, 0) != 0)
		return (ENXIO);
	write_reg(sc, WB_LDN_REG, WB_LDN_REG_LDN8);
	sc->reg_1 = read_reg(sc, sc->ctl_reg);
	sc->reg_timeout = read_reg(sc, sc->time_reg);
	sc->reg_2 = read_reg(sc, sc->csr_reg);
	(*sc->ext_cfg_exit_f)(sc, 0);
	return (sysctl_wb_debug(oidp, arg1, arg2, req));
}
static int sysctl_wb_debug_current ( SYSCTL_HANDLER_ARGS ) { struct wb_softc * sc ; sc = arg1 ; if ( ( * sc -> ext_cfg_enter_f ) ( sc , 0 ) != 0 ) return ( ENXIO ) ; write_reg ( sc , WB_LDN_REG , WB_LDN_REG_LDN8 ) ; sc -> reg_1 = read_reg ( sc , sc -> ctl_reg ) ; sc -> reg_timeout = read_reg ( sc , sc -> time_reg ) ; sc -> reg_2 = read_reg ( sc , sc -> csr_reg ) ; ( * sc -> ext_cfg_exit_f ) ( sc , 0 ) ; return ( sysctl_wb_debug ( oidp , arg1 , arg2 , req ) ) ; }
Read the current values before returning them.
Read the current values before returning them .
/* Watchdog is configured as part of LDN 8 (GPIO Port2, Watchdog). */