Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
#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);
Device node registering the callback.
Cookie returned from call to ddi_get_eventcookie(9F).
Callback handler responsible for handling an NDI event service notification.
Pointer to opaque data supplied by the caller. Typically, this would be a pointer to the driver's softstate structure.
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.
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.
Structure describing event that occurred.
Opaque data pointer provided, by the driver, during callback registration.
Pointer to event specific data defined by the framework which invokes the callback function.
Callback handler registered successfully.
Failed to register callback handler. Possible reasons include lack of resources or a bad cookie.
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Stability Level Committed |
Writing Device Drivers