17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
53c4226f9Spjha  * Common Development and Distribution License (the "License").
63c4226f9Spjha  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*94c894bbSVikram Hegde  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate  */
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate #ifndef	_LIBDEVINFO_H
267c478bd9Sstevel@tonic-gate #define	_LIBDEVINFO_H
277c478bd9Sstevel@tonic-gate 
28facf4a8dSllai #ifdef	__cplusplus
29facf4a8dSllai extern "C" {
30facf4a8dSllai #endif
31facf4a8dSllai 
327c478bd9Sstevel@tonic-gate #include <errno.h>
33facf4a8dSllai #include <libnvpair.h>
347c478bd9Sstevel@tonic-gate #include <sys/param.h>
357c478bd9Sstevel@tonic-gate #include <sys/sunddi.h>
367c478bd9Sstevel@tonic-gate #include <sys/sunmdi.h>
377c478bd9Sstevel@tonic-gate #include <sys/openpromio.h>
387c478bd9Sstevel@tonic-gate #include <sys/ddi_impldefs.h>
397c478bd9Sstevel@tonic-gate #include <sys/devinfo_impl.h>
407c478bd9Sstevel@tonic-gate #include <limits.h>
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate /*
437c478bd9Sstevel@tonic-gate  * flags for di_walk_node
447c478bd9Sstevel@tonic-gate  */
457c478bd9Sstevel@tonic-gate #define	DI_WALK_CLDFIRST	0
467c478bd9Sstevel@tonic-gate #define	DI_WALK_SIBFIRST	1
477c478bd9Sstevel@tonic-gate #define	DI_WALK_LINKGEN		2
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate #define	DI_WALK_MASK		0xf
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate /*
527c478bd9Sstevel@tonic-gate  * flags for di_walk_link
537c478bd9Sstevel@tonic-gate  */
547c478bd9Sstevel@tonic-gate #define	DI_LINK_SRC		1
557c478bd9Sstevel@tonic-gate #define	DI_LINK_TGT		2
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate /*
587c478bd9Sstevel@tonic-gate  * return code for node_callback
597c478bd9Sstevel@tonic-gate  */
607c478bd9Sstevel@tonic-gate #define	DI_WALK_CONTINUE	0
617c478bd9Sstevel@tonic-gate #define	DI_WALK_PRUNESIB	-1
627c478bd9Sstevel@tonic-gate #define	DI_WALK_PRUNECHILD	-2
637c478bd9Sstevel@tonic-gate #define	DI_WALK_TERMINATE	-3
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate /*
667c478bd9Sstevel@tonic-gate  * flags for di_walk_minor
677c478bd9Sstevel@tonic-gate  */
687c478bd9Sstevel@tonic-gate #define	DI_CHECK_ALIAS		0x10
697c478bd9Sstevel@tonic-gate #define	DI_CHECK_INTERNAL_PATH	0x20
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate #define	DI_CHECK_MASK		0xf0
727c478bd9Sstevel@tonic-gate 
7326947304SEvan Yan /*
7426947304SEvan Yan  * flags for di_walk_hp
7526947304SEvan Yan  */
7626947304SEvan Yan #define	DI_HP_CONNECTOR		0x1
7726947304SEvan Yan #define	DI_HP_PORT		0x2
7826947304SEvan Yan 
797c478bd9Sstevel@tonic-gate /* nodeid types */
807c478bd9Sstevel@tonic-gate #define	DI_PSEUDO_NODEID	-1
817c478bd9Sstevel@tonic-gate #define	DI_SID_NODEID		-2
827c478bd9Sstevel@tonic-gate #define	DI_PROM_NODEID		-3
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate /* node & device states */
857c478bd9Sstevel@tonic-gate #define	DI_DRIVER_DETACHED	0x8000
867c478bd9Sstevel@tonic-gate #define	DI_DEVICE_OFFLINE	0x1
877c478bd9Sstevel@tonic-gate #define	DI_DEVICE_DOWN		0x2
8825c6ff4bSstephh #define	DI_DEVICE_DEGRADED	0x4
894c06356bSdh #define	DI_DEVICE_REMOVED	0x8
907c478bd9Sstevel@tonic-gate #define	DI_BUS_QUIESCED		0x100
917c478bd9Sstevel@tonic-gate #define	DI_BUS_DOWN		0x200
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate /* property types */
947c478bd9Sstevel@tonic-gate #define	DI_PROP_TYPE_BOOLEAN	0
957c478bd9Sstevel@tonic-gate #define	DI_PROP_TYPE_INT	1
967c478bd9Sstevel@tonic-gate #define	DI_PROP_TYPE_STRING	2
977c478bd9Sstevel@tonic-gate #define	DI_PROP_TYPE_BYTE	3
987c478bd9Sstevel@tonic-gate #define	DI_PROP_TYPE_UNKNOWN	4
997c478bd9Sstevel@tonic-gate #define	DI_PROP_TYPE_UNDEF_IT	5
1007c478bd9Sstevel@tonic-gate #define	DI_PROP_TYPE_INT64	6
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate /* private macro for checking if a prop type is valid */
1037c478bd9Sstevel@tonic-gate #define	DI_PROP_TYPE_VALID(type) \
1047c478bd9Sstevel@tonic-gate 	((((type) >= DI_PROP_TYPE_INT) && ((type) <= DI_PROP_TYPE_BYTE)) || \
1057c478bd9Sstevel@tonic-gate 	    ((type) == DI_PROP_TYPE_INT64))
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate /* opaque handles */
108602ca9eaScth typedef struct di_node		*di_node_t;		/* node */
109602ca9eaScth typedef struct di_minor		*di_minor_t;		/* minor_node */
110602ca9eaScth typedef struct di_path		*di_path_t;		/* path_node */
111602ca9eaScth typedef struct di_link		*di_link_t;		/* link */
112602ca9eaScth typedef struct di_lnode		*di_lnode_t;		/* endpoint */
113602ca9eaScth typedef struct di_devlink	*di_devlink_t;		/* devlink */
11426947304SEvan Yan typedef struct di_hp		*di_hp_t;		/* hotplug */
115602ca9eaScth 
116602ca9eaScth typedef struct di_prop		*di_prop_t;		/* node property */
117602ca9eaScth typedef struct di_path_prop	*di_path_prop_t;	/* path property */
118602ca9eaScth typedef struct di_prom_prop	*di_prom_prop_t;	/* prom property */
119602ca9eaScth 
120602ca9eaScth typedef struct di_prom_handle	*di_prom_handle_t;	/* prom snapshot */
1217c478bd9Sstevel@tonic-gate typedef struct di_devlink_handle *di_devlink_handle_t;	/* devlink snapshot */
122602ca9eaScth 
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate /*
1257c478bd9Sstevel@tonic-gate  * Null handles to make handles really opaque
1267c478bd9Sstevel@tonic-gate  */
127602ca9eaScth #define	DI_NODE_NIL		NULL
128602ca9eaScth #define	DI_MINOR_NIL		NULL
129602ca9eaScth #define	DI_PATH_NIL		NULL
130602ca9eaScth #define	DI_LINK_NIL		NULL
131602ca9eaScth #define	DI_LNODE_NIL		NULL
132602ca9eaScth #define	DI_PROP_NIL		NULL
1337c478bd9Sstevel@tonic-gate #define	DI_PROM_PROP_NIL	NULL
1347c478bd9Sstevel@tonic-gate #define	DI_PROM_HANDLE_NIL	NULL
13526947304SEvan Yan #define	DI_HP_NIL		NULL
1367c478bd9Sstevel@tonic-gate 
1373ebafc43Sjveta /*
1383ebafc43Sjveta  * IEEE 1275 properties and other standardized property names
1393ebafc43Sjveta  */
1403ebafc43Sjveta #define	DI_PROP_FIRST_CHAS	"first-in-chassis"
1413ebafc43Sjveta #define	DI_PROP_SLOT_NAMES	"slot-names"
1423ebafc43Sjveta #define	DI_PROP_PHYS_SLOT	"physical-slot#"
1433ebafc43Sjveta #define	DI_PROP_DEV_TYPE	"device_type"
1443ebafc43Sjveta #define	DI_PROP_BUS_RANGE	"bus-range"
1453ebafc43Sjveta #define	DI_PROP_SERID		"serialid#"
1463ebafc43Sjveta #define	DI_PROP_REG		"reg"
1473ebafc43Sjveta #define	DI_PROP_AP_NAMES	"ap-names"
1483ebafc43Sjveta 
1497c478bd9Sstevel@tonic-gate /* Interface Prototypes */
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate /*
1527c478bd9Sstevel@tonic-gate  * Snapshot initialization and cleanup
1537c478bd9Sstevel@tonic-gate  */
154602ca9eaScth extern di_node_t	di_init(const char *phys_path, uint_t flag);
155602ca9eaScth extern void		di_fini(di_node_t root);
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate /*
158602ca9eaScth  * node: traversal, data access, and parameters
1597c478bd9Sstevel@tonic-gate  */
160602ca9eaScth extern int		di_walk_node(di_node_t root, uint_t flag, void *arg,
161602ca9eaScth 			    int (*node_callback)(di_node_t node, void *arg));
162602ca9eaScth 
163602ca9eaScth extern di_node_t	di_drv_first_node(const char *drv_name, di_node_t root);
164602ca9eaScth extern di_node_t	di_drv_next_node(di_node_t node);
165602ca9eaScth 
166602ca9eaScth extern di_node_t	di_parent_node(di_node_t node);
167602ca9eaScth extern di_node_t	di_sibling_node(di_node_t node);
168602ca9eaScth extern di_node_t	di_child_node(di_node_t node);
169602ca9eaScth 
170602ca9eaScth extern char		*di_node_name(di_node_t node);
171602ca9eaScth extern char		*di_bus_addr(di_node_t node);
172602ca9eaScth extern char		*di_binding_name(di_node_t node);
173602ca9eaScth extern int		di_compatible_names(di_node_t, char **names);
174602ca9eaScth extern int		di_instance(di_node_t node);
175602ca9eaScth extern int		di_nodeid(di_node_t node);
176602ca9eaScth extern int		di_driver_major(di_node_t node);
177602ca9eaScth extern uint_t		di_state(di_node_t node);
178602ca9eaScth extern ddi_node_state_t	di_node_state(di_node_t node);
179602ca9eaScth extern ddi_devid_t	di_devid(di_node_t node);
180602ca9eaScth extern char		*di_driver_name(di_node_t node);
181602ca9eaScth extern uint_t		di_driver_ops(di_node_t node);
182602ca9eaScth 
183602ca9eaScth extern void		di_node_private_set(di_node_t node, void *data);
184602ca9eaScth extern void		*di_node_private_get(di_node_t node);
185602ca9eaScth 
186602ca9eaScth extern char		*di_devfs_path(di_node_t node);
187602ca9eaScth extern char		*di_devfs_minor_path(di_minor_t minor);
188602ca9eaScth extern void		di_devfs_path_free(char *path_buf);
1897c478bd9Sstevel@tonic-gate 
1907c478bd9Sstevel@tonic-gate /*
191602ca9eaScth  * path_node: traversal, data access, and parameters
1927c478bd9Sstevel@tonic-gate  */
193602ca9eaScth extern di_path_t	di_path_phci_next_path(di_node_t node, di_path_t);
194602ca9eaScth extern di_path_t	di_path_client_next_path(di_node_t node, di_path_t);
1957c478bd9Sstevel@tonic-gate 
196602ca9eaScth extern di_node_t	di_path_phci_node(di_path_t path);
197602ca9eaScth extern di_node_t	di_path_client_node(di_path_t path);
1987c478bd9Sstevel@tonic-gate 
199602ca9eaScth extern char		*di_path_node_name(di_path_t path);
200602ca9eaScth extern char		*di_path_bus_addr(di_path_t path);
201602ca9eaScth extern int		di_path_instance(di_path_t path);
202602ca9eaScth extern di_path_state_t	di_path_state(di_path_t path);
2034c06356bSdh extern uint_t		di_path_flags(di_path_t path);
2047c478bd9Sstevel@tonic-gate 
205602ca9eaScth extern char		*di_path_devfs_path(di_path_t path);
206602ca9eaScth extern char		*di_path_client_devfs_path(di_path_t path);
2077c478bd9Sstevel@tonic-gate 
208602ca9eaScth extern void		di_path_private_set(di_path_t path, void *data);
209602ca9eaScth extern void		*di_path_private_get(di_path_t path);
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate /*
212602ca9eaScth  * minor_node: traversal, data access, and parameters
2137c478bd9Sstevel@tonic-gate  */
214602ca9eaScth extern int		di_walk_minor(di_node_t root, const char *minortype,
215602ca9eaScth 			    uint_t flag, void *arg,
216602ca9eaScth 			    int (*minor_callback)(di_node_t node,
217602ca9eaScth 			    di_minor_t minor, void *arg));
2187c478bd9Sstevel@tonic-gate extern di_minor_t	di_minor_next(di_node_t node, di_minor_t minor);
219602ca9eaScth 
2207c478bd9Sstevel@tonic-gate extern di_node_t	di_minor_devinfo(di_minor_t minor);
2217c478bd9Sstevel@tonic-gate extern ddi_minor_type	di_minor_type(di_minor_t minor);
2227c478bd9Sstevel@tonic-gate extern char		*di_minor_name(di_minor_t minor);
2237c478bd9Sstevel@tonic-gate extern dev_t		di_minor_devt(di_minor_t minor);
2247c478bd9Sstevel@tonic-gate extern int		di_minor_spectype(di_minor_t minor);
2257c478bd9Sstevel@tonic-gate extern char		*di_minor_nodetype(di_minor_t node);
2267c478bd9Sstevel@tonic-gate 
227602ca9eaScth extern void		di_minor_private_set(di_minor_t minor, void *data);
228602ca9eaScth extern void		*di_minor_private_get(di_minor_t minor);
229602ca9eaScth 
2307c478bd9Sstevel@tonic-gate /*
231602ca9eaScth  * node: property access
2327c478bd9Sstevel@tonic-gate  */
233602ca9eaScth extern di_prop_t	di_prop_next(di_node_t node, di_prop_t prop);
234602ca9eaScth 
235602ca9eaScth extern char		*di_prop_name(di_prop_t prop);
236602ca9eaScth extern int		di_prop_type(di_prop_t prop);
237602ca9eaScth extern dev_t		di_prop_devt(di_prop_t prop);
238602ca9eaScth 
239602ca9eaScth extern int		di_prop_ints(di_prop_t prop, int **prop_data);
240602ca9eaScth extern int		di_prop_int64(di_prop_t prop, int64_t **prop_data);
241602ca9eaScth extern int		di_prop_strings(di_prop_t prop, char **prop_data);
242602ca9eaScth extern int		di_prop_bytes(di_prop_t prop, uchar_t **prop_data);
243602ca9eaScth 
244602ca9eaScth extern int		di_prop_lookup_bytes(dev_t dev, di_node_t node,
245602ca9eaScth 			    const char *prop_name, uchar_t **prop_data);
246602ca9eaScth extern int		di_prop_lookup_ints(dev_t dev, di_node_t node,
247602ca9eaScth 			    const char *prop_name, int **prop_data);
248602ca9eaScth extern int		di_prop_lookup_int64(dev_t dev, di_node_t node,
249602ca9eaScth 			    const char *prop_name, int64_t **prop_data);
250602ca9eaScth extern int		di_prop_lookup_strings(dev_t dev, di_node_t node,
251602ca9eaScth 			    const char *prop_name, char **prop_data);
2527c478bd9Sstevel@tonic-gate 
2537c478bd9Sstevel@tonic-gate /*
254602ca9eaScth  * prom_node: property access
2557c478bd9Sstevel@tonic-gate  */
256602ca9eaScth extern di_prom_handle_t	di_prom_init(void);
257602ca9eaScth extern void		di_prom_fini(di_prom_handle_t ph);
258602ca9eaScth 
259602ca9eaScth extern di_prom_prop_t	di_prom_prop_next(di_prom_handle_t ph, di_node_t node,
260602ca9eaScth 			    di_prom_prop_t prom_prop);
261602ca9eaScth 
262602ca9eaScth extern char		*di_prom_prop_name(di_prom_prop_t prom_prop);
263602ca9eaScth extern int		di_prom_prop_data(di_prom_prop_t prop,
264602ca9eaScth 			    uchar_t **prom_prop_data);
265602ca9eaScth 
266602ca9eaScth extern int		di_prom_prop_lookup_ints(di_prom_handle_t prom,
267602ca9eaScth 			    di_node_t node, const char *prom_prop_name,
268602ca9eaScth 			    int **prom_prop_data);
269602ca9eaScth extern int		di_prom_prop_lookup_strings(di_prom_handle_t prom,
270602ca9eaScth 			    di_node_t node, const char *prom_prop_name,
271602ca9eaScth 			    char **prom_prop_data);
272602ca9eaScth extern int		di_prom_prop_lookup_bytes(di_prom_handle_t prom,
273602ca9eaScth 			    di_node_t node, const char *prom_prop_name,
274602ca9eaScth 			    uchar_t **prom_prop_data);
2757c478bd9Sstevel@tonic-gate 
276602ca9eaScth /*
277602ca9eaScth  * path_node: property access
278602ca9eaScth  */
279602ca9eaScth extern di_path_prop_t	di_path_prop_next(di_path_t path, di_path_prop_t prop);
280602ca9eaScth 
281602ca9eaScth extern char		*di_path_prop_name(di_path_prop_t prop);
282602ca9eaScth extern int		di_path_prop_type(di_path_prop_t prop);
283602ca9eaScth extern int		di_path_prop_len(di_path_prop_t prop);
284602ca9eaScth 
285602ca9eaScth extern int		di_path_prop_bytes(di_path_prop_t prop,
286602ca9eaScth 			    uchar_t **prop_data);
287602ca9eaScth extern int		di_path_prop_ints(di_path_prop_t prop,
288602ca9eaScth 			    int **prop_data);
289602ca9eaScth extern int		di_path_prop_int64s(di_path_prop_t prop,
290602ca9eaScth 			    int64_t **prop_data);
291602ca9eaScth extern int		di_path_prop_strings(di_path_prop_t prop,
292602ca9eaScth 			    char **prop_data);
293602ca9eaScth 
294602ca9eaScth extern int		di_path_prop_lookup_bytes(di_path_t path,
295602ca9eaScth 			    const char *prop_name, uchar_t **prop_data);
296602ca9eaScth extern int		di_path_prop_lookup_ints(di_path_t path,
297602ca9eaScth 			    const char *prop_name, int **prop_data);
298602ca9eaScth extern int		di_path_prop_lookup_int64s(di_path_t path,
299602ca9eaScth 			    const char *prop_name, int64_t **prop_data);
300602ca9eaScth extern int		di_path_prop_lookup_strings(di_path_t path,
301602ca9eaScth 			    const char *prop_name, char **prop_data);
3027c478bd9Sstevel@tonic-gate 
303602ca9eaScth /*
304602ca9eaScth  * layering link/lnode: traversal, data access, and parameters
305602ca9eaScth  */
306602ca9eaScth extern int		di_walk_link(di_node_t root, uint_t flag,
307602ca9eaScth 			    uint_t endpoint, void *arg,
308602ca9eaScth 			    int (*link_callback)(di_link_t link, void *arg));
309602ca9eaScth extern int		di_walk_lnode(di_node_t root, uint_t flag, void *arg,
310602ca9eaScth 			    int (*lnode_callback)(di_lnode_t lnode, void *arg));
311602ca9eaScth 
312602ca9eaScth extern di_link_t	di_link_next_by_node(di_node_t node,
313602ca9eaScth 			    di_link_t link, uint_t endpoint);
314602ca9eaScth extern di_link_t	di_link_next_by_lnode(di_lnode_t lnode,
315602ca9eaScth 			    di_link_t link, uint_t endpoint);
316602ca9eaScth extern di_lnode_t	di_lnode_next(di_node_t node, di_lnode_t lnode);
317602ca9eaScth extern char		*di_lnode_name(di_lnode_t lnode);
318602ca9eaScth 
319602ca9eaScth extern int		di_link_spectype(di_link_t link);
320602ca9eaScth extern di_lnode_t	di_link_to_lnode(di_link_t link, uint_t endpoint);
321602ca9eaScth 
322602ca9eaScth extern di_node_t	di_lnode_devinfo(di_lnode_t lnode);
323602ca9eaScth extern int		di_lnode_devt(di_lnode_t lnode, dev_t *devt);
324602ca9eaScth 
325602ca9eaScth extern void		di_link_private_set(di_link_t link, void *data);
326602ca9eaScth extern void		*di_link_private_get(di_link_t link);
327602ca9eaScth extern void		di_lnode_private_set(di_lnode_t lnode, void *data);
328602ca9eaScth extern void		*di_lnode_private_get(di_lnode_t lnode);
3297c478bd9Sstevel@tonic-gate 
33026947304SEvan Yan /*
33126947304SEvan Yan  * hp_node: traversal, data access, and parameters
33226947304SEvan Yan  */
33326947304SEvan Yan extern int		di_walk_hp(di_node_t node, const char *type,
33426947304SEvan Yan 			    uint_t flag, void *arg,
33526947304SEvan Yan 			    int (*hp_callback)(di_node_t node, di_hp_t hp,
33626947304SEvan Yan 			    void *arg));
33726947304SEvan Yan extern di_hp_t		di_hp_next(di_node_t node, di_hp_t hp);
33826947304SEvan Yan 
33926947304SEvan Yan extern char		*di_hp_name(di_hp_t hp);
34026947304SEvan Yan extern int		di_hp_connection(di_hp_t hp);
34126947304SEvan Yan extern int		di_hp_depends_on(di_hp_t hp);
34226947304SEvan Yan extern int		di_hp_state(di_hp_t hp);
34326947304SEvan Yan extern int		di_hp_type(di_hp_t hp);
34426947304SEvan Yan extern char		*di_hp_description(di_hp_t hp);
34526947304SEvan Yan extern time_t		di_hp_last_change(di_hp_t hp);
34626947304SEvan Yan extern di_node_t	di_hp_child(di_hp_t hp);
3477c478bd9Sstevel@tonic-gate 
3487c478bd9Sstevel@tonic-gate /*
3497c478bd9Sstevel@tonic-gate  * Private interfaces
3507c478bd9Sstevel@tonic-gate  *
3517c478bd9Sstevel@tonic-gate  * The interfaces and structures below are private to this implementation
3527c478bd9Sstevel@tonic-gate  * of Solaris and are subject to change at any time without notice.
3537c478bd9Sstevel@tonic-gate  *
354602ca9eaScth  * Applications and drivers using these interfaces may fail
3557c478bd9Sstevel@tonic-gate  * to run on future releases.
3567c478bd9Sstevel@tonic-gate  */
3573ebafc43Sjveta extern di_prop_t di_prop_find(dev_t match_dev, di_node_t node,
3583ebafc43Sjveta     const char *name);
359602ca9eaScth extern int di_devfs_path_match(const char *dp1, const char *dp2);
360602ca9eaScth 
361602ca9eaScth extern di_node_t	di_vhci_first_node(di_node_t root);
362602ca9eaScth extern di_node_t	di_vhci_next_node(di_node_t node);
363602ca9eaScth extern di_node_t	di_phci_first_node(di_node_t vhci_node);
364602ca9eaScth extern di_node_t	di_phci_next_node(di_node_t node);
3653ebafc43Sjveta 
3663ebafc43Sjveta /*
3673ebafc43Sjveta  * Interfaces for handling IEEE 1275 and other standardized properties
3683ebafc43Sjveta  */
3693ebafc43Sjveta 
3703ebafc43Sjveta /* structure for a single slot */
3713ebafc43Sjveta typedef struct di_slot_name {
3723ebafc43Sjveta 	int num;	/* corresponding pci device number */
3733ebafc43Sjveta 	char *name;
3743ebafc43Sjveta } di_slot_name_t;
3753ebafc43Sjveta 
3763ebafc43Sjveta extern void di_slot_names_free(int count, di_slot_name_t *slot_names);
3773ebafc43Sjveta extern int di_slot_names_decode(uchar_t *rawdata, int rawlen,
3783ebafc43Sjveta     di_slot_name_t **prop_data);
3793ebafc43Sjveta extern int di_prop_slot_names(di_prop_t prop, di_slot_name_t **prop_data);
3803ebafc43Sjveta extern int di_prom_prop_slot_names(di_prom_prop_t prom_prop,
3813ebafc43Sjveta     di_slot_name_t **prop_data);
3823ebafc43Sjveta extern int di_prop_lookup_slot_names(dev_t dev, di_node_t node,
3833ebafc43Sjveta     di_slot_name_t **prop_data);
3843ebafc43Sjveta extern int di_prom_prop_lookup_slot_names(di_prom_handle_t ph, di_node_t node,
3853ebafc43Sjveta     di_slot_name_t **prop_data);
3863ebafc43Sjveta 
3877c478bd9Sstevel@tonic-gate /*
388602ca9eaScth  * XXX Remove the private di_path_(addr,next,next_phci,next_client) interfaces
389602ca9eaScth  * below after NWS consolidation switches to using di_path_bus_addr,
390602ca9eaScth  * di_path_phci_next_path, and di_path_client_next_path per CR6638521.
3917c478bd9Sstevel@tonic-gate  */
392