4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1999-2001, 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _PSVC_OBJECTS_CLASS_H
28 #define _PSVC_OBJECTS_CLASS_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 * Platform Services Framework private definitions
44 /* Logical device class */
52 char previous_state
[32];
55 boolean_t previous_presence
;
58 int32_t (*constructor
)();
59 int32_t (*destructor
)();
60 int32_t (*get_attr
)();
61 int32_t (*set_attr
)();
65 EObj_t ld
; /* logical device */
67 int32_t lo_warn
; /* low warning threshold */
68 int32_t lo_shut
; /* low shutdown threshold */
70 int32_t hi_warn
; /* high warning threshold */
71 int32_t hi_shut
; /* high shutdown threshold */
76 EObj_t ld
; /* logical device */
81 float temp_differential
[PSVC_MAXERRORS
];
82 int16_t temp_differential_index
;
86 EObj_t ld
; /* logical device */
90 EObj_t ld
; /* logical device */
91 int32_t lo_warn
; /* low warning threshold */
92 int32_t lo_shut
; /* low shutdown threshold */
93 int32_t hi_warn
; /* high warning threshold */
94 int32_t hi_shut
; /* high shutdown threshold */
98 EObj_t ld
; /* logical device */
102 EObj_t ld
; /* logical device */
110 EObj_t ld
; /* logical device */
114 char locator_name
[32];
118 EObj_t ld
; /* logical device */
119 int32_t lo_warn
; /* low warning threshold */
120 int32_t lo_shut
; /* low shutdown threshold */
121 int32_t hi_warn
; /* high warning threshold */
122 int32_t hi_shut
; /* high shutdown threshold */
126 EObj_t ld
; /* logical device */
127 char switch_state
[32];
131 EObj_t ld
; /* logical device */
135 EObj_t ld
; /* logical device */
136 int32_t (*get_temperature
)();
137 int32_t (*get_fanspeed
)();
138 int32_t (*get_bit
)();
139 int32_t (*set_bit
)();
140 int32_t (*get_port
)();
141 int32_t (*set_port
)();
142 int32_t (*get_reg
)();
143 int32_t (*set_reg
)();
144 int32_t (*get_output
)();
145 int32_t (*set_output
)();
146 int32_t (*get_input
)();
156 char antecedent_id
[NAMELEN
];
158 char dependent_id
[NAMELEN
];
167 /* structure for translating string to id */
181 /* translate name to object (or table) pointer */
186 int32_t type
; /* object or table */
190 ENamePtr_t
*obj_tbl
; /* object name to pointer translation */
191 uint32_t obj_count
; /* number of objects */
192 uint32_t nextid
; /* next open object slot */
197 #define PSVC_MAX_TABLE_ARRAYS 10
200 ETable_Array tbl_arry
[PSVC_MAX_TABLE_ARRAYS
];
201 uint32_t total_obj_count
; /* Total number of objects */
202 EStringId_t
*othr_tbl
; /* assoc string to id translations */
203 uint32_t othr_count
; /* number of assoc strings */
204 EAssocList_t
*assoc_tbl
; /* associations between objects */
205 uint32_t assoc_count
; /* number of associations */
206 EDevice_t
*dev_tbl
; /* device paths */
207 uint32_t dev_count
; /* number of device paths */
208 FILE *fp
; /* config file */
209 pthread_mutex_t mutex
; /* multi threaded protection */
212 /* String lookup table for attributes */
213 static char *attr_str_tab
[] = {
217 "Previous-presence", /* 3 */
219 "Previous-state", /* 5 */
221 "FaultInformation", /* 7 */
226 "Led-color", /* 12 */
232 "Hw-hi-shut", /* 18 */
233 "Hw-lo-shut", /* 19 */
235 "Hysteresis", /* 21 */
238 "Temp_differential", /* 24 */
239 "Temp_differential_index", /* 25 */
240 "Sensor-value", /* 26 */
241 "Gpio-value", /* 27 */
243 "Control-value", /* 29 */
244 "Led-state", /* 30 */
245 "Switch-state", /* 31 */
246 "Probe-result", /* 32 */
247 "Table_value", /* 33 */
249 "Assoc_matches", /* 35 */
250 "Addr-spec", /* 36 */
251 "Object-id", /* 37 */
252 "Led-lit-count", /* 38 */
254 "IsLocator", /* 40 */
255 "LocatorName" /* 41 */
258 int ATTR_STR_TAB_SIZE
= sizeof (attr_str_tab
) / sizeof (char *);
264 #endif /* _PSVC_OBJECTS_CLASS_H */