ddi_add_event_handler - add an NDI event service callback handler
#include <sys/dditypes.h> #include <sys/sunddi.h> int ddi_add_event_handler(dev_info_t *dip, ddi_eventcookie_t cookie, void (*handler)(dev_info_t *, ddi_eventcookie_t, void *, void *), void *arg, ddi_registration_id_t *id);
Solaris DDI specific (Solaris DDI).
dev_info_t *dip
ddi_eventcookie_t cookie
void (*handler)(dev_info_t *, ddi_eventcookie_t, void *, void *)
void *arg
ddi_registration_id_t *id
The ddi_add_event_handler() function adds a callback handler to be invoked in the face of the event specifed by cookie. The process of adding a callback handler is also known as subscribing to an event. Upon successful subscription, the handler will be invoked by the system when the event occurs. The handler can be unregistered by using ddi_remove_event_handler(9F).
An instance of a driver can register multiple handlers for an event or a single handler for multiple events. Callback order is not defined and should assumed to be random.
The routine handler will be invoked with the following arguments:
dev_info_t *dip
ddi_eventcookie_t cookie
void *arg
void *impl_data
DDI_SUCCESS
DDI_FAILURE
The ddi_add_event_handler() and handler() function can be called from user and kernel contexts only.
See attributes(5) for a description of the following attributes:
|
attributes(5), ddi_get_eventcookie(9F), ddi_remove_event_handler(9F)
Drivers must remove all registered callback handlers for a device instance by calling ddi_remove_event_handler(9F) before detach completes.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |