/* Use the following function to check whether or not the watchdog is active */ staticinlinebool watchdog_active(struct watchdog_device *wdd)
{ return test_bit(WDOG_ACTIVE, &wdd->status);
}
/* Use the following function to set the nowayout feature */ staticinlinevoid watchdog_set_nowayout(struct watchdog_device *wdd, bool nowayout)
{ if (nowayout)
set_bit(WDOG_NO_WAY_OUT, &wdd->status);
}
/* Use the following function to stop the watchdog on reboot */ staticinlinevoid watchdog_stop_on_reboot(struct watchdog_device *wdd)
{
set_bit(WDOG_STOP_ON_REBOOT, &wdd->status);
}
/* Use the following function to stop the watchdog when unregistering it */ staticinlinevoid watchdog_stop_on_unregister(struct watchdog_device *wdd)
{
set_bit(WDOG_STOP_ON_UNREGISTER, &wdd->status);
}
/* Use the following function to stop the wdog ping worker when suspending */ staticinlinevoid watchdog_stop_ping_on_suspend(struct watchdog_device *wdd)
{
set_bit(WDOG_NO_PING_ON_SUSPEND, &wdd->status);
}
/* Use the following function to check if a timeout value is invalid */ staticinlinebool watchdog_timeout_invalid(struct watchdog_device *wdd, unsignedint t)
{ /* *Thetimeoutisinvalidif *-therequestedvalueislargerthanUINT_MAX/1000 *(sinceinternalcalculationsaredoneinmilli-seconds), *or *-therequestedvalueissmallerthantheconfiguredminimumtimeout, *or *-amaximumhardwaretimeoutisnotconfigured,amaximumtimeout *isconfigured,andtherequestedvalueislargerthanthe *configuredmaximumtimeout.
*/ return t > UINT_MAX / 1000 || t < wdd->min_timeout ||
(!wdd->max_hw_heartbeat_ms && wdd->max_timeout &&
t > wdd->max_timeout);
}
/* Use the following function to check if a pretimeout value is invalid */ staticinlinebool watchdog_pretimeout_invalid(struct watchdog_device *wdd, unsignedint t)
{ return t && wdd->timeout && t >= wdd->timeout;
}
/* Use the following functions to manipulate watchdog driver specific data */ staticinlinevoid watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
{
wdd->driver_data = data;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.