docs/how-to-build.md: use proper markup for directory names
[unleashed/tickless.git] / include / sys / ndi_impldefs.h
blob0d450e2db0904cee094fc802411bbe508e7339c2
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_NDI_IMPLDEFS_H
27 #define _SYS_NDI_IMPLDEFS_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/types.h>
32 #include <sys/param.h>
33 #include <sys/t_lock.h>
34 #include <sys/ddipropdefs.h>
35 #include <sys/devops.h>
36 #include <sys/autoconf.h>
37 #include <sys/mutex.h>
38 #include <vm/page.h>
39 #include <sys/ddi_impldefs.h>
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
45 /* event handle for callback management */
46 struct ndi_event_hdl {
47 dev_info_t *ndi_evthdl_dip;
50 * mutex that protect the handle and event defs
52 kmutex_t ndi_evthdl_mutex;
55 * mutex that just protects the callback list
57 kmutex_t ndi_evthdl_cb_mutex;
59 ddi_iblock_cookie_t ndi_evthdl_iblock_cookie;
61 uint_t ndi_evthdl_high_plevels;
62 uint_t ndi_evthdl_other_plevels;
64 uint_t ndi_evthdl_n_events;
65 ndi_event_cookie_t *ndi_evthdl_cookie_list;
66 ndi_event_hdl_t ndi_next_hdl;
69 /* prototypes needed by sunndi.c */
70 int ddi_prop_fm_encode_bytes(prop_handle_t *, void *data, uint_t);
72 int ddi_prop_fm_encode_ints(prop_handle_t *, void *data, uint_t);
74 int ddi_prop_fm_encode_int64(prop_handle_t *, void *data, uint_t);
76 int ddi_prop_int64_op(prop_handle_t *, uint_t, int64_t *);
78 int ddi_prop_update_common(dev_t, dev_info_t *, int, char *, void *, uint_t,
79 int (*)(prop_handle_t *, void *, uint_t));
81 int ddi_prop_lookup_common(dev_t, dev_info_t *, uint_t, char *, void *,
82 uint_t *, int (*)(prop_handle_t *, void *, uint_t *));
84 int ddi_prop_remove_common(dev_t, dev_info_t *, char *, int);
85 void ddi_prop_remove_all_common(dev_info_t *, int);
87 int ddi_prop_fm_encode_string(prop_handle_t *, void *, uint_t);
89 int ddi_prop_fm_encode_strings(prop_handle_t *, void *, uint_t);
90 int ddi_prop_fm_decode_strings(prop_handle_t *, void *, uint_t *);
93 * Internal configuration routines
95 int i_ndi_config_node(dev_info_t *, ddi_node_state_t, uint_t);
96 int i_ndi_unconfig_node(dev_info_t *, ddi_node_state_t, uint_t);
99 * Obsolete interface, no longer used, to be removed.
100 * Retained only for driver compatibility.
102 void i_ndi_block_device_tree_changes(uint_t *); /* obsolete */
103 void i_ndi_allow_device_tree_changes(uint_t); /* obsolete */
106 * ndi_dev_is_auto_assigned_node: Return non-zero if the nodeid in dev
107 * has been auto-assigned by the framework and should be auto-freed.
108 * (Intended for use by the framework only.)
110 int i_ndi_dev_is_auto_assigned_node(dev_info_t *);
113 * Get and set nodeclass and node attributes.
114 * (Intended for ddi framework use only.)
116 ddi_node_class_t i_ndi_get_node_class(dev_info_t *);
117 void i_ndi_set_node_class(dev_info_t *, ddi_node_class_t);
119 int i_ndi_get_node_attributes(dev_info_t *);
120 void i_ndi_set_node_attributes(dev_info_t *, int);
123 * Set nodeid .. not generally advisable.
124 * (Intended for the ddi framework use only.)
126 void i_ndi_set_nodeid(dev_info_t *, int);
129 * Make driver.conf children.
130 * (Intended for the ddi framework use only.)
132 int i_ndi_make_spec_children(dev_info_t *, uint_t);
134 #ifdef __cplusplus
136 #endif
138 #endif /* _SYS_NDI_IMPLDEFS_H */