sunldi.h revision 25e8c5aa2b496d9026e958ac731a610167574f59
/*
* CDDL HEADER START
*
* 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
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SUNLDI_H
#define _SYS_SUNLDI_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* DDI interfaces for Layered driver support.
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/*
* Opaque layered driver data structures.
*
* The contents of these data structures are private to this
* implementation of Solaris and are subject to change at any
* time without notice.
*
* Applications and drivers accessing the contents of these structures
* directly will fail to run on future releases.
*/
typedef struct __ldi_ident *ldi_ident_t;
typedef struct __ldi_handle *ldi_handle_t;
typedef struct __ldi_callback_id *ldi_callback_id_t;
typedef struct __ldi_ev_cookie *ldi_ev_cookie_t;
/*
* LDI event interface related
*/
#define LDI_EV_SUCCESS 0
#define LDI_EV_FAILURE (-1)
#define LDI_EV_OFFLINE "LDI:EVENT:OFFLINE"
#define LDI_EV_DEGRADE "LDI:EVENT:DEGRADE"
#define LDI_EV_CB_VERS_1 1
#define LDI_EV_CB_VERS LDI_EV_CB_VERS_1
typedef struct ldi_ev_callback {
/*
* LDI Ident manipulation functions
*/
extern ldi_ident_t ldi_ident_from_anon(void);
extern void ldi_ident_release(ldi_ident_t);
/*
* LDI Handle manipulation functions
*/
ldi_handle_t *, ldi_ident_t);
extern int ldi_open_by_name(char *, int, cred_t *,
ldi_handle_t *, ldi_ident_t);
ldi_handle_t *, ldi_ident_t);
char *, caddr_t, int *);
extern int ldi_get_otyp(ldi_handle_t, int *);
extern int ldi_get_minor_name(ldi_handle_t, char **);
/*
* LDI events related declarations
*/
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SUNLDI_H */