xref: /onnv-gate/usr/src/uts/common/sys/devinfo_impl.h (revision 4444:558de447355b)
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
5*4444Svikram  * Common Development and Distribution License (the "License").
6*4444Svikram  * 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 /*
22*4444Svikram  * Copyright 2007 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 */
560Sstevel@tonic-gate 
570Sstevel@tonic-gate /* private bits */
580Sstevel@tonic-gate #define	DINFOPATH	(DIIOC | 0x08)	/* include i/o pathing information */
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 */
101*4444Svikram #define	DI_SNAPSHOT_VERSION_2	2	/* reserved */
102*4444Svikram #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)))
1210Sstevel@tonic-gate 
1220Sstevel@tonic-gate /*
1230Sstevel@tonic-gate  * For compatibility only
1240Sstevel@tonic-gate  */
1250Sstevel@tonic-gate #define	DINO(addr)		DI_NODE(addr)
1260Sstevel@tonic-gate #define	DIMI(addr)		DI_MINOR(addr)
1270Sstevel@tonic-gate #define	DIPROP(addr)		DI_PROP(addr)
1280Sstevel@tonic-gate #define	DIPATH(addr)		DI_PATH(addr)
1290Sstevel@tonic-gate #define	DIPATHPROP(addr)	DI_PATHPROP(addr)
1300Sstevel@tonic-gate 
131893Srs135747 /*
132893Srs135747  * multipath component definitions:  Follows the registered component of
133893Srs135747  * the mpxio system.
134893Srs135747  */
135893Srs135747 #define	MULTIPATH_COMPONENT_NONE	0
136893Srs135747 #define	MULTIPATH_COMPONENT_VHCI	0x1
137893Srs135747 #define	MULTIPATH_COMPONENT_PHCI	0x2
138893Srs135747 #define	MULTIPATH_COMPONENT_CLIENT	0x4
139893Srs135747 
1400Sstevel@tonic-gate typedef int32_t di_off_t;
1410Sstevel@tonic-gate 
1420Sstevel@tonic-gate /*
1430Sstevel@tonic-gate  * devinfo driver snapshot data structure
1440Sstevel@tonic-gate  */
1450Sstevel@tonic-gate struct di_all {
1460Sstevel@tonic-gate 	int	version;	/* snapshot version, reserved */
1470Sstevel@tonic-gate 	int	cache_magic;	/* magic number for cached snapshot */
1480Sstevel@tonic-gate 	int	pd_version;	/* private data format version */
1490Sstevel@tonic-gate 	int	endianness;	/* reserved for future use */
1500Sstevel@tonic-gate 	int	generation;	/* reserved for future use */
1510Sstevel@tonic-gate 	uint32_t	cache_checksum;	/* snapshot checksum */
1520Sstevel@tonic-gate 	uint64_t	snapshot_time;	/* snapshot timestamp */
1530Sstevel@tonic-gate 	di_off_t	top_devinfo;
154893Srs135747 	di_off_t	top_vhci_devinfo;
1550Sstevel@tonic-gate 	di_off_t	devnames;
1560Sstevel@tonic-gate 	di_off_t	ppdata_format;	/* parent priv data format array */
1570Sstevel@tonic-gate 	di_off_t	dpdata_format;	/* driver priv data format array */
1580Sstevel@tonic-gate 	int	n_ppdata;	/* size of ppdata_format array */
1590Sstevel@tonic-gate 	int	n_dpdata;	/* size of pddata_format array */
1600Sstevel@tonic-gate 	int	devcnt;		/* size of devnames array */
1610Sstevel@tonic-gate 	uint_t	command;	/* same as in di_init() */
1620Sstevel@tonic-gate 	uint_t	map_size;	/* size of the snapshot */
1630Sstevel@tonic-gate 	char	root_path[1];	/* path to snapshot root */
1640Sstevel@tonic-gate };
1650Sstevel@tonic-gate 
1660Sstevel@tonic-gate struct di_devnm {
1670Sstevel@tonic-gate 	di_off_t name;
1680Sstevel@tonic-gate 	di_off_t global_prop;
1690Sstevel@tonic-gate 	di_off_t head;	/* head of per instance list */
1700Sstevel@tonic-gate 	int flags;	/* driver attachment info */
1710Sstevel@tonic-gate 	int instance;	/* next instance to assign */
1720Sstevel@tonic-gate 	uint_t ops;	/* bit-encoded driver ops */
1730Sstevel@tonic-gate };
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate 
1760Sstevel@tonic-gate struct di_lnode;
1770Sstevel@tonic-gate 
1780Sstevel@tonic-gate struct di_link {
1790Sstevel@tonic-gate 	di_off_t	self;
1800Sstevel@tonic-gate 	int		count;
1810Sstevel@tonic-gate 	int		spec_type;	/* block or char access type */
1820Sstevel@tonic-gate 	di_off_t	src_lnode;	/* src di_lnode */
1830Sstevel@tonic-gate 	di_off_t	tgt_lnode;	/* tgt di_lnode */
1840Sstevel@tonic-gate 	di_off_t	src_link_next;	/* next src di_link /w same di_lnode */
1850Sstevel@tonic-gate 	di_off_t	tgt_link_next;	/* next tgt di_link /w same di_lnode */
1860Sstevel@tonic-gate 	di_off_t	src_node_next;	/* next src di_link /w same di_node */
1870Sstevel@tonic-gate 	di_off_t	tgt_node_next;	/* next tgt di_link /w same di_node */
1880Sstevel@tonic-gate 	uint64_t 	user_private_data;
1890Sstevel@tonic-gate };
1900Sstevel@tonic-gate 
1910Sstevel@tonic-gate struct di_lnode {
1920Sstevel@tonic-gate 	di_off_t	self;
1930Sstevel@tonic-gate 
1940Sstevel@tonic-gate 	/*
1950Sstevel@tonic-gate 	 * public information describing a link endpoint
1960Sstevel@tonic-gate 	 */
1970Sstevel@tonic-gate 	major_t		dev_major;	/* dev_t can be 64-bit */
1980Sstevel@tonic-gate 	minor_t		dev_minor;	/* dev_t can be 64-bit */
1990Sstevel@tonic-gate 	di_off_t	node;		/* offset of di_node */
2000Sstevel@tonic-gate 
2010Sstevel@tonic-gate 	/*
2020Sstevel@tonic-gate 	 * di_link ptr to links comming into this node
2030Sstevel@tonic-gate 	 * (this lnode is the target of these di_links)
2040Sstevel@tonic-gate 	 */
2050Sstevel@tonic-gate 	di_off_t	link_in;
2060Sstevel@tonic-gate 
2070Sstevel@tonic-gate 	/*
2080Sstevel@tonic-gate 	 * di_link ptr to links going out of this node
2090Sstevel@tonic-gate 	 * (this lnode is the source of these di_links)
2100Sstevel@tonic-gate 	 */
2110Sstevel@tonic-gate 	di_off_t	link_out;
2120Sstevel@tonic-gate 
2130Sstevel@tonic-gate 	/*
2140Sstevel@tonic-gate 	 * di_lnode pointer to the next lnode associated with the
2150Sstevel@tonic-gate 	 * same di_node
2160Sstevel@tonic-gate 	 */
2170Sstevel@tonic-gate 	di_off_t	node_next;
2180Sstevel@tonic-gate 
2190Sstevel@tonic-gate 	uint64_t 	user_private_data;
2200Sstevel@tonic-gate };
2210Sstevel@tonic-gate 
2220Sstevel@tonic-gate struct di_node {	/* useful info to export for each tree node */
2230Sstevel@tonic-gate 	/*
2240Sstevel@tonic-gate 	 * offset to di_node structures
2250Sstevel@tonic-gate 	 */
2260Sstevel@tonic-gate 	di_off_t self;		/* make it self addressable */
2270Sstevel@tonic-gate 	di_off_t parent;	/* offset of parent node */
2280Sstevel@tonic-gate 	di_off_t child;		/* offset of child node */
2290Sstevel@tonic-gate 	di_off_t sibling;	/* offset of sibling */
2300Sstevel@tonic-gate 	di_off_t next;		/* next node on per-instance list */
2310Sstevel@tonic-gate 	/*
2320Sstevel@tonic-gate 	 * offset to char strings of current node
2330Sstevel@tonic-gate 	 */
2340Sstevel@tonic-gate 	di_off_t node_name;	/* offset of device node name */
2350Sstevel@tonic-gate 	di_off_t address;	/* offset of address part of name */
2360Sstevel@tonic-gate 	di_off_t bind_name;	/* offset of binding name */
2370Sstevel@tonic-gate 	di_off_t compat_names;	/* offset of compatible names */
2380Sstevel@tonic-gate 	/*
2390Sstevel@tonic-gate 	 * offset to property lists, private data, etc.
2400Sstevel@tonic-gate 	 */
2410Sstevel@tonic-gate 	di_off_t minor_data;
2420Sstevel@tonic-gate 	di_off_t drv_prop;
2430Sstevel@tonic-gate 	di_off_t sys_prop;
2440Sstevel@tonic-gate 	di_off_t glob_prop;
2450Sstevel@tonic-gate 	di_off_t hw_prop;
2460Sstevel@tonic-gate 	di_off_t parent_data;
2470Sstevel@tonic-gate 	di_off_t driver_data;
2480Sstevel@tonic-gate 	di_off_t multipath_client;
2490Sstevel@tonic-gate 	di_off_t multipath_phci;
2500Sstevel@tonic-gate 	di_off_t devid;		/* registered device id */
2510Sstevel@tonic-gate 	di_off_t pm_info;	/* RESERVED FOR FUTURE USE */
2520Sstevel@tonic-gate 	/*
2530Sstevel@tonic-gate 	 * misc values
2540Sstevel@tonic-gate 	 */
2550Sstevel@tonic-gate 	int compat_length;	/* size of compatible name list */
2560Sstevel@tonic-gate 	int drv_major;		/* for indexing into devnames array */
2570Sstevel@tonic-gate 	/*
2580Sstevel@tonic-gate 	 * value attributes of current node
2590Sstevel@tonic-gate 	 */
2600Sstevel@tonic-gate 	int instance;		/* instance number */
2610Sstevel@tonic-gate 	int nodeid;		/* node id */
2620Sstevel@tonic-gate 	ddi_node_class_t node_class;	/* node class */
2630Sstevel@tonic-gate 	int attributes;		/* node attributes */
2640Sstevel@tonic-gate 	uint_t state;		/* hotplugging device state */
2650Sstevel@tonic-gate 	ddi_node_state_t node_state;	/* devinfo state */
2660Sstevel@tonic-gate 
2670Sstevel@tonic-gate 	di_off_t lnodes;	/* lnodes associated with this di_node */
2680Sstevel@tonic-gate 	di_off_t tgt_links;
2690Sstevel@tonic-gate 	di_off_t src_links;
2700Sstevel@tonic-gate 
271893Srs135747 	uint32_t di_pad1;	/* 4 byte padding for 32bit x86 app. */
272893Srs135747 	uint64_t user_private_data;
273893Srs135747 	/*
274893Srs135747 	 * offset to link vhci/phci nodes.
275893Srs135747 	 */
276893Srs135747 	di_off_t next_vhci;
277893Srs135747 	di_off_t top_phci;
278893Srs135747 	di_off_t next_phci;
279893Srs135747 	uint32_t multipath_component;	/* stores MDI_COMPONENT_* value. */
280*4444Svikram 
281*4444Svikram 	/*
282*4444Svikram 	 * devi_flags field
283*4444Svikram 	 */
284*4444Svikram 	uint32_t flags;
285*4444Svikram 	uint32_t di_pad2;	/* 4 byte padding for 32bit x86 app. */
2860Sstevel@tonic-gate };
2870Sstevel@tonic-gate 
2880Sstevel@tonic-gate /*
2890Sstevel@tonic-gate  * chain of ddi_minor_data structure
2900Sstevel@tonic-gate  */
2910Sstevel@tonic-gate struct di_minor {
2920Sstevel@tonic-gate 	di_off_t	self;		/* make it self addressable */
2930Sstevel@tonic-gate 	di_off_t	next;		/* next one in the chain */
2940Sstevel@tonic-gate 	di_off_t	name;		/* name of node */
2950Sstevel@tonic-gate 	di_off_t	node_type;	/* block, byte, serial, network */
2960Sstevel@tonic-gate 	ddi_minor_type	type;		/* data type */
2970Sstevel@tonic-gate 	major_t		dev_major;	/* dev_t can be 64-bit */
2980Sstevel@tonic-gate 	minor_t		dev_minor;
2990Sstevel@tonic-gate 	int		spec_type;	/* block or char */
3000Sstevel@tonic-gate 	unsigned int	mdclass;	/* no longer used, may be removed */
3010Sstevel@tonic-gate 	di_off_t	node;		/* address of di_node */
3020Sstevel@tonic-gate 	uint64_t 	user_private_data;
3030Sstevel@tonic-gate };
3040Sstevel@tonic-gate 
3050Sstevel@tonic-gate typedef enum {
3060Sstevel@tonic-gate 	DI_PATH_STATE_UNKNOWN,
3070Sstevel@tonic-gate 	DI_PATH_STATE_OFFLINE,
3080Sstevel@tonic-gate 	DI_PATH_STATE_STANDBY,
3090Sstevel@tonic-gate 	DI_PATH_STATE_ONLINE,
3100Sstevel@tonic-gate 	DI_PATH_STATE_FAULT
3110Sstevel@tonic-gate } di_path_state_t;
3120Sstevel@tonic-gate 
3130Sstevel@tonic-gate /*
3140Sstevel@tonic-gate  * multipathing information structures
3150Sstevel@tonic-gate  */
3160Sstevel@tonic-gate struct di_path {
3170Sstevel@tonic-gate 	di_off_t	self;		/* make it self addressable */
3180Sstevel@tonic-gate 	di_off_t	path_c_link;	/* next pathinfo via client linkage */
3190Sstevel@tonic-gate 	di_off_t	path_p_link;	/* next pathinfo via phci linkage */
3200Sstevel@tonic-gate 	di_off_t	path_client;	/* reference to client node */
3210Sstevel@tonic-gate 	di_off_t	path_phci;	/* reference to phci node */
3220Sstevel@tonic-gate 	di_off_t	path_prop;	/* property list */
3230Sstevel@tonic-gate 	di_off_t	path_addr;	/* path addressing information */
3240Sstevel@tonic-gate 	di_path_state_t path_state;	/* path state */
3250Sstevel@tonic-gate 	uint_t		path_snap_state;	/* describes valid fields */
3260Sstevel@tonic-gate };
3270Sstevel@tonic-gate 
3280Sstevel@tonic-gate /*
3290Sstevel@tonic-gate  * Flags for snap_state
3300Sstevel@tonic-gate  */
3310Sstevel@tonic-gate #define	DI_PATH_SNAP_NOCLIENT	0x01	/* client endpt not in snapshot */
3320Sstevel@tonic-gate #define	DI_PATH_SNAP_NOPHCI	0x02	/* phci endpt not in snapshot */
3330Sstevel@tonic-gate #define	DI_PATH_SNAP_ENDPTS	0x04	/* Endpoints have been postprocessed */
3340Sstevel@tonic-gate 
3350Sstevel@tonic-gate #define	DI_PATH_SNAP_NOCLINK	0x10	/* client linkage not in snapshot */
3360Sstevel@tonic-gate #define	DI_PATH_SNAP_NOPLINK	0x20	/* phci linkage not in snapshot */
3370Sstevel@tonic-gate #define	DI_PATH_SNAP_LINKS	0x40	/* linkages have been postprocessed */
3380Sstevel@tonic-gate 
3390Sstevel@tonic-gate /*
3400Sstevel@tonic-gate  * path properties
3410Sstevel@tonic-gate  */
3420Sstevel@tonic-gate struct di_path_prop {
3430Sstevel@tonic-gate 	di_off_t	self;		/* make it self addressable */
3440Sstevel@tonic-gate 	di_off_t	prop_next;	/* next property linkage */
3450Sstevel@tonic-gate 	di_off_t	prop_name;	/* property name */
3460Sstevel@tonic-gate 	di_off_t	prop_data;	/* property data */
3470Sstevel@tonic-gate 	int		prop_type;	/* property data type */
3480Sstevel@tonic-gate 	int		prop_len;	/* prop length in bytes */
3490Sstevel@tonic-gate };
3500Sstevel@tonic-gate 
3510Sstevel@tonic-gate /*
3520Sstevel@tonic-gate  * Now the properties.
3530Sstevel@tonic-gate  */
3540Sstevel@tonic-gate struct di_prop {
3550Sstevel@tonic-gate 	di_off_t	self;		/* make it self addressable */
3560Sstevel@tonic-gate 	di_off_t	next;
3570Sstevel@tonic-gate 	di_off_t	prop_name;	/* Property name */
3580Sstevel@tonic-gate 	di_off_t	prop_data;	/* property data */
3590Sstevel@tonic-gate 	major_t		dev_major;	/* dev_t can be 64 bit */
3600Sstevel@tonic-gate 	minor_t		dev_minor;
3610Sstevel@tonic-gate 	int	prop_flags;	/* mark prop value types & more */
3620Sstevel@tonic-gate 	int	prop_len;	/* prop length in bytes (boolean if 0) */
3630Sstevel@tonic-gate 	int	prop_list;	/* which list (DI_PROP_SYS_LIST), etc */
3640Sstevel@tonic-gate };
3650Sstevel@tonic-gate 
3660Sstevel@tonic-gate /*
3670Sstevel@tonic-gate  * Private data stuff for supporting prtconf.
3680Sstevel@tonic-gate  * Allows one level of indirection of fixed sized obj or obj array.
3690Sstevel@tonic-gate  * The array size may be an int member of the array.
3700Sstevel@tonic-gate  */
3710Sstevel@tonic-gate 
3720Sstevel@tonic-gate struct di_priv_format {
3730Sstevel@tonic-gate 	char drv_name[MAXPATHLEN];	/* name of parent drv for ppdata */
3740Sstevel@tonic-gate 	size_t bytes;			/* size in bytes of this struct */
3750Sstevel@tonic-gate 	struct {			/* ptrs to dereference */
3760Sstevel@tonic-gate 		int size;	/* size of object assoc. this ptr */
3770Sstevel@tonic-gate 		int offset;	/* location of pointer within struct */
3780Sstevel@tonic-gate 		int len_offset;	/* offset to var. containing the len */
3790Sstevel@tonic-gate 	} ptr[MAX_PTR_IN_PRV];
3800Sstevel@tonic-gate };
3810Sstevel@tonic-gate 
3820Sstevel@tonic-gate struct di_priv_data {
3830Sstevel@tonic-gate 	int version;
3840Sstevel@tonic-gate 	int n_parent;
3850Sstevel@tonic-gate 	int n_driver;
3860Sstevel@tonic-gate 	struct di_priv_format *parent;
3870Sstevel@tonic-gate 	struct di_priv_format *driver;
3880Sstevel@tonic-gate };
3890Sstevel@tonic-gate 
3900Sstevel@tonic-gate /*
3910Sstevel@tonic-gate  * structure passed in from ioctl
3920Sstevel@tonic-gate  */
3930Sstevel@tonic-gate struct dinfo_io {
3940Sstevel@tonic-gate 	char root_path[MAXPATHLEN];
3950Sstevel@tonic-gate 	struct di_priv_data priv;
3960Sstevel@tonic-gate };
3970Sstevel@tonic-gate 
3980Sstevel@tonic-gate #ifdef	__cplusplus
3990Sstevel@tonic-gate }
4000Sstevel@tonic-gate #endif
4010Sstevel@tonic-gate 
4020Sstevel@tonic-gate #endif	/* _SYS_DEVINFO_IMPL_H */
403