17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
5f4da9becth * Common Development and Distribution License (the "License").
6f4da9becth * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
217c478bdstevel@tonic-gate/*
22f4da9becth * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bdstevel@tonic-gate * Use is subject to license terms.
247c478bdstevel@tonic-gate */
257c478bdstevel@tonic-gate
267c478bdstevel@tonic-gate#ifndef _SYS_NDI_IMPLDEFS_H
277c478bdstevel@tonic-gate#define	_SYS_NDI_IMPLDEFS_H
287c478bdstevel@tonic-gate
297c478bdstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bdstevel@tonic-gate
317c478bdstevel@tonic-gate#include <sys/types.h>
327c478bdstevel@tonic-gate#include <sys/param.h>
337c478bdstevel@tonic-gate#include <sys/t_lock.h>
347c478bdstevel@tonic-gate#include <sys/ddipropdefs.h>
357c478bdstevel@tonic-gate#include <sys/devops.h>
367c478bdstevel@tonic-gate#include <sys/autoconf.h>
377c478bdstevel@tonic-gate#include <sys/mutex.h>
387c478bdstevel@tonic-gate#include <vm/page.h>
397c478bdstevel@tonic-gate#include <sys/ddi_impldefs.h>
407c478bdstevel@tonic-gate
417c478bdstevel@tonic-gate#ifdef	__cplusplus
427c478bdstevel@tonic-gateextern "C" {
437c478bdstevel@tonic-gate#endif
447c478bdstevel@tonic-gate
457c478bdstevel@tonic-gate/* event handle for callback management */
467c478bdstevel@tonic-gatestruct ndi_event_hdl {
477c478bdstevel@tonic-gate	dev_info_t		*ndi_evthdl_dip;
487c478bdstevel@tonic-gate
497c478bdstevel@tonic-gate	/*
507c478bdstevel@tonic-gate	 * mutex that protect the handle and event defs
517c478bdstevel@tonic-gate	 */
527c478bdstevel@tonic-gate	kmutex_t		ndi_evthdl_mutex;
537c478bdstevel@tonic-gate
547c478bdstevel@tonic-gate	/*
557c478bdstevel@tonic-gate	 * mutex that just protects the callback list
567c478bdstevel@tonic-gate	 */
577c478bdstevel@tonic-gate	kmutex_t		ndi_evthdl_cb_mutex;
587c478bdstevel@tonic-gate
597c478bdstevel@tonic-gate	ddi_iblock_cookie_t	ndi_evthdl_iblock_cookie;
607c478bdstevel@tonic-gate
617c478bdstevel@tonic-gate	uint_t			ndi_evthdl_high_plevels;
627c478bdstevel@tonic-gate	uint_t			ndi_evthdl_other_plevels;
637c478bdstevel@tonic-gate
647c478bdstevel@tonic-gate	uint_t			ndi_evthdl_n_events;
657c478bdstevel@tonic-gate	ndi_event_cookie_t 	*ndi_evthdl_cookie_list;
667c478bdstevel@tonic-gate	ndi_event_hdl_t 	ndi_next_hdl;
677c478bdstevel@tonic-gate};
687c478bdstevel@tonic-gate
697c478bdstevel@tonic-gate/* prototypes needed by sunndi.c */
707c478bdstevel@tonic-gateint ddi_prop_fm_encode_bytes(prop_handle_t *, void *data, uint_t);
717c478bdstevel@tonic-gate
727c478bdstevel@tonic-gateint ddi_prop_fm_encode_ints(prop_handle_t *, void *data, uint_t);
737c478bdstevel@tonic-gate
747c478bdstevel@tonic-gateint ddi_prop_fm_encode_int64(prop_handle_t *, void *data, uint_t);
757c478bdstevel@tonic-gate
767c478bdstevel@tonic-gateint ddi_prop_int64_op(prop_handle_t *, uint_t, int64_t *);
777c478bdstevel@tonic-gate
787c478bdstevel@tonic-gateint ddi_prop_update_common(dev_t, dev_info_t *, int, char *, void *, uint_t,
797c478bdstevel@tonic-gate    int (*)(prop_handle_t *, void *, uint_t));
807c478bdstevel@tonic-gate
817c478bdstevel@tonic-gateint ddi_prop_lookup_common(dev_t, dev_info_t *, uint_t, char *, void *,
827c478bdstevel@tonic-gate    uint_t *, int (*)(prop_handle_t *, void *, uint_t *));
837c478bdstevel@tonic-gate
847c478bdstevel@tonic-gateint ddi_prop_remove_common(dev_t, dev_info_t *, char *, int);
857c478bdstevel@tonic-gatevoid ddi_prop_remove_all_common(dev_info_t *, int);
867c478bdstevel@tonic-gate
877c478bdstevel@tonic-gateint ddi_prop_fm_encode_string(prop_handle_t *, void *, uint_t);
887c478bdstevel@tonic-gate
897c478bdstevel@tonic-gateint ddi_prop_fm_encode_strings(prop_handle_t *, void *, uint_t);
907c478bdstevel@tonic-gateint ddi_prop_fm_decode_strings(prop_handle_t *, void *, uint_t *);
917c478bdstevel@tonic-gate
927c478bdstevel@tonic-gate/*
937c478bdstevel@tonic-gate * Internal configuration routines
947c478bdstevel@tonic-gate */
957c478bdstevel@tonic-gateint i_ndi_config_node(dev_info_t *, ddi_node_state_t, uint_t);
967c478bdstevel@tonic-gateint i_ndi_unconfig_node(dev_info_t *, ddi_node_state_t, uint_t);
977c478bdstevel@tonic-gate
987c478bdstevel@tonic-gate/*
997c478bdstevel@tonic-gate * Obsolete interface, no longer used, to be removed.
1007c478bdstevel@tonic-gate * Retained only for driver compatibility.
1017c478bdstevel@tonic-gate */
1027c478bdstevel@tonic-gatevoid i_ndi_block_device_tree_changes(uint_t *);		/* obsolete */
1037c478bdstevel@tonic-gatevoid i_ndi_allow_device_tree_changes(uint_t);		/* obsolete */
1047c478bdstevel@tonic-gate
1057c478bdstevel@tonic-gate/*
1067c478bdstevel@tonic-gate * ndi_dev_is_auto_assigned_node: Return non-zero if the nodeid in dev
1077c478bdstevel@tonic-gate * has been auto-assigned by the framework and should be auto-freed.
1087c478bdstevel@tonic-gate * (Intended for use by the framework only.)
1097c478bdstevel@tonic-gate */
1107c478bdstevel@tonic-gateint i_ndi_dev_is_auto_assigned_node(dev_info_t *);
1117c478bdstevel@tonic-gate
1127c478bdstevel@tonic-gate/*
1137c478bdstevel@tonic-gate * Get and set nodeclass and node attributes.
1147c478bdstevel@tonic-gate * (Intended for ddi framework use only.)
1157c478bdstevel@tonic-gate */
1167c478bdstevel@tonic-gateddi_node_class_t i_ndi_get_node_class(dev_info_t *);
1177c478bdstevel@tonic-gatevoid i_ndi_set_node_class(dev_info_t *, ddi_node_class_t);
1187c478bdstevel@tonic-gate
1197c478bdstevel@tonic-gateint i_ndi_get_node_attributes(dev_info_t *);
1207c478bdstevel@tonic-gatevoid i_ndi_set_node_attributes(dev_info_t *, int);
1217c478bdstevel@tonic-gate
1227c478bdstevel@tonic-gate/*
1237c478bdstevel@tonic-gate * Set nodeid .. not generally advisable.
1247c478bdstevel@tonic-gate * (Intended for the ddi framework use only.)
1257c478bdstevel@tonic-gate */
1267c478bdstevel@tonic-gatevoid i_ndi_set_nodeid(dev_info_t *, int);
1277c478bdstevel@tonic-gate
128f4da9becth/*
129f4da9becth * Make driver.conf children.
130f4da9becth * (Intended for the ddi framework use only.)
131f4da9becth */
132f4da9becthint i_ndi_make_spec_children(dev_info_t *, uint_t);
133f4da9becth
1347c478bdstevel@tonic-gate#ifdef	__cplusplus
1357c478bdstevel@tonic-gate}
1367c478bdstevel@tonic-gate#endif
1377c478bdstevel@tonic-gate
1387c478bdstevel@tonic-gate#endif	/* _SYS_NDI_IMPLDEFS_H */
139