xref: /onnv-gate/usr/src/uts/common/sys/devinfo_impl.h (revision 7224:19ff3ecd90c2)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
54444Svikram  * Common Development and Distribution License (the "License").
64444Svikram  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
226640Scth  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_SYS_DEVINFO_IMPL_H
270Sstevel@tonic-gate #define	_SYS_DEVINFO_IMPL_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate /*
320Sstevel@tonic-gate  * This file is separate from libdevinfo.h because the devinfo driver
330Sstevel@tonic-gate  * needs to know about the stuff. Library consumer should not care
340Sstevel@tonic-gate  * about stuff defined here.
350Sstevel@tonic-gate  *
360Sstevel@tonic-gate  * The only exception is di_priv_data (consolidation private) and
370Sstevel@tonic-gate  * DINFO* ioctls.
380Sstevel@tonic-gate  */
390Sstevel@tonic-gate 
400Sstevel@tonic-gate #ifdef	__cplusplus
410Sstevel@tonic-gate extern "C" {
420Sstevel@tonic-gate #endif
430Sstevel@tonic-gate 
440Sstevel@tonic-gate /* ioctl commands for devinfo driver */
450Sstevel@tonic-gate 
460Sstevel@tonic-gate #define	DIIOC		(0xdf<<8)
470Sstevel@tonic-gate #define	DIIOC_MASK	(0xffff00ff)
480Sstevel@tonic-gate 
490Sstevel@tonic-gate /*
500Sstevel@tonic-gate  * Any combination of the following ORed together will take a snapshot
510Sstevel@tonic-gate  * of the device configuration data.
520Sstevel@tonic-gate  */
530Sstevel@tonic-gate #define	DINFOSUBTREE	(DIIOC | 0x01)	/* include subtree */
540Sstevel@tonic-gate #define	DINFOMINOR	(DIIOC | 0x02)	/* include minor data */
550Sstevel@tonic-gate #define	DINFOPROP	(DIIOC | 0x04)	/* include properties */
566640Scth #define	DINFOPATH	(DIIOC | 0x08)	/* include i/o pathing information */
570Sstevel@tonic-gate 
580Sstevel@tonic-gate /* private bits */
590Sstevel@tonic-gate #define	DINFOPRIVDATA	(DIIOC | 0x10)	/* include private data */
600Sstevel@tonic-gate #define	DINFOFORCE	(DIIOC | 0x20)	/* force load all drivers */
610Sstevel@tonic-gate #define	DINFOCACHE	(DIIOC | 0x100000) /* use cached data  */
62878Sramat #define	DINFOCLEANUP	(DIIOC | 0x200000) /* cleanup /etc/devices files */
630Sstevel@tonic-gate 
640Sstevel@tonic-gate /* new public flag for the layered drivers framework */
650Sstevel@tonic-gate #define	DINFOLYR	(DIIOC | 0x40)	/* get device layering information */
660Sstevel@tonic-gate 
670Sstevel@tonic-gate /*
680Sstevel@tonic-gate  * Straight ioctl commands, not bitwise operation
690Sstevel@tonic-gate  */
700Sstevel@tonic-gate #define	DINFOUSRLD	(DIIOC | 0x80)	/* copy snapshot to usrland */
710Sstevel@tonic-gate #define	DINFOLODRV	(DIIOC | 0x81)	/* force load a driver */
720Sstevel@tonic-gate #define	DINFOIDENT	(DIIOC | 0x82)	/* identify the driver */
730Sstevel@tonic-gate 
740Sstevel@tonic-gate /*
750Sstevel@tonic-gate  * ioctl for taking a snapshot a single node and all nodes
760Sstevel@tonic-gate  */
770Sstevel@tonic-gate #define	DINFOCPYONE	DIIOC
780Sstevel@tonic-gate #define	DINFOCPYALL	(DINFOSUBTREE | DINFOPROP | DINFOMINOR)
790Sstevel@tonic-gate 
800Sstevel@tonic-gate #define	DI_MAGIC	0xdfdf	/* magic number returned by DINFOIDENT */
810Sstevel@tonic-gate 
820Sstevel@tonic-gate /* driver ops encoding */
830Sstevel@tonic-gate 
840Sstevel@tonic-gate #define	DI_BUS_OPS	0x1
850Sstevel@tonic-gate #define	DI_CB_OPS	0x2
860Sstevel@tonic-gate #define	DI_STREAM_OPS	0x4
870Sstevel@tonic-gate 
880Sstevel@tonic-gate /* property list enumeration */
890Sstevel@tonic-gate 
900Sstevel@tonic-gate #define	DI_PROP_DRV_LIST	0
910Sstevel@tonic-gate #define	DI_PROP_SYS_LIST	1
920Sstevel@tonic-gate #define	DI_PROP_GLB_LIST	2
930Sstevel@tonic-gate #define	DI_PROP_HW_LIST		3
940Sstevel@tonic-gate 
950Sstevel@tonic-gate /* misc parameters */
960Sstevel@tonic-gate 
970Sstevel@tonic-gate #define	MAX_TREE_DEPTH	64
980Sstevel@tonic-gate #define	MAX_PTR_IN_PRV	5
990Sstevel@tonic-gate #define	DI_SNAPSHOT_VERSION_0	0	/* reserved */
100893Srs135747 #define	DI_SNAPSHOT_VERSION_1	1	/* reserved */
1014444Svikram #define	DI_SNAPSHOT_VERSION_2	2	/* reserved */
1024444Svikram #define	DI_SNAPSHOT_VERSION	DI_SNAPSHOT_VERSION_2	/* current version */
1030Sstevel@tonic-gate #define	DI_PRIVDATA_VERSION_0	10	/* Start from 10 so caller must set */
1040Sstevel@tonic-gate #define	DI_BIG_ENDIAN		0	/* reserved */
1050Sstevel@tonic-gate #define	DI_LITTLE_ENDIAN	1	/* reserved */
1060Sstevel@tonic-gate 
1070Sstevel@tonic-gate #define	DI_CACHE_MAGIC		0xdfcac6ed	/* magic # for cache */
1080Sstevel@tonic-gate #define	DI_CACHE_PERMS		(0444)
109893Srs135747 #define	DI_CACHE_SNAPSHOT_FLAGS	\
110893Srs135747 	(DINFOFORCE|DINFOSUBTREE|DINFOMINOR|DINFOPROP|DINFOPATH)
1110Sstevel@tonic-gate 
1120Sstevel@tonic-gate #define	DI_NODE(addr)		((struct di_node *)((void *)(addr)))
1130Sstevel@tonic-gate #define	DI_MINOR(addr)		((struct di_minor *)((void *)(addr)))
1140Sstevel@tonic-gate #define	DI_PROP(addr)		((struct di_prop *)((void *)(addr)))
1150Sstevel@tonic-gate #define	DI_PATH(addr)		((struct di_path *)((void *)(addr)))
1160Sstevel@tonic-gate #define	DI_PATHPROP(addr)	((struct di_path_prop *)((void *)(addr)))
1170Sstevel@tonic-gate #define	DI_ALL(addr)		((struct di_all *)((void *)(addr)))
1180Sstevel@tonic-gate #define	DI_DEVNM(addr)		((struct di_devnm *)((void *)(addr)))
1190Sstevel@tonic-gate #define	DI_LINK(addr)		((struct di_link *)((void *)(addr)))
1200Sstevel@tonic-gate #define	DI_LNODE(addr)		((struct di_lnode *)((void *)(addr)))
121*7224Scth #define	DI_PRIV_FORMAT(addr)	((struct di_priv_format *)((void *)(addr)))
1220Sstevel@tonic-gate 
123893Srs135747 /*
124893Srs135747  * multipath component definitions:  Follows the registered component of
125893Srs135747  * the mpxio system.
126893Srs135747  */
127893Srs135747 #define	MULTIPATH_COMPONENT_NONE	0
128893Srs135747 #define	MULTIPATH_COMPONENT_VHCI	0x1
129893Srs135747 #define	MULTIPATH_COMPONENT_PHCI	0x2
130893Srs135747 #define	MULTIPATH_COMPONENT_CLIENT	0x4
131893Srs135747 
1320Sstevel@tonic-gate typedef int32_t di_off_t;
1330Sstevel@tonic-gate 
1340Sstevel@tonic-gate /*
1350Sstevel@tonic-gate  * devinfo driver snapshot data structure
1360Sstevel@tonic-gate  */
1370Sstevel@tonic-gate struct di_all {
1380Sstevel@tonic-gate 	int	version;	/* snapshot version, reserved */
1390Sstevel@tonic-gate 	int	cache_magic;	/* magic number for cached snapshot */
1400Sstevel@tonic-gate 	int	pd_version;	/* private data format version */
1410Sstevel@tonic-gate 	int	endianness;	/* reserved for future use */
1420Sstevel@tonic-gate 	int	generation;	/* reserved for future use */
1430Sstevel@tonic-gate 	uint32_t	cache_checksum;	/* snapshot checksum */
1440Sstevel@tonic-gate 	uint64_t	snapshot_time;	/* snapshot timestamp */
1450Sstevel@tonic-gate 	di_off_t	top_devinfo;
146893Srs135747 	di_off_t	top_vhci_devinfo;
1470Sstevel@tonic-gate 	di_off_t	devnames;
1480Sstevel@tonic-gate 	di_off_t	ppdata_format;	/* parent priv data format array */
1490Sstevel@tonic-gate 	di_off_t	dpdata_format;	/* driver priv data format array */
1500Sstevel@tonic-gate 	int	n_ppdata;	/* size of ppdata_format array */
1510Sstevel@tonic-gate 	int	n_dpdata;	/* size of pddata_format array */
1520Sstevel@tonic-gate 	int	devcnt;		/* size of devnames array */
1530Sstevel@tonic-gate 	uint_t	command;	/* same as in di_init() */
1540Sstevel@tonic-gate 	uint_t	map_size;	/* size of the snapshot */
1550Sstevel@tonic-gate 	char	root_path[1];	/* path to snapshot root */
1560Sstevel@tonic-gate };
1570Sstevel@tonic-gate 
1580Sstevel@tonic-gate struct di_devnm {
1590Sstevel@tonic-gate 	di_off_t name;
1600Sstevel@tonic-gate 	di_off_t global_prop;
1610Sstevel@tonic-gate 	di_off_t head;	/* head of per instance list */
1620Sstevel@tonic-gate 	int flags;	/* driver attachment info */
1630Sstevel@tonic-gate 	int instance;	/* next instance to assign */
1640Sstevel@tonic-gate 	uint_t ops;	/* bit-encoded driver ops */
1650Sstevel@tonic-gate };
1660Sstevel@tonic-gate 
1670Sstevel@tonic-gate 
1680Sstevel@tonic-gate struct di_lnode;
1690Sstevel@tonic-gate 
1700Sstevel@tonic-gate struct di_link {
1710Sstevel@tonic-gate 	di_off_t	self;
1720Sstevel@tonic-gate 	int		count;
1730Sstevel@tonic-gate 	int		spec_type;	/* block or char access type */
1740Sstevel@tonic-gate 	di_off_t	src_lnode;	/* src di_lnode */
1750Sstevel@tonic-gate 	di_off_t	tgt_lnode;	/* tgt di_lnode */
1760Sstevel@tonic-gate 	di_off_t	src_link_next;	/* next src di_link /w same di_lnode */
1770Sstevel@tonic-gate 	di_off_t	tgt_link_next;	/* next tgt di_link /w same di_lnode */
1780Sstevel@tonic-gate 	di_off_t	src_node_next;	/* next src di_link /w same di_node */
1790Sstevel@tonic-gate 	di_off_t	tgt_node_next;	/* next tgt di_link /w same di_node */
1800Sstevel@tonic-gate 	uint64_t 	user_private_data;
1810Sstevel@tonic-gate };
1820Sstevel@tonic-gate 
1830Sstevel@tonic-gate struct di_lnode {
1840Sstevel@tonic-gate 	di_off_t	self;
1850Sstevel@tonic-gate 
1860Sstevel@tonic-gate 	/*
1870Sstevel@tonic-gate 	 * public information describing a link endpoint
1880Sstevel@tonic-gate 	 */
1890Sstevel@tonic-gate 	major_t		dev_major;	/* dev_t can be 64-bit */
1900Sstevel@tonic-gate 	minor_t		dev_minor;	/* dev_t can be 64-bit */
1910Sstevel@tonic-gate 	di_off_t	node;		/* offset of di_node */
1920Sstevel@tonic-gate 
1930Sstevel@tonic-gate 	/*
1940Sstevel@tonic-gate 	 * di_link ptr to links comming into this node
1950Sstevel@tonic-gate 	 * (this lnode is the target of these di_links)
1960Sstevel@tonic-gate 	 */
1970Sstevel@tonic-gate 	di_off_t	link_in;
1980Sstevel@tonic-gate 
1990Sstevel@tonic-gate 	/*
2000Sstevel@tonic-gate 	 * di_link ptr to links going out of this node
2010Sstevel@tonic-gate 	 * (this lnode is the source of these di_links)
2020Sstevel@tonic-gate 	 */
2030Sstevel@tonic-gate 	di_off_t	link_out;
2040Sstevel@tonic-gate 
2050Sstevel@tonic-gate 	/*
2060Sstevel@tonic-gate 	 * di_lnode pointer to the next lnode associated with the
2070Sstevel@tonic-gate 	 * same di_node
2080Sstevel@tonic-gate 	 */
2090Sstevel@tonic-gate 	di_off_t	node_next;
2100Sstevel@tonic-gate 
2110Sstevel@tonic-gate 	uint64_t 	user_private_data;
2120Sstevel@tonic-gate };
2130Sstevel@tonic-gate 
2140Sstevel@tonic-gate struct di_node {	/* useful info to export for each tree node */
2150Sstevel@tonic-gate 	/*
2160Sstevel@tonic-gate 	 * offset to di_node structures
2170Sstevel@tonic-gate 	 */
2180Sstevel@tonic-gate 	di_off_t self;		/* make it self addressable */
2190Sstevel@tonic-gate 	di_off_t parent;	/* offset of parent node */
2200Sstevel@tonic-gate 	di_off_t child;		/* offset of child node */
2210Sstevel@tonic-gate 	di_off_t sibling;	/* offset of sibling */
2220Sstevel@tonic-gate 	di_off_t next;		/* next node on per-instance list */
2230Sstevel@tonic-gate 	/*
2240Sstevel@tonic-gate 	 * offset to char strings of current node
2250Sstevel@tonic-gate 	 */
2260Sstevel@tonic-gate 	di_off_t node_name;	/* offset of device node name */
2270Sstevel@tonic-gate 	di_off_t address;	/* offset of address part of name */
2280Sstevel@tonic-gate 	di_off_t bind_name;	/* offset of binding name */
2290Sstevel@tonic-gate 	di_off_t compat_names;	/* offset of compatible names */
2300Sstevel@tonic-gate 	/*
2310Sstevel@tonic-gate 	 * offset to property lists, private data, etc.
2320Sstevel@tonic-gate 	 */
2330Sstevel@tonic-gate 	di_off_t minor_data;
2340Sstevel@tonic-gate 	di_off_t drv_prop;
2350Sstevel@tonic-gate 	di_off_t sys_prop;
2360Sstevel@tonic-gate 	di_off_t glob_prop;
2370Sstevel@tonic-gate 	di_off_t hw_prop;
2380Sstevel@tonic-gate 	di_off_t parent_data;
2390Sstevel@tonic-gate 	di_off_t driver_data;
2400Sstevel@tonic-gate 	di_off_t multipath_client;
2410Sstevel@tonic-gate 	di_off_t multipath_phci;
2420Sstevel@tonic-gate 	di_off_t devid;		/* registered device id */
2430Sstevel@tonic-gate 	di_off_t pm_info;	/* RESERVED FOR FUTURE USE */
2440Sstevel@tonic-gate 	/*
2450Sstevel@tonic-gate 	 * misc values
2460Sstevel@tonic-gate 	 */
2470Sstevel@tonic-gate 	int compat_length;	/* size of compatible name list */
2480Sstevel@tonic-gate 	int drv_major;		/* for indexing into devnames array */
2490Sstevel@tonic-gate 	/*
2500Sstevel@tonic-gate 	 * value attributes of current node
2510Sstevel@tonic-gate 	 */
2520Sstevel@tonic-gate 	int instance;		/* instance number */
2530Sstevel@tonic-gate 	int nodeid;		/* node id */
2540Sstevel@tonic-gate 	ddi_node_class_t node_class;	/* node class */
2550Sstevel@tonic-gate 	int attributes;		/* node attributes */
2560Sstevel@tonic-gate 	uint_t state;		/* hotplugging device state */
2570Sstevel@tonic-gate 	ddi_node_state_t node_state;	/* devinfo state */
2580Sstevel@tonic-gate 
2590Sstevel@tonic-gate 	di_off_t lnodes;	/* lnodes associated with this di_node */
2600Sstevel@tonic-gate 	di_off_t tgt_links;
2610Sstevel@tonic-gate 	di_off_t src_links;
2620Sstevel@tonic-gate 
263893Srs135747 	uint32_t di_pad1;	/* 4 byte padding for 32bit x86 app. */
264893Srs135747 	uint64_t user_private_data;
265893Srs135747 	/*
266893Srs135747 	 * offset to link vhci/phci nodes.
267893Srs135747 	 */
268893Srs135747 	di_off_t next_vhci;
269893Srs135747 	di_off_t top_phci;
270893Srs135747 	di_off_t next_phci;
271893Srs135747 	uint32_t multipath_component;	/* stores MDI_COMPONENT_* value. */
2724444Svikram 
2734444Svikram 	/*
2744444Svikram 	 * devi_flags field
2754444Svikram 	 */
2764444Svikram 	uint32_t flags;
2774444Svikram 	uint32_t di_pad2;	/* 4 byte padding for 32bit x86 app. */
2780Sstevel@tonic-gate };
2790Sstevel@tonic-gate 
2800Sstevel@tonic-gate /*
2810Sstevel@tonic-gate  * chain of ddi_minor_data structure
2820Sstevel@tonic-gate  */
2830Sstevel@tonic-gate struct di_minor {
2840Sstevel@tonic-gate 	di_off_t	self;		/* make it self addressable */
2850Sstevel@tonic-gate 	di_off_t	next;		/* next one in the chain */
2860Sstevel@tonic-gate 	di_off_t	name;		/* name of node */
2870Sstevel@tonic-gate 	di_off_t	node_type;	/* block, byte, serial, network */
2880Sstevel@tonic-gate 	ddi_minor_type	type;		/* data type */
2890Sstevel@tonic-gate 	major_t		dev_major;	/* dev_t can be 64-bit */
2900Sstevel@tonic-gate 	minor_t		dev_minor;
2910Sstevel@tonic-gate 	int		spec_type;	/* block or char */
2920Sstevel@tonic-gate 	unsigned int	mdclass;	/* no longer used, may be removed */
2930Sstevel@tonic-gate 	di_off_t	node;		/* address of di_node */
2940Sstevel@tonic-gate 	uint64_t 	user_private_data;
2950Sstevel@tonic-gate };
2960Sstevel@tonic-gate 
2970Sstevel@tonic-gate typedef enum {
2980Sstevel@tonic-gate 	DI_PATH_STATE_UNKNOWN,
2990Sstevel@tonic-gate 	DI_PATH_STATE_OFFLINE,
3000Sstevel@tonic-gate 	DI_PATH_STATE_STANDBY,
3010Sstevel@tonic-gate 	DI_PATH_STATE_ONLINE,
3020Sstevel@tonic-gate 	DI_PATH_STATE_FAULT
3030Sstevel@tonic-gate } di_path_state_t;
3040Sstevel@tonic-gate 
3050Sstevel@tonic-gate /*
3060Sstevel@tonic-gate  * multipathing information structures
3070Sstevel@tonic-gate  */
3080Sstevel@tonic-gate struct di_path {
3090Sstevel@tonic-gate 	di_off_t	self;		/* make it self addressable */
3100Sstevel@tonic-gate 	di_off_t	path_c_link;	/* next pathinfo via client linkage */
3110Sstevel@tonic-gate 	di_off_t	path_p_link;	/* next pathinfo via phci linkage */
3120Sstevel@tonic-gate 	di_off_t	path_client;	/* reference to client node */
3130Sstevel@tonic-gate 	di_off_t	path_phci;	/* reference to phci node */
3140Sstevel@tonic-gate 	di_off_t	path_prop;	/* property list */
3150Sstevel@tonic-gate 	di_off_t	path_addr;	/* path addressing information */
3160Sstevel@tonic-gate 	di_path_state_t path_state;	/* path state */
3176640Scth 	uint_t		path_snap_state; /* describes valid fields */
3186640Scth 	int		path_instance;	/* path instance */
3196640Scth 	uint64_t 	user_private_data;
3200Sstevel@tonic-gate };
3210Sstevel@tonic-gate 
3220Sstevel@tonic-gate /*
3230Sstevel@tonic-gate  * Flags for snap_state
3240Sstevel@tonic-gate  */
3250Sstevel@tonic-gate #define	DI_PATH_SNAP_NOCLIENT	0x01	/* client endpt not in snapshot */
3260Sstevel@tonic-gate #define	DI_PATH_SNAP_NOPHCI	0x02	/* phci endpt not in snapshot */
3270Sstevel@tonic-gate #define	DI_PATH_SNAP_ENDPTS	0x04	/* Endpoints have been postprocessed */
3280Sstevel@tonic-gate 
3290Sstevel@tonic-gate #define	DI_PATH_SNAP_NOCLINK	0x10	/* client linkage not in snapshot */
3300Sstevel@tonic-gate #define	DI_PATH_SNAP_NOPLINK	0x20	/* phci linkage not in snapshot */
3310Sstevel@tonic-gate #define	DI_PATH_SNAP_LINKS	0x40	/* linkages have been postprocessed */
3320Sstevel@tonic-gate 
3330Sstevel@tonic-gate /*
3340Sstevel@tonic-gate  * path properties
3350Sstevel@tonic-gate  */
3360Sstevel@tonic-gate struct di_path_prop {
3370Sstevel@tonic-gate 	di_off_t	self;		/* make it self addressable */
3380Sstevel@tonic-gate 	di_off_t	prop_next;	/* next property linkage */
3390Sstevel@tonic-gate 	di_off_t	prop_name;	/* property name */
3400Sstevel@tonic-gate 	di_off_t	prop_data;	/* property data */
3410Sstevel@tonic-gate 	int		prop_type;	/* property data type */
3420Sstevel@tonic-gate 	int		prop_len;	/* prop length in bytes */
3430Sstevel@tonic-gate };
3440Sstevel@tonic-gate 
3450Sstevel@tonic-gate /*
3460Sstevel@tonic-gate  * Now the properties.
3470Sstevel@tonic-gate  */
3480Sstevel@tonic-gate struct di_prop {
3490Sstevel@tonic-gate 	di_off_t	self;		/* make it self addressable */
3500Sstevel@tonic-gate 	di_off_t	next;
3510Sstevel@tonic-gate 	di_off_t	prop_name;	/* Property name */
3520Sstevel@tonic-gate 	di_off_t	prop_data;	/* property data */
3530Sstevel@tonic-gate 	major_t		dev_major;	/* dev_t can be 64 bit */
3540Sstevel@tonic-gate 	minor_t		dev_minor;
355*7224Scth 	int		prop_flags;	/* mark prop value types & more */
356*7224Scth 	int		prop_len;	/* prop len in bytes (boolean if 0) */
357*7224Scth 	int		prop_list;	/* which list (DI_PROP_SYS_LIST), etc */
3580Sstevel@tonic-gate };
3590Sstevel@tonic-gate 
3600Sstevel@tonic-gate /*
3610Sstevel@tonic-gate  * Private data stuff for supporting prtconf.
3620Sstevel@tonic-gate  * Allows one level of indirection of fixed sized obj or obj array.
3630Sstevel@tonic-gate  * The array size may be an int member of the array.
3640Sstevel@tonic-gate  */
3650Sstevel@tonic-gate 
3660Sstevel@tonic-gate struct di_priv_format {
3670Sstevel@tonic-gate 	char drv_name[MAXPATHLEN];	/* name of parent drv for ppdata */
3680Sstevel@tonic-gate 	size_t bytes;			/* size in bytes of this struct */
3690Sstevel@tonic-gate 	struct {			/* ptrs to dereference */
3700Sstevel@tonic-gate 		int size;	/* size of object assoc. this ptr */
3710Sstevel@tonic-gate 		int offset;	/* location of pointer within struct */
3720Sstevel@tonic-gate 		int len_offset;	/* offset to var. containing the len */
3730Sstevel@tonic-gate 	} ptr[MAX_PTR_IN_PRV];
3740Sstevel@tonic-gate };
3750Sstevel@tonic-gate 
3760Sstevel@tonic-gate struct di_priv_data {
3770Sstevel@tonic-gate 	int version;
3780Sstevel@tonic-gate 	int n_parent;
3790Sstevel@tonic-gate 	int n_driver;
3800Sstevel@tonic-gate 	struct di_priv_format *parent;
3810Sstevel@tonic-gate 	struct di_priv_format *driver;
3820Sstevel@tonic-gate };
3830Sstevel@tonic-gate 
3840Sstevel@tonic-gate /*
3850Sstevel@tonic-gate  * structure passed in from ioctl
3860Sstevel@tonic-gate  */
3870Sstevel@tonic-gate struct dinfo_io {
3880Sstevel@tonic-gate 	char root_path[MAXPATHLEN];
3890Sstevel@tonic-gate 	struct di_priv_data priv;
3900Sstevel@tonic-gate };
3910Sstevel@tonic-gate 
3920Sstevel@tonic-gate #ifdef	__cplusplus
3930Sstevel@tonic-gate }
3940Sstevel@tonic-gate #endif
3950Sstevel@tonic-gate 
3960Sstevel@tonic-gate #endif	/* _SYS_DEVINFO_IMPL_H */
397