ddi_cb_get_flags, ddi_cb_add_flags, ddi_cb_remove_flags - edit flags of a registered device driver callback handler
#include <sys/sunddi.h> int ddi_cb_get_flags(ddi_cb_handle_t hdl, ddi_cb_flags_t *flagsp);
int ddi_cb_add_flags(ddi_cb_handle_t hdl, ddi_cb_flags_t flags);
int ddi_cb_remove_flags(ddi_cb_handle_t hdl, ddi_cb_flags_t flags);
Handle to the registered callback handler.
Pointer to return the current flags settings.
Handle to the registered callback handler.
Flags to determine the callback events to add.
Handle to the registered callback handler.
Flags to determine the callback events to remove.
Solaris DDI specific (Solaris DDI).
The functions ddi_cb_get_flags(), ddi_cb_add_flags(), and ddi_cb_remove_flags() provide a driver with the option to selectively enable or disable support for specific types of callback actions for a registered callback handler.
The functions ddi_cb_register() and ddi_cb_unregister() can be used by a device driver to register and unregister a callback handler. During registration, a device driver specifies a set of flags indicating what callback actions it can process. After registration, the device driver may then receive any actions related to the specified flags.
If a device driver expects to process multiple types of callback actions, it might be difficult during attach(9E) to enable support for all callback actions simultaneously using the function ddi_cb_register(). In such cases, the device driver may register a callback handler with fewer flags specified (possibly even no flags), and then use the function ddi_cb_add_flags() to incrementally enable support for callback actions with more granularity during attach(9E). Likewise, the function ddi_cb_remove_flags() allows a device driver to incrementally teardown callback support during detach(9E).
The function ddi_cb_unregister() will unregister a device driver callback handler and disable all callback actions. There is no need to first remove flags using the function ddi_cb_remove_flags() before unregistering.
The flags parameter consists of the following:
The device driver participates in interrupt resource management. When this flag is set, the device driver may receive callback actions related to changes in interrupt availability.
Indicates to the DDI framework that the device driver is IOV capable. When this flag is set, the device driver may receive callback actions related to configuring or unconfiguring IOV virtual functions.
The device driver uses the pciv_send(9F) interfaces for inter-domain and intra-domain communication. When this flag is set, device drivers may receive callback actions notifying them about incoming data.
The device driver supports Live Suspend and Resume (LSR) operations. When this flag is set, a device driver may receive callback actions that describe the circumstances of I/O suspend and resume operations.
The functions ddi_cb_get_flags(), ddi_cb_add_flags(), and ddi_cb_remove_flags() return:
On success.
An invalid parameter was given. The callback handle was invalid or unregistered, the flagsp parameter for ddi_cb_get_flags() is invalid, or an invalid flags parameter was specified.
These functions can be called from kernel, non-interrupt context.
See attributes(7) for descriptions of the following attributes:
|