1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _SYS_DDIPROPDEFS_H 28*7c478bd9Sstevel@tonic-gate #define _SYS_DDIPROPDEFS_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 */ 31*7c478bd9Sstevel@tonic-gate 32*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 33*7c478bd9Sstevel@tonic-gate extern "C" { 34*7c478bd9Sstevel@tonic-gate #endif 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate /* 37*7c478bd9Sstevel@tonic-gate * ddiprops.h: All definitions related to DDI properties. 38*7c478bd9Sstevel@tonic-gate * Structure definitions are private to the DDI 39*7c478bd9Sstevel@tonic-gate * implementation. See also, ddipropfuncs.h 40*7c478bd9Sstevel@tonic-gate */ 41*7c478bd9Sstevel@tonic-gate 42*7c478bd9Sstevel@tonic-gate /* 43*7c478bd9Sstevel@tonic-gate * ddi_prop_op_t: Enum for prop_op functions 44*7c478bd9Sstevel@tonic-gate */ 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gate typedef enum { 47*7c478bd9Sstevel@tonic-gate PROP_LEN = 0, /* Get prop len only */ 48*7c478bd9Sstevel@tonic-gate PROP_LEN_AND_VAL_BUF, /* Get len+val into callers buffer */ 49*7c478bd9Sstevel@tonic-gate PROP_LEN_AND_VAL_ALLOC, /* Get len+val into alloc-ed buffer */ 50*7c478bd9Sstevel@tonic-gate PROP_EXISTS /* Does the property exist? */ 51*7c478bd9Sstevel@tonic-gate } ddi_prop_op_t; 52*7c478bd9Sstevel@tonic-gate 53*7c478bd9Sstevel@tonic-gate /* 54*7c478bd9Sstevel@tonic-gate * ddi_prop_t: The basic item used to store software defined propeties. 55*7c478bd9Sstevel@tonic-gate * Note that properties are always stored by reference. 56*7c478bd9Sstevel@tonic-gate */ 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gate typedef struct ddi_prop { 59*7c478bd9Sstevel@tonic-gate struct ddi_prop *prop_next; 60*7c478bd9Sstevel@tonic-gate dev_t prop_dev; /* specific match/wildcard */ 61*7c478bd9Sstevel@tonic-gate char *prop_name; /* Property name */ 62*7c478bd9Sstevel@tonic-gate int prop_flags; /* See flags below */ 63*7c478bd9Sstevel@tonic-gate int prop_len; /* Prop length (0 == Bool. prop) */ 64*7c478bd9Sstevel@tonic-gate caddr_t prop_val; /* ptr to property value */ 65*7c478bd9Sstevel@tonic-gate } ddi_prop_t; 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate /* 68*7c478bd9Sstevel@tonic-gate * A referenced property list, used for sharing properties among 69*7c478bd9Sstevel@tonic-gate * multiple driver instances 70*7c478bd9Sstevel@tonic-gate */ 71*7c478bd9Sstevel@tonic-gate typedef struct ddi_prop_list { 72*7c478bd9Sstevel@tonic-gate ddi_prop_t *prop_list; 73*7c478bd9Sstevel@tonic-gate int prop_ref; 74*7c478bd9Sstevel@tonic-gate } ddi_prop_list_t; 75*7c478bd9Sstevel@tonic-gate 76*7c478bd9Sstevel@tonic-gate /* 77*7c478bd9Sstevel@tonic-gate * Handle passed around to encode/decode a property value. 78*7c478bd9Sstevel@tonic-gate */ 79*7c478bd9Sstevel@tonic-gate typedef struct ddi_prop_handle { 80*7c478bd9Sstevel@tonic-gate void *ph_data; /* Encoded data */ 81*7c478bd9Sstevel@tonic-gate void *ph_cur_pos; /* encode/decode position */ 82*7c478bd9Sstevel@tonic-gate void *ph_save_pos; /* Save/restore position */ 83*7c478bd9Sstevel@tonic-gate uint_t ph_size; /* Size of encoded data */ 84*7c478bd9Sstevel@tonic-gate uint_t ph_flags; /* See below */ 85*7c478bd9Sstevel@tonic-gate struct prop_handle_ops *ph_ops; /* Encode/decode routines */ 86*7c478bd9Sstevel@tonic-gate } prop_handle_t; 87*7c478bd9Sstevel@tonic-gate 88*7c478bd9Sstevel@tonic-gate /* 89*7c478bd9Sstevel@tonic-gate * Property handle encode/decode ops 90*7c478bd9Sstevel@tonic-gate */ 91*7c478bd9Sstevel@tonic-gate typedef struct prop_handle_ops { 92*7c478bd9Sstevel@tonic-gate int (*op_prop_int)(prop_handle_t *ph, uint_t cmd, int *data); 93*7c478bd9Sstevel@tonic-gate int (*op_prop_str)(prop_handle_t *ph, uint_t cmd, char *data); 94*7c478bd9Sstevel@tonic-gate int (*op_prop_bytes)(prop_handle_t *ph, uint_t cmd, 95*7c478bd9Sstevel@tonic-gate uchar_t *data, uint_t size); 96*7c478bd9Sstevel@tonic-gate int (*op_prop_int64)(prop_handle_t *ph, uint_t cmd, int64_t *data); 97*7c478bd9Sstevel@tonic-gate } prop_handle_ops_t; 98*7c478bd9Sstevel@tonic-gate 99*7c478bd9Sstevel@tonic-gate /* 100*7c478bd9Sstevel@tonic-gate * Data passed back to driver. The driver gets a pointer to driver_data. 101*7c478bd9Sstevel@tonic-gate * When we get it back we do negative indexing to find the size and free 102*7c478bd9Sstevel@tonic-gate * routine to call 103*7c478bd9Sstevel@tonic-gate */ 104*7c478bd9Sstevel@tonic-gate struct prop_driver_data { 105*7c478bd9Sstevel@tonic-gate size_t pdd_size; 106*7c478bd9Sstevel@tonic-gate void (*pdd_prop_free)(struct prop_driver_data *); 107*7c478bd9Sstevel@tonic-gate }; 108*7c478bd9Sstevel@tonic-gate 109*7c478bd9Sstevel@tonic-gate 110*7c478bd9Sstevel@tonic-gate /* 111*7c478bd9Sstevel@tonic-gate * Macros to call the integer/string/byte OBP 1275 operators 112*7c478bd9Sstevel@tonic-gate */ 113*7c478bd9Sstevel@tonic-gate #define DDI_PROP_INT(ph, cmd, data) \ 114*7c478bd9Sstevel@tonic-gate (*(ph)->ph_ops->op_prop_int)((ph), (cmd), (data)) 115*7c478bd9Sstevel@tonic-gate #define DDI_PROP_STR(ph, cmd, data) \ 116*7c478bd9Sstevel@tonic-gate (*(ph)->ph_ops->op_prop_str)((ph), (cmd), (data)) 117*7c478bd9Sstevel@tonic-gate #define DDI_PROP_BYTES(ph, cmd, data, size) \ 118*7c478bd9Sstevel@tonic-gate (*(ph)->ph_ops->op_prop_bytes)((ph), (cmd), (data), (size)) 119*7c478bd9Sstevel@tonic-gate 120*7c478bd9Sstevel@tonic-gate /* 121*7c478bd9Sstevel@tonic-gate * Macro to call the 64 bit integer operator 122*7c478bd9Sstevel@tonic-gate */ 123*7c478bd9Sstevel@tonic-gate #define DDI_PROP_INT64(ph, cmd, data) \ 124*7c478bd9Sstevel@tonic-gate (*(ph)->ph_ops->op_prop_int64)((ph), (cmd), (data)) 125*7c478bd9Sstevel@tonic-gate 126*7c478bd9Sstevel@tonic-gate /* 127*7c478bd9Sstevel@tonic-gate * Property handle commands 128*7c478bd9Sstevel@tonic-gate */ 129*7c478bd9Sstevel@tonic-gate typedef enum { 130*7c478bd9Sstevel@tonic-gate DDI_PROP_CMD_GET_ESIZE, /* Get encoded size of data */ 131*7c478bd9Sstevel@tonic-gate DDI_PROP_CMD_GET_DSIZE, /* Get decoded size of data */ 132*7c478bd9Sstevel@tonic-gate DDI_PROP_CMD_DECODE, /* Decode the current data */ 133*7c478bd9Sstevel@tonic-gate DDI_PROP_CMD_ENCODE, /* Encode the current data */ 134*7c478bd9Sstevel@tonic-gate DDI_PROP_CMD_SKIP /* Skip the current data */ 135*7c478bd9Sstevel@tonic-gate } ddi_prop_cmd_t; 136*7c478bd9Sstevel@tonic-gate 137*7c478bd9Sstevel@tonic-gate /* 138*7c478bd9Sstevel@tonic-gate * Return values from property handle encode/decode ops 139*7c478bd9Sstevel@tonic-gate * Positive numbers are used to return the encoded or 140*7c478bd9Sstevel@tonic-gate * decode size of the object, so an ok return must be positive, 141*7c478bd9Sstevel@tonic-gate * and all error returns negative. 142*7c478bd9Sstevel@tonic-gate */ 143*7c478bd9Sstevel@tonic-gate typedef enum { 144*7c478bd9Sstevel@tonic-gate DDI_PROP_RESULT_ERROR = -2, /* error in encoding/decoding data */ 145*7c478bd9Sstevel@tonic-gate DDI_PROP_RESULT_EOF, /* end of data reached */ 146*7c478bd9Sstevel@tonic-gate DDI_PROP_RESULT_OK /* if >= to DDI_PROP_RESULT_OK, */ 147*7c478bd9Sstevel@tonic-gate /* operation was successful */ 148*7c478bd9Sstevel@tonic-gate } ddi_prop_result_t; 149*7c478bd9Sstevel@tonic-gate 150*7c478bd9Sstevel@tonic-gate /* 1275 property cell */ 151*7c478bd9Sstevel@tonic-gate typedef uint32_t prop_1275_cell_t; 152*7c478bd9Sstevel@tonic-gate 153*7c478bd9Sstevel@tonic-gate /* Length of a 1275 property cell */ 154*7c478bd9Sstevel@tonic-gate #define PROP_1275_CELL_SIZE sizeof (prop_1275_cell_t) 155*7c478bd9Sstevel@tonic-gate #define CELLS_1275_TO_BYTES(n) ((n) * PROP_1275_CELL_SIZE) 156*7c478bd9Sstevel@tonic-gate #define BYTES_TO_1275_CELLS(n) ((n) / PROP_1275_CELL_SIZE) 157*7c478bd9Sstevel@tonic-gate 158*7c478bd9Sstevel@tonic-gate /* 159*7c478bd9Sstevel@tonic-gate * Property handle flags 160*7c478bd9Sstevel@tonic-gate */ 161*7c478bd9Sstevel@tonic-gate #define PH_FROM_PROM 0x01 /* Property came from the prom */ 162*7c478bd9Sstevel@tonic-gate 163*7c478bd9Sstevel@tonic-gate /* 164*7c478bd9Sstevel@tonic-gate * Return values from property functions: 165*7c478bd9Sstevel@tonic-gate */ 166*7c478bd9Sstevel@tonic-gate 167*7c478bd9Sstevel@tonic-gate #define DDI_PROP_SUCCESS 0 168*7c478bd9Sstevel@tonic-gate #define DDI_PROP_NOT_FOUND 1 /* Prop not defined */ 169*7c478bd9Sstevel@tonic-gate #define DDI_PROP_UNDEFINED 2 /* Overriden to undefine a prop */ 170*7c478bd9Sstevel@tonic-gate #define DDI_PROP_NO_MEMORY 3 /* Unable to allocate/no sleep */ 171*7c478bd9Sstevel@tonic-gate #define DDI_PROP_INVAL_ARG 4 /* Invalid calling argument */ 172*7c478bd9Sstevel@tonic-gate #define DDI_PROP_BUF_TOO_SMALL 5 /* Callers buf too small */ 173*7c478bd9Sstevel@tonic-gate #define DDI_PROP_CANNOT_DECODE 6 /* Could not decode prop */ 174*7c478bd9Sstevel@tonic-gate #define DDI_PROP_CANNOT_ENCODE 7 /* Could not encode prop */ 175*7c478bd9Sstevel@tonic-gate #define DDI_PROP_END_OF_DATA 8 /* Prop found in an encoded format */ 176*7c478bd9Sstevel@tonic-gate 177*7c478bd9Sstevel@tonic-gate /* 178*7c478bd9Sstevel@tonic-gate * used internally in the framework only 179*7c478bd9Sstevel@tonic-gate */ 180*7c478bd9Sstevel@tonic-gate #define DDI_PROP_FOUND_1275 255 /* Prop found in OPB 1275 format */ 181*7c478bd9Sstevel@tonic-gate 182*7c478bd9Sstevel@tonic-gate /* 183*7c478bd9Sstevel@tonic-gate * Size of a 1275 int in bytes 184*7c478bd9Sstevel@tonic-gate */ 185*7c478bd9Sstevel@tonic-gate #define PROP_1275_INT_SIZE 4 186*7c478bd9Sstevel@tonic-gate 187*7c478bd9Sstevel@tonic-gate /* 188*7c478bd9Sstevel@tonic-gate * Property flags: 189*7c478bd9Sstevel@tonic-gate */ 190*7c478bd9Sstevel@tonic-gate 191*7c478bd9Sstevel@tonic-gate #define DDI_PROP_DONTPASS 0x0001 /* Don't pass request to parent */ 192*7c478bd9Sstevel@tonic-gate #define DDI_PROP_CANSLEEP 0x0002 /* Memory allocation may sleep */ 193*7c478bd9Sstevel@tonic-gate 194*7c478bd9Sstevel@tonic-gate /* 195*7c478bd9Sstevel@tonic-gate * Used internally by the DDI property rountines and masked in DDI(9F) 196*7c478bd9Sstevel@tonic-gate * interfaces... 197*7c478bd9Sstevel@tonic-gate */ 198*7c478bd9Sstevel@tonic-gate 199*7c478bd9Sstevel@tonic-gate #define DDI_PROP_SYSTEM_DEF 0x0004 /* System defined property */ 200*7c478bd9Sstevel@tonic-gate 201*7c478bd9Sstevel@tonic-gate /* 202*7c478bd9Sstevel@tonic-gate * Used in framework only, to inhibit certain pre-defined s/w property 203*7c478bd9Sstevel@tonic-gate * names from coming from the prom. 204*7c478bd9Sstevel@tonic-gate */ 205*7c478bd9Sstevel@tonic-gate #define DDI_PROP_NOTPROM 0x0008 /* Don't look at prom properties */ 206*7c478bd9Sstevel@tonic-gate 207*7c478bd9Sstevel@tonic-gate /* 208*7c478bd9Sstevel@tonic-gate * Used interally by the DDI property routines to implement the old 209*7c478bd9Sstevel@tonic-gate * depricated functions with the new functions 210*7c478bd9Sstevel@tonic-gate */ 211*7c478bd9Sstevel@tonic-gate #define DDI_PROP_DONTSLEEP 0x0010 /* Memory allocation may not sleep */ 212*7c478bd9Sstevel@tonic-gate #define DDI_PROP_STACK_CREATE 0x0020 /* Do a LIFO stack of properties */ 213*7c478bd9Sstevel@tonic-gate #define DDI_PROP_UNDEF_IT 0x0040 /* Undefine a property */ 214*7c478bd9Sstevel@tonic-gate #define DDI_PROP_HW_DEF 0x0080 /* Hardware defined property */ 215*7c478bd9Sstevel@tonic-gate 216*7c478bd9Sstevel@tonic-gate /* 217*7c478bd9Sstevel@tonic-gate * Type of data property contains 218*7c478bd9Sstevel@tonic-gate */ 219*7c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_INT 0x0100 220*7c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_STRING 0x0200 221*7c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_BYTE 0x0400 222*7c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_COMPOSITE 0x0800 223*7c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_INT64 0x1000 224*7c478bd9Sstevel@tonic-gate 225*7c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_ANY (DDI_PROP_TYPE_INT | \ 226*7c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_STRING | \ 227*7c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_BYTE | \ 228*7c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_COMPOSITE) 229*7c478bd9Sstevel@tonic-gate 230*7c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_MASK (DDI_PROP_TYPE_INT | \ 231*7c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_STRING | \ 232*7c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_BYTE | \ 233*7c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_COMPOSITE | \ 234*7c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_INT64) 235*7c478bd9Sstevel@tonic-gate 236*7c478bd9Sstevel@tonic-gate /* 237*7c478bd9Sstevel@tonic-gate * This flag indicates that the LDI lookup routine 238*7c478bd9Sstevel@tonic-gate * should match the request regardless of the actual 239*7c478bd9Sstevel@tonic-gate * dev_t with which the property was created. In other 240*7c478bd9Sstevel@tonic-gate * words, any dev_t value found on the property list 241*7c478bd9Sstevel@tonic-gate * is an acceptable part of the match criteria. 242*7c478bd9Sstevel@tonic-gate */ 243*7c478bd9Sstevel@tonic-gate #define LDI_DEV_T_ANY 0x2000 244*7c478bd9Sstevel@tonic-gate 245*7c478bd9Sstevel@tonic-gate /* 246*7c478bd9Sstevel@tonic-gate * Private flag that should ONLY be used by the LDI Framework 247*7c478bd9Sstevel@tonic-gate * to indicate a property search of an unbound dlpi2 dip. 248*7c478bd9Sstevel@tonic-gate * The LDI property lookup interfaces will set this flag if 249*7c478bd9Sstevel@tonic-gate * it is determined that the dip representing a dlpi-style2 250*7c478bd9Sstevel@tonic-gate * driver is currently unbound (dip == NULL) at the time of 251*7c478bd9Sstevel@tonic-gate * the property lookup request. 252*7c478bd9Sstevel@tonic-gate */ 253*7c478bd9Sstevel@tonic-gate #define DDI_UNBND_DLPI2 0x4000 254*7c478bd9Sstevel@tonic-gate 255*7c478bd9Sstevel@tonic-gate /* 256*7c478bd9Sstevel@tonic-gate * Private flag that indicates that a typed interface that predates typed 257*7c478bd9Sstevel@tonic-gate * properties is being used - the framework should set additional typed flags 258*7c478bd9Sstevel@tonic-gate * (DDI_PROP_TYPE_INT64) when expanding search to DDI_PROP_TYPE_ANY. 259*7c478bd9Sstevel@tonic-gate */ 260*7c478bd9Sstevel@tonic-gate #define DDI_PROP_CONSUMER_TYPED 0x8000 261*7c478bd9Sstevel@tonic-gate 262*7c478bd9Sstevel@tonic-gate /* 263*7c478bd9Sstevel@tonic-gate * Private flag that indicates that the ldi is doing a driver prop_op 264*7c478bd9Sstevel@tonic-gate * call to check for driver dynamic properties. This request should 265*7c478bd9Sstevel@tonic-gate * not be passed onto the common property lookup framework since all 266*7c478bd9Sstevel@tonic-gate * the ldi property interface are typed and driver prop_op lookups are 267*7c478bd9Sstevel@tonic-gate * not. 268*7c478bd9Sstevel@tonic-gate */ 269*7c478bd9Sstevel@tonic-gate #define DDI_PROP_DYNAMIC 0x10000 270*7c478bd9Sstevel@tonic-gate 271*7c478bd9Sstevel@tonic-gate 272*7c478bd9Sstevel@tonic-gate /* 273*7c478bd9Sstevel@tonic-gate * DDI_DEV_T_NONE: When creating, property is not associated with 274*7c478bd9Sstevel@tonic-gate * particular dev_t. 275*7c478bd9Sstevel@tonic-gate * DDI_DEV_T_ANY: Wildcard dev_t when searching properties. 276*7c478bd9Sstevel@tonic-gate * DDI_MAJOR_T_UNKNOWN Used when a driver does not know its dev_t during 277*7c478bd9Sstevel@tonic-gate * a property create. 278*7c478bd9Sstevel@tonic-gate */ 279*7c478bd9Sstevel@tonic-gate 280*7c478bd9Sstevel@tonic-gate #define DDI_DEV_T_NONE ((dev_t)-1) 281*7c478bd9Sstevel@tonic-gate #define DDI_DEV_T_ANY ((dev_t)-2) 282*7c478bd9Sstevel@tonic-gate #define DDI_MAJOR_T_UNKNOWN ((major_t)0) 283*7c478bd9Sstevel@tonic-gate 284*7c478bd9Sstevel@tonic-gate /* 285*7c478bd9Sstevel@tonic-gate * Some DDI property names... 286*7c478bd9Sstevel@tonic-gate */ 287*7c478bd9Sstevel@tonic-gate 288*7c478bd9Sstevel@tonic-gate /* 289*7c478bd9Sstevel@tonic-gate * One of the following boolean properties shall be defined in the 290*7c478bd9Sstevel@tonic-gate * root node, and defines the addressing mode understood by the root 291*7c478bd9Sstevel@tonic-gate * node of the implementation.... 292*7c478bd9Sstevel@tonic-gate */ 293*7c478bd9Sstevel@tonic-gate 294*7c478bd9Sstevel@tonic-gate #define DDI_RELATIVE_ADDRESSING "relative-addressing" 295*7c478bd9Sstevel@tonic-gate #define DDI_GENERIC_ADDRESSING "generic-addressing" 296*7c478bd9Sstevel@tonic-gate 297*7c478bd9Sstevel@tonic-gate /* 298*7c478bd9Sstevel@tonic-gate * Common property encoded data search routine. Returns the encoded data 299*7c478bd9Sstevel@tonic-gate * in valuep. Match is done on dip, dev, data type (in flags), and name. 300*7c478bd9Sstevel@tonic-gate */ 301*7c478bd9Sstevel@tonic-gate int ddi_prop_search_common(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, 302*7c478bd9Sstevel@tonic-gate uint_t flags, char *name, void *valuep, uint_t *lengthp); 303*7c478bd9Sstevel@tonic-gate 304*7c478bd9Sstevel@tonic-gate 305*7c478bd9Sstevel@tonic-gate /* 306*7c478bd9Sstevel@tonic-gate * Property debugging support in kernel... 307*7c478bd9Sstevel@tonic-gate */ 308*7c478bd9Sstevel@tonic-gate 309*7c478bd9Sstevel@tonic-gate /* 310*7c478bd9Sstevel@tonic-gate * Property debugging support... Be careful about enabling this when 311*7c478bd9Sstevel@tonic-gate * you are tipping in to the console. Undefine PROP_DEBUG to remove 312*7c478bd9Sstevel@tonic-gate * all support from the code. (c.f. autoconf.c and zs_common.c) 313*7c478bd9Sstevel@tonic-gate * 314*7c478bd9Sstevel@tonic-gate * It does no good to enable this if the rest of the kernel was built with 315*7c478bd9Sstevel@tonic-gate * this disabled (specifically, the core kernel module.) 316*7c478bd9Sstevel@tonic-gate * 317*7c478bd9Sstevel@tonic-gate * #define DDI_PROP_DEBUG 1 318*7c478bd9Sstevel@tonic-gate */ 319*7c478bd9Sstevel@tonic-gate 320*7c478bd9Sstevel@tonic-gate #ifdef DDI_PROP_DEBUG 321*7c478bd9Sstevel@tonic-gate #define ddi_prop_printf if (ddi_prop_debug_flag != 0) printf 322*7c478bd9Sstevel@tonic-gate 323*7c478bd9Sstevel@tonic-gate /* 324*7c478bd9Sstevel@tonic-gate * Returns prev value of debugging flag, non-zero enables debug printf's 325*7c478bd9Sstevel@tonic-gate */ 326*7c478bd9Sstevel@tonic-gate 327*7c478bd9Sstevel@tonic-gate int ddi_prop_debug(int enable); 328*7c478bd9Sstevel@tonic-gate 329*7c478bd9Sstevel@tonic-gate #endif /* DDI_PROP_DEBUG */ 330*7c478bd9Sstevel@tonic-gate 331*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus 332*7c478bd9Sstevel@tonic-gate } 333*7c478bd9Sstevel@tonic-gate #endif 334*7c478bd9Sstevel@tonic-gate 335*7c478bd9Sstevel@tonic-gate #endif /* _SYS_DDIPROPDEFS_H */ 336