xref: /titanic_53/usr/src/uts/common/sys/ddipropdefs.h (revision a204de77cd937c018f628c7dc0357c2cdc90a07e)
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
5*a204de77Scth  * Common Development and Distribution License (the "License").
6*a204de77Scth  * 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*a204de77Scth  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_DDIPROPDEFS_H
277c478bd9Sstevel@tonic-gate #define	_SYS_DDIPROPDEFS_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 */
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * ddiprops.h:	All definitions related to DDI properties.
377c478bd9Sstevel@tonic-gate  *		Structure definitions are private to the DDI
387c478bd9Sstevel@tonic-gate  *		implementation.  See also, ddipropfuncs.h
397c478bd9Sstevel@tonic-gate  */
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate /*
427c478bd9Sstevel@tonic-gate  * ddi_prop_op_t:	Enum for prop_op functions
437c478bd9Sstevel@tonic-gate  */
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate typedef enum {
467c478bd9Sstevel@tonic-gate 	PROP_LEN = 0,		/* Get prop len only */
477c478bd9Sstevel@tonic-gate 	PROP_LEN_AND_VAL_BUF,	/* Get len+val into callers buffer */
487c478bd9Sstevel@tonic-gate 	PROP_LEN_AND_VAL_ALLOC,	/* Get len+val into alloc-ed buffer */
497c478bd9Sstevel@tonic-gate 	PROP_EXISTS		/* Does the property exist? */
507c478bd9Sstevel@tonic-gate } ddi_prop_op_t;
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate /*
537c478bd9Sstevel@tonic-gate  * ddi_prop_t:	The basic item used to store software defined propeties.
547c478bd9Sstevel@tonic-gate  *		Note that properties are always stored by reference.
557c478bd9Sstevel@tonic-gate  */
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate typedef struct ddi_prop {
587c478bd9Sstevel@tonic-gate 	struct ddi_prop	*prop_next;
597c478bd9Sstevel@tonic-gate 	dev_t		prop_dev;	/* specific match/wildcard */
607c478bd9Sstevel@tonic-gate 	char		*prop_name;	/* Property name */
617c478bd9Sstevel@tonic-gate 	int		prop_flags;	/* See flags below */
627c478bd9Sstevel@tonic-gate 	int		prop_len;	/* Prop length (0 == Bool. prop) */
637c478bd9Sstevel@tonic-gate 	caddr_t		prop_val;	/* ptr to property value */
647c478bd9Sstevel@tonic-gate } ddi_prop_t;
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate /*
677c478bd9Sstevel@tonic-gate  * A referenced property list, used for sharing properties among
687c478bd9Sstevel@tonic-gate  * multiple driver instances
697c478bd9Sstevel@tonic-gate  */
707c478bd9Sstevel@tonic-gate typedef struct ddi_prop_list {
717c478bd9Sstevel@tonic-gate 	ddi_prop_t	*prop_list;
727c478bd9Sstevel@tonic-gate 	int		prop_ref;
737c478bd9Sstevel@tonic-gate } ddi_prop_list_t;
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate /*
767c478bd9Sstevel@tonic-gate  * Handle passed around to encode/decode a property value.
777c478bd9Sstevel@tonic-gate  */
787c478bd9Sstevel@tonic-gate typedef struct ddi_prop_handle {
797c478bd9Sstevel@tonic-gate 	void			*ph_data;	/* Encoded data */
807c478bd9Sstevel@tonic-gate 	void			*ph_cur_pos;	/* encode/decode position */
817c478bd9Sstevel@tonic-gate 	void			*ph_save_pos;	/* Save/restore position */
827c478bd9Sstevel@tonic-gate 	uint_t			ph_size;	/* Size of encoded data */
837c478bd9Sstevel@tonic-gate 	uint_t			ph_flags;	/* See below */
847c478bd9Sstevel@tonic-gate 	struct prop_handle_ops	*ph_ops;	/* Encode/decode routines */
857c478bd9Sstevel@tonic-gate } prop_handle_t;
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate /*
887c478bd9Sstevel@tonic-gate  * Property handle encode/decode ops
897c478bd9Sstevel@tonic-gate  */
907c478bd9Sstevel@tonic-gate typedef struct prop_handle_ops {
917c478bd9Sstevel@tonic-gate 	int (*op_prop_int)(prop_handle_t *ph, uint_t cmd, int *data);
927c478bd9Sstevel@tonic-gate 	int (*op_prop_str)(prop_handle_t *ph, uint_t cmd, char *data);
937c478bd9Sstevel@tonic-gate 	int (*op_prop_bytes)(prop_handle_t *ph, uint_t cmd,
947c478bd9Sstevel@tonic-gate 				uchar_t *data, uint_t size);
957c478bd9Sstevel@tonic-gate 	int (*op_prop_int64)(prop_handle_t *ph, uint_t cmd, int64_t *data);
967c478bd9Sstevel@tonic-gate } prop_handle_ops_t;
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate /*
997c478bd9Sstevel@tonic-gate  * Data passed back to driver.  The driver gets a pointer to driver_data.
1007c478bd9Sstevel@tonic-gate  * When we get it back we do negative indexing to find the size and free
1017c478bd9Sstevel@tonic-gate  * routine to call
1027c478bd9Sstevel@tonic-gate  */
1037c478bd9Sstevel@tonic-gate struct prop_driver_data {
1047c478bd9Sstevel@tonic-gate 	size_t	pdd_size;
1057c478bd9Sstevel@tonic-gate 	void	(*pdd_prop_free)(struct prop_driver_data *);
1067c478bd9Sstevel@tonic-gate };
1077c478bd9Sstevel@tonic-gate 
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate /*
1107c478bd9Sstevel@tonic-gate  * Macros to call the integer/string/byte OBP 1275 operators
1117c478bd9Sstevel@tonic-gate  */
1127c478bd9Sstevel@tonic-gate #define	DDI_PROP_INT(ph, cmd, data)		\
1137c478bd9Sstevel@tonic-gate 		(*(ph)->ph_ops->op_prop_int)((ph), (cmd), (data))
1147c478bd9Sstevel@tonic-gate #define	DDI_PROP_STR(ph, cmd, data)		\
1157c478bd9Sstevel@tonic-gate 		(*(ph)->ph_ops->op_prop_str)((ph), (cmd), (data))
1167c478bd9Sstevel@tonic-gate #define	DDI_PROP_BYTES(ph, cmd, data, size)	\
1177c478bd9Sstevel@tonic-gate 		(*(ph)->ph_ops->op_prop_bytes)((ph), (cmd), (data), (size))
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate /*
1207c478bd9Sstevel@tonic-gate  * Macro to call the 64 bit integer operator
1217c478bd9Sstevel@tonic-gate  */
1227c478bd9Sstevel@tonic-gate #define	DDI_PROP_INT64(ph, cmd, data)		\
1237c478bd9Sstevel@tonic-gate 		(*(ph)->ph_ops->op_prop_int64)((ph), (cmd), (data))
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate /*
1267c478bd9Sstevel@tonic-gate  * Property handle commands
1277c478bd9Sstevel@tonic-gate  */
1287c478bd9Sstevel@tonic-gate typedef enum {
1297c478bd9Sstevel@tonic-gate 	DDI_PROP_CMD_GET_ESIZE,		/* Get encoded size of data  */
1307c478bd9Sstevel@tonic-gate 	DDI_PROP_CMD_GET_DSIZE,		/* Get decoded size of data */
1317c478bd9Sstevel@tonic-gate 	DDI_PROP_CMD_DECODE,		/* Decode the current data */
1327c478bd9Sstevel@tonic-gate 	DDI_PROP_CMD_ENCODE,		/* Encode the current data */
1337c478bd9Sstevel@tonic-gate 	DDI_PROP_CMD_SKIP		/* Skip the current data */
1347c478bd9Sstevel@tonic-gate } ddi_prop_cmd_t;
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate /*
1377c478bd9Sstevel@tonic-gate  * Return values from property handle encode/decode ops
1387c478bd9Sstevel@tonic-gate  * Positive numbers are used to return the encoded or
1397c478bd9Sstevel@tonic-gate  * decode size of the object, so an ok return must be positive,
1407c478bd9Sstevel@tonic-gate  * and all error returns negative.
1417c478bd9Sstevel@tonic-gate  */
1427c478bd9Sstevel@tonic-gate typedef enum {
1437c478bd9Sstevel@tonic-gate 	DDI_PROP_RESULT_ERROR = -2,	/* error in encoding/decoding data */
1447c478bd9Sstevel@tonic-gate 	DDI_PROP_RESULT_EOF,		/* end of data reached */
1457c478bd9Sstevel@tonic-gate 	DDI_PROP_RESULT_OK		/* if >= to DDI_PROP_RESULT_OK, */
1467c478bd9Sstevel@tonic-gate 					/* operation was successful */
1477c478bd9Sstevel@tonic-gate } ddi_prop_result_t;
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate /* 1275 property cell */
1507c478bd9Sstevel@tonic-gate typedef uint32_t prop_1275_cell_t;
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate /* Length of a 1275 property cell */
1537c478bd9Sstevel@tonic-gate #define	PROP_1275_CELL_SIZE	sizeof (prop_1275_cell_t)
1547c478bd9Sstevel@tonic-gate #define	CELLS_1275_TO_BYTES(n)	((n) * PROP_1275_CELL_SIZE)
1557c478bd9Sstevel@tonic-gate #define	BYTES_TO_1275_CELLS(n)	((n) / PROP_1275_CELL_SIZE)
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate /*
1587c478bd9Sstevel@tonic-gate  * Property handle flags
1597c478bd9Sstevel@tonic-gate  */
1607c478bd9Sstevel@tonic-gate #define	PH_FROM_PROM	0x01	/* Property came from the prom */
1617c478bd9Sstevel@tonic-gate 
1627c478bd9Sstevel@tonic-gate /*
1637c478bd9Sstevel@tonic-gate  * Return values from property functions:
1647c478bd9Sstevel@tonic-gate  */
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate #define	DDI_PROP_SUCCESS	0
1677c478bd9Sstevel@tonic-gate #define	DDI_PROP_NOT_FOUND	1	/* Prop not defined */
1687c478bd9Sstevel@tonic-gate #define	DDI_PROP_UNDEFINED	2	/* Overriden to undefine a prop */
1697c478bd9Sstevel@tonic-gate #define	DDI_PROP_NO_MEMORY	3	/* Unable to allocate/no sleep */
1707c478bd9Sstevel@tonic-gate #define	DDI_PROP_INVAL_ARG	4	/* Invalid calling argument */
1717c478bd9Sstevel@tonic-gate #define	DDI_PROP_BUF_TOO_SMALL	5	/* Callers buf too small */
1727c478bd9Sstevel@tonic-gate #define	DDI_PROP_CANNOT_DECODE	6	/* Could not decode prop */
1737c478bd9Sstevel@tonic-gate #define	DDI_PROP_CANNOT_ENCODE	7	/* Could not encode prop */
1747c478bd9Sstevel@tonic-gate #define	DDI_PROP_END_OF_DATA	8	/* Prop found in an encoded format */
1757c478bd9Sstevel@tonic-gate 
1767c478bd9Sstevel@tonic-gate /*
1777c478bd9Sstevel@tonic-gate  * used internally in the framework only
1787c478bd9Sstevel@tonic-gate  */
1797c478bd9Sstevel@tonic-gate #define	DDI_PROP_FOUND_1275	255	/* Prop found in OPB 1275 format */
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate /*
1827c478bd9Sstevel@tonic-gate  * Size of a 1275 int in bytes
1837c478bd9Sstevel@tonic-gate  */
1847c478bd9Sstevel@tonic-gate #define	PROP_1275_INT_SIZE	4
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate /*
1877c478bd9Sstevel@tonic-gate  * Property flags:
1887c478bd9Sstevel@tonic-gate  */
1897c478bd9Sstevel@tonic-gate 
1907c478bd9Sstevel@tonic-gate #define	DDI_PROP_DONTPASS	0x0001	/* Don't pass request to parent */
1917c478bd9Sstevel@tonic-gate #define	DDI_PROP_CANSLEEP	0x0002	/* Memory allocation may sleep */
1927c478bd9Sstevel@tonic-gate 
1937c478bd9Sstevel@tonic-gate /*
1947c478bd9Sstevel@tonic-gate  * Used internally by the DDI property rountines and masked in DDI(9F)
1957c478bd9Sstevel@tonic-gate  * interfaces...
1967c478bd9Sstevel@tonic-gate  */
1977c478bd9Sstevel@tonic-gate 
1987c478bd9Sstevel@tonic-gate #define	DDI_PROP_SYSTEM_DEF	0x0004	/* System defined property */
1997c478bd9Sstevel@tonic-gate 
2007c478bd9Sstevel@tonic-gate /*
2017c478bd9Sstevel@tonic-gate  * Used in framework only, to inhibit certain pre-defined s/w property
2027c478bd9Sstevel@tonic-gate  * names from coming from the prom.
2037c478bd9Sstevel@tonic-gate  */
2047c478bd9Sstevel@tonic-gate #define	DDI_PROP_NOTPROM	0x0008	/* Don't look at prom properties */
2057c478bd9Sstevel@tonic-gate 
2067c478bd9Sstevel@tonic-gate /*
2077c478bd9Sstevel@tonic-gate  * Used interally by the DDI property routines to implement the old
2087c478bd9Sstevel@tonic-gate  * depricated functions with the new functions
2097c478bd9Sstevel@tonic-gate  */
2107c478bd9Sstevel@tonic-gate #define	DDI_PROP_DONTSLEEP	0x0010	/* Memory allocation may not sleep */
2117c478bd9Sstevel@tonic-gate #define	DDI_PROP_STACK_CREATE	0x0020	/* Do a LIFO stack of properties */
2127c478bd9Sstevel@tonic-gate #define	DDI_PROP_UNDEF_IT	0x0040	/* Undefine a property */
2137c478bd9Sstevel@tonic-gate #define	DDI_PROP_HW_DEF		0x0080	/* Hardware defined property */
2147c478bd9Sstevel@tonic-gate 
2157c478bd9Sstevel@tonic-gate /*
2167c478bd9Sstevel@tonic-gate  * Type of data property contains
2177c478bd9Sstevel@tonic-gate  */
2187c478bd9Sstevel@tonic-gate #define	DDI_PROP_TYPE_INT		0x0100
2197c478bd9Sstevel@tonic-gate #define	DDI_PROP_TYPE_STRING		0x0200
2207c478bd9Sstevel@tonic-gate #define	DDI_PROP_TYPE_BYTE		0x0400
2217c478bd9Sstevel@tonic-gate #define	DDI_PROP_TYPE_COMPOSITE		0x0800
2227c478bd9Sstevel@tonic-gate #define	DDI_PROP_TYPE_INT64		0x1000
2237c478bd9Sstevel@tonic-gate 
2247c478bd9Sstevel@tonic-gate #define	DDI_PROP_TYPE_ANY		(DDI_PROP_TYPE_INT	|	\
2257c478bd9Sstevel@tonic-gate 					DDI_PROP_TYPE_STRING	|	\
2267c478bd9Sstevel@tonic-gate 					DDI_PROP_TYPE_BYTE	|	\
2277c478bd9Sstevel@tonic-gate 					DDI_PROP_TYPE_COMPOSITE)
2287c478bd9Sstevel@tonic-gate 
2297c478bd9Sstevel@tonic-gate #define	DDI_PROP_TYPE_MASK		(DDI_PROP_TYPE_INT	|	\
2307c478bd9Sstevel@tonic-gate 					DDI_PROP_TYPE_STRING	|	\
2317c478bd9Sstevel@tonic-gate 					DDI_PROP_TYPE_BYTE	|	\
2327c478bd9Sstevel@tonic-gate 					DDI_PROP_TYPE_COMPOSITE	|	\
2337c478bd9Sstevel@tonic-gate 					DDI_PROP_TYPE_INT64)
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate /*
2367c478bd9Sstevel@tonic-gate  * This flag indicates that the LDI lookup routine
2377c478bd9Sstevel@tonic-gate  * should match the request regardless of the actual
2387c478bd9Sstevel@tonic-gate  * dev_t with which the property was created.  In other
2397c478bd9Sstevel@tonic-gate  * words, any dev_t value found on the property list
2407c478bd9Sstevel@tonic-gate  * is an acceptable part of the match criteria.
2417c478bd9Sstevel@tonic-gate  */
2427c478bd9Sstevel@tonic-gate #define	LDI_DEV_T_ANY		0x2000
2437c478bd9Sstevel@tonic-gate 
2447c478bd9Sstevel@tonic-gate /*
2457c478bd9Sstevel@tonic-gate  * Private flag that should ONLY be used by the LDI Framework
2467c478bd9Sstevel@tonic-gate  * to indicate a property search of an unbound dlpi2 dip.
2477c478bd9Sstevel@tonic-gate  * The LDI property lookup interfaces will set this flag if
2487c478bd9Sstevel@tonic-gate  * it is determined that the dip representing a dlpi-style2
2497c478bd9Sstevel@tonic-gate  * driver is currently unbound (dip == NULL) at the time of
2507c478bd9Sstevel@tonic-gate  * the property lookup request.
2517c478bd9Sstevel@tonic-gate  */
2527c478bd9Sstevel@tonic-gate #define	DDI_UNBND_DLPI2		0x4000
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate /*
2557c478bd9Sstevel@tonic-gate  * Private flag that indicates that a typed interface that predates typed
2567c478bd9Sstevel@tonic-gate  * properties is being used - the framework should set additional typed flags
2577c478bd9Sstevel@tonic-gate  * (DDI_PROP_TYPE_INT64) when expanding search to DDI_PROP_TYPE_ANY.
2587c478bd9Sstevel@tonic-gate  */
2597c478bd9Sstevel@tonic-gate #define	DDI_PROP_CONSUMER_TYPED	0x8000
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate /*
2627c478bd9Sstevel@tonic-gate  * Private flag that indicates that the ldi is doing a driver prop_op
2637c478bd9Sstevel@tonic-gate  * call to check for driver dynamic properties.  This request should
2647c478bd9Sstevel@tonic-gate  * not be passed onto the common property lookup framework since all
2657c478bd9Sstevel@tonic-gate  * the ldi property interface are typed and driver prop_op lookups are
2667c478bd9Sstevel@tonic-gate  * not.
2677c478bd9Sstevel@tonic-gate  */
2687c478bd9Sstevel@tonic-gate #define	DDI_PROP_DYNAMIC	0x10000
2697c478bd9Sstevel@tonic-gate 
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate /*
2727c478bd9Sstevel@tonic-gate  * DDI_DEV_T_NONE:	When creating, property is not associated with
2737c478bd9Sstevel@tonic-gate  *			particular dev_t.
2747c478bd9Sstevel@tonic-gate  * DDI_DEV_T_ANY:	Wildcard dev_t when searching properties.
2757c478bd9Sstevel@tonic-gate  */
2767c478bd9Sstevel@tonic-gate #define	DDI_DEV_T_NONE		((dev_t)-1)
2777c478bd9Sstevel@tonic-gate #define	DDI_DEV_T_ANY		((dev_t)-2)
278*a204de77Scth /*
279*a204de77Scth  * DDI_MAJOR_T_UNKNOWN	Used when a driver does not know its dev_t during
280*a204de77Scth  *			a property create.
281*a204de77Scth  * DDI_MAJOR_T_NONE	Used when a driver does not have a major number.
282*a204de77Scth  */
2837c478bd9Sstevel@tonic-gate #define	DDI_MAJOR_T_UNKNOWN	((major_t)0)
284*a204de77Scth #define	DDI_MAJOR_T_NONE	((major_t)-1)
2857c478bd9Sstevel@tonic-gate 
2867c478bd9Sstevel@tonic-gate /*
2877c478bd9Sstevel@tonic-gate  * Some DDI property names...
2887c478bd9Sstevel@tonic-gate  */
2897c478bd9Sstevel@tonic-gate 
2907c478bd9Sstevel@tonic-gate /*
2917c478bd9Sstevel@tonic-gate  * One of the following boolean properties shall be defined in the
2927c478bd9Sstevel@tonic-gate  * root node, and defines the addressing mode understood by the root
2937c478bd9Sstevel@tonic-gate  * node of the implementation....
2947c478bd9Sstevel@tonic-gate  */
2957c478bd9Sstevel@tonic-gate 
2967c478bd9Sstevel@tonic-gate #define	DDI_RELATIVE_ADDRESSING		"relative-addressing"
2977c478bd9Sstevel@tonic-gate #define	DDI_GENERIC_ADDRESSING		"generic-addressing"
2987c478bd9Sstevel@tonic-gate 
2997c478bd9Sstevel@tonic-gate /*
3007c478bd9Sstevel@tonic-gate  * Common property encoded data search routine.  Returns the encoded data
3017c478bd9Sstevel@tonic-gate  * in valuep.  Match is done on dip, dev, data type (in flags), and name.
3027c478bd9Sstevel@tonic-gate  */
3037c478bd9Sstevel@tonic-gate int ddi_prop_search_common(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op,
3047c478bd9Sstevel@tonic-gate     uint_t flags, char *name, void *valuep, uint_t *lengthp);
3057c478bd9Sstevel@tonic-gate 
3067c478bd9Sstevel@tonic-gate 
3077c478bd9Sstevel@tonic-gate /*
3087c478bd9Sstevel@tonic-gate  * Property debugging support in kernel...
3097c478bd9Sstevel@tonic-gate  */
3107c478bd9Sstevel@tonic-gate 
3117c478bd9Sstevel@tonic-gate /*
3127c478bd9Sstevel@tonic-gate  * Property debugging support...  Be careful about enabling this when
3137c478bd9Sstevel@tonic-gate  * you are tipping in to the console.  Undefine PROP_DEBUG to remove
3147c478bd9Sstevel@tonic-gate  * all support from the code. (c.f. autoconf.c and zs_common.c)
3157c478bd9Sstevel@tonic-gate  *
3167c478bd9Sstevel@tonic-gate  * It does no good to enable this if the rest of the kernel was built with
3177c478bd9Sstevel@tonic-gate  * this disabled (specifically, the core kernel module.)
3187c478bd9Sstevel@tonic-gate  *
3197c478bd9Sstevel@tonic-gate  * #define	DDI_PROP_DEBUG	1
3207c478bd9Sstevel@tonic-gate  */
3217c478bd9Sstevel@tonic-gate 
3227c478bd9Sstevel@tonic-gate #ifdef	DDI_PROP_DEBUG
3237c478bd9Sstevel@tonic-gate #define	ddi_prop_printf	if (ddi_prop_debug_flag != 0) printf
3247c478bd9Sstevel@tonic-gate 
3257c478bd9Sstevel@tonic-gate /*
3267c478bd9Sstevel@tonic-gate  * Returns prev value of debugging flag, non-zero enables debug printf's
3277c478bd9Sstevel@tonic-gate  */
3287c478bd9Sstevel@tonic-gate 
3297c478bd9Sstevel@tonic-gate int ddi_prop_debug(int enable);
3307c478bd9Sstevel@tonic-gate 
3317c478bd9Sstevel@tonic-gate #endif	/* DDI_PROP_DEBUG */
3327c478bd9Sstevel@tonic-gate 
3337c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3347c478bd9Sstevel@tonic-gate }
3357c478bd9Sstevel@tonic-gate #endif
3367c478bd9Sstevel@tonic-gate 
3377c478bd9Sstevel@tonic-gate #endif /* _SYS_DDIPROPDEFS_H */
338