Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/device_if.m
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | CODE { | ||||
{ | { | ||||
return 0; | 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) | |||||
{ | |||||
return NULL; | |||||
} | |||||
}; | }; | ||||
/** | /** | ||||
* @brief Probe to see if a device matches a driver. | * @brief Probe to see if a device matches a driver. | ||||
* | * | ||||
* Users should not call this method directly. Normally, this | * Users should not call this method directly. Normally, this | ||||
* is called via device_probe_and_attach() to select a driver | * is called via device_probe_and_attach() to select a driver | ||||
* calling the DEVICE_PROBE() of all candidate drivers and attach | * calling the DEVICE_PROBE() of all candidate drivers and attach | ||||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | |||||
* @retval non-zero an error occurred while attempting to quiesce the | * @retval non-zero an error occurred while attempting to quiesce the | ||||
* device | * device | ||||
* | * | ||||
* @see DEVICE_DETACH() | * @see DEVICE_DETACH() | ||||
*/ | */ | ||||
METHOD int quiesce { | METHOD int quiesce { | ||||
device_t dev; | device_t dev; | ||||
} DEFAULT null_quiesce; | } DEFAULT null_quiesce; | ||||
/** | |||||
* @brief This is called when the driver is asked to register handlers. | |||||
* | |||||
* | |||||
* To include this method in a device driver, use a line like this | |||||
* in the driver's method list: | |||||
* | |||||
* @code | |||||
* KOBJMETHOD(device_register, foo_register) | |||||
* @endcode | |||||
* | |||||
* @param dev the device for which handlers are being registered | |||||
* | |||||
* @retval NULL method not implemented | |||||
* @retval non-NULL a pointer to implementation specific static driver state | |||||
* | |||||
*/ | |||||
METHOD void * register { | |||||
device_t dev; | |||||
} DEFAULT null_register; |