Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/device_if.m
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | static int null_shutdown(device_t dev) | ||||
return 0; | return 0; | ||||
} | } | ||||
static int null_suspend(device_t dev) | static int null_suspend(device_t dev) | ||||
{ | { | ||||
return 0; | return 0; | ||||
} | } | ||||
static int null_post_suspend(device_t dev) | |||||
{ | |||||
return 0; | |||||
} | |||||
static int null_resume(device_t dev) | static int null_resume(device_t dev) | ||||
{ | { | ||||
return 0; | return 0; | ||||
} | } | ||||
static int null_post_resume(device_t dev) | |||||
{ | |||||
return 0; | |||||
} | |||||
static int null_quiesce(device_t dev) | static int null_quiesce(device_t dev) | ||||
{ | { | ||||
return 0; | return 0; | ||||
} | } | ||||
static void * null_register(device_t dev) | static void * null_register(device_t dev) | ||||
{ | { | ||||
return NULL; | return NULL; | ||||
▲ Show 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* @see DEVICE_RESUME() | * @see DEVICE_RESUME() | ||||
*/ | */ | ||||
METHOD int suspend { | METHOD int suspend { | ||||
device_t dev; | device_t dev; | ||||
} DEFAULT null_suspend; | } DEFAULT null_suspend; | ||||
/** | /** | ||||
* @brief This is called by the power-management subsystem *after* suspending | |||||
* other devices. | |||||
* | |||||
* This gives special power management devices a chance to run their preparation | |||||
* routines when needed just before idle. An example of such a case is certain | |||||
* platforms contain a System Power Management Controller, which has hooks to | |||||
* enable deeper sleep states, but only after the rest of the system has gone | |||||
* down. | |||||
* | |||||
* Generally only one device in the system should actively have an | |||||
* implementation of this routine. | |||||
* | |||||
* To include this method in a device driver, use a line like this in the | |||||
* driver's method list: | |||||
* | |||||
* @code | |||||
* DEVMETHOD(device_post_suspend, foo_post_suspend) | |||||
* @endcode | |||||
* | |||||
* @param dev the device orchestrating deeper suspend | |||||
* | |||||
* @retval 0 success | |||||
* @retval non-zero an error occurred preventing deeper suspend | |||||
* | |||||
* @see DEVICE_POST_RESUME() | |||||
*/ | |||||
METHOD int post_suspend { | |||||
device_t dev; | |||||
} DEFAULT null_post_suspend; | |||||
/** | |||||
* @brief This is called when the system resumes after a suspend. | * @brief This is called when the system resumes after a suspend. | ||||
* | * | ||||
* To include this method in a device driver, use a line like this | * To include this method in a device driver, use a line like this | ||||
* in the driver's method list: | * in the driver's method list: | ||||
* | * | ||||
* @code | * @code | ||||
* KOBJMETHOD(device_resume, foo_resume) | * KOBJMETHOD(device_resume, foo_resume) | ||||
* @endcode | * @endcode | ||||
* | * | ||||
* @param dev the device being resumed | * @param dev the device being resumed | ||||
* | * | ||||
* @retval 0 success | * @retval 0 success | ||||
* @retval non-zero an error occurred while attempting to restore the | * @retval non-zero an error occurred while attempting to restore the | ||||
* device from suspension | * device from suspension | ||||
* | * | ||||
* @see DEVICE_SUSPEND() | * @see DEVICE_SUSPEND() | ||||
*/ | */ | ||||
METHOD int resume { | METHOD int resume { | ||||
device_t dev; | device_t dev; | ||||
} DEFAULT null_resume; | } DEFAULT null_resume; | ||||
/** | |||||
* @brief This is called *after* a system resumes from suspend, but *before* | |||||
* resuming devices. | |||||
* | |||||
* To include this method in a device driver, use a line like this | |||||
* in the driver's method list: | |||||
* | |||||
* @code | |||||
* DEVMETHOD(device_post_resume, foo_post_resume) | |||||
* @endcode | |||||
* | |||||
* @param dev the device orchestrating deeper suspend | |||||
* | |||||
* @retval 0 success | |||||
* @retval non-zero an error occurred preventing deeper suspend | |||||
* | |||||
* @see DEVICE_POST_SUSPEND() | |||||
*/ | |||||
METHOD int post_resume { | |||||
device_t dev; | |||||
} DEFAULT null_post_resume; | |||||
/** | /** | ||||
* @brief This is called when the driver is asked to quiesce itself. | * @brief This is called when the driver is asked to quiesce itself. | ||||
* | * | ||||
* The driver should arrange for the orderly shutdown of this device. | * The driver should arrange for the orderly shutdown of this device. | ||||
* All further access to the device should be curtailed. Soon there | * All further access to the device should be curtailed. Soon there | ||||
* will be a request to detach, but there won't necessarily be one. | * will be a request to detach, but there won't necessarily be one. | ||||
* | * | ||||
Show All 39 Lines |