ddi_add_event_handler man page on Solaris

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
Solaris logo
[printable version]

ddi_add_event_handler(9F)Kernel Functions for Driversddi_add_event_handler(9F)

NAME
       ddi_add_event_handler - add an NDI event service callback handler

SYNOPSIS
       #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);

INTERFACE LEVEL
       Solaris DDI specific (Solaris DDI).

PARAMETERS
       dev_info_t *dip

	   Device node registering the callback.

       ddi_eventcookie_t cookie

	   Cookie returned from call to ddi_get_eventcookie(9F).

       void (*handler)(dev_info_t *, ddi_eventcookie_t, void *, void *)

	   Callback  handler  responsible  for	handling  an NDI event service
	   notification.

       void *arg

	   Pointer to opaque data supplied  by	the  caller.  Typically,  this
	   would be a pointer to the driver's softstate structure.

       ddi_registration_id_t *id

	   Pointer  to	registration ID where a unique registration id will be
	   returned. Registration ID must  be  saved  and  used	 when  calling
	   ddi_remove_event_handler(9F) to unregister a callback.

DESCRIPTION
       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

	   Device node requesting the notification.

       ddi_eventcookie_t cookie

	   Structure describing event that occurred.

       void *arg

	   Opaque data pointer provided, by the driver, during callback regis‐
	   tration.

       void *impl_data

	   Pointer  to	event  specific	 data  defined	by the framework which
	   invokes the callback function.

RETURN VALUES
       DDI_SUCCESS

	   Callback handler registered successfully.

       DDI_FAILURE

	   Failed to register callback handler. Possible reasons include  lack
	   of resources or a bad cookie.

CONTEXT
       The  ddi_add_event_handler()  and handler() function can be called from
       user and kernel contexts only.

ATTRIBUTES
       See attributes(5) for a description of the following attributes:

       ┌─────────────────────────────┬─────────────────────────────┐
       │      ATTRIBUTE TYPE	     │	    ATTRIBUTE VALUE	   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Stability Level		     │Evolving			   │
       └─────────────────────────────┴─────────────────────────────┘

SEE ALSO
       attributes(5), ddi_get_eventcookie(9F), ddi_remove_event_handler(9F)

       Writing Device Drivers

NOTES
       Drivers must remove all	registered  callback  handlers	for  a	device
       instance	 by  calling  ddi_remove_event_handler(9F)  before detach com‐
       pletes.

SunOS 5.10			  62 Nov 2003	     ddi_add_event_handler(9F)
[top]

List of man pages available for Solaris

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net