xref: /illumos-gate/usr/src/cmd/picl/plugins/sun4u/chicago/envd/envd.h (revision cc6c5292fa8a241fe50604cf6a918edfbf7cd7d2)
1 /*
2  * CDDL HEADER START
3  *
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
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_ENVD_H
28 #define	_ENVD_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 #include <libintl.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * Chicago Platform Details
41  */
42 #define	MAX_SENSORS		8
43 #define	MAX_FANS		6
44 
45 /*
46  * Fan names and ids
47  */
48 #define	ENV_SYSTEM_FAN0		"system-fan0"
49 #define	ENV_SYSTEM_FAN1		"system-fan1"
50 #define	ENV_SYSTEM_FAN2		"system-fan2"
51 #define	ENV_SYSTEM_FAN3		"system-fan3"
52 #define	ENV_SYSTEM_FAN4		"system-fan4"
53 
54 #define	SYSTEM_FAN0_ID		0
55 #define	SYSTEM_FAN1_ID		1
56 #define	SYSTEM_FAN2_ID		2
57 #define	SYSTEM_FAN3_ID		3
58 #define	SYSTEM_FAN4_ID		4
59 
60 #define	CPU0_FAN_ID		SYSTEM_FAN0_ID
61 #define	CPU1_FAN_ID		SYSTEM_FAN1_ID
62 
63 /*
64  * Sensor names and ids
65  */
66 #define	SENSOR_CPU0		"cpu0"
67 #define	SENSOR_CPU1		"cpu1"
68 #define	SENSOR_MB		"MotherBoard"
69 #define	SENSOR_ADT7462		"ADT7462"
70 #define	SENSOR_LM95221		"LM95221"
71 #define	SENSOR_FIRE		"FireASIC"
72 #define	SENSOR_LSI1064		"LSI1064"
73 #define	SENSOR_FRONT_PANEL	"Front_panel"
74 
75 #define	CPU0_SENSOR_ID		0
76 #define	CPU1_SENSOR_ID		1
77 #define	ADT7462_SENSOR_ID	2
78 #define	MB_SENSOR_ID		3
79 #define	LM95221_SENSOR_ID	4
80 #define	FIRE_SENSOR_ID		5
81 #define	LSI1064_SENSOR_ID	6
82 #define	FRONT_PANEL_SENSOR_ID	7
83 
84 /*
85  * Hard disk sensor names and ids
86  */
87 #define	ENV_DISK0		"hard-disk0"
88 #define	ENV_DISK1		"hard-disk1"
89 #define	ENV_DISK2		"hard-disk2"
90 #define	ENV_DISK3		"hard-disk3"
91 
92 #define	DISK0_ID		0
93 #define	DISK1_ID		1
94 #define	DISK2_ID		2
95 #define	DISK3_ID		3
96 
97 /*
98  * Thresholds and other constants
99  */
100 #define	DISK_SCAN_INTERVAL		10
101 #define	DISK_HIGH_WARN_TEMPERATURE	55
102 #define	DISK_LOW_WARN_TEMPERATURE	5
103 #define	DISK_HIGH_SHUTDOWN_TEMPERATURE	60
104 #define	DISK_LOW_SHUTDOWN_TEMPERATURE	0
105 #define	DISK_INVALID_TEMP		0xFFFF
106 #define	LSI1064_VENDOR_ID		0x1000
107 #define	LSI1064_DEVICE_ID		0x50
108 #define	FAN_SCAN_INTERVAL		10
109 #define	SENSOR_SCAN_INTERVAL		2
110 #define	SENSOR_WARNING_DURATION		4
111 #define	SENSOR_WARNING_INTERVAL		30
112 #define	DISK_WARNING_INTERVAL		30
113 #define	DISK_WARNING_DURATION		20
114 #define	SENSOR_SHUTDOWN_INTERVAL	60
115 #define	DISK_SHUTDOWN_INTERVAL		30
116 #define	ENV_CONF_FILE			"envmodel.conf"
117 #define	TUNABLE_CONF_FILE		"piclenvd.conf"
118 #define	PM_DEVICE			"/dev/pm"
119 #define	SHUTDOWN_CMD			"/usr/sbin/shutdown -y -g 60 -i 5"
120 #define	PICL_PLUGINS_NODE		"plugins"
121 #define	PICL_ENVIRONMENTAL_NODE		"environmental"
122 
123 #define	MAX_RETRIES_FOR_FAN_FAULT	10
124 #define	MAX_FAN_RETRIES			14
125 #define	MAX_SENSOR_RETRIES		14
126 
127 #define	TACH_TO_RPM(tach)		(90000 * 60)/tach
128 
129 /*
130  * constants used for retrieving SMART data
131  */
132 #define	DEFAULT_SCSI_TIMEOUT		60
133 #define	IEC_PAGE			0x1C
134 #define	HDA_TEMP			0xc2
135 #define	DRIVE_TEMP			0xe7
136 #define	GET_SMART_INFO			0x31
137 #define	SMART_FIELDS			30
138 #define	REPORT_ON_REQUEST		0x6
139 #define	PAGE_FMT			4
140 #define	IEC_PAGE_SIZE			12
141 #define	SMART_FLAG_SIZE			2
142 #define	ATTRIBUTE_DATA_SIZE		8
143 #define	VENDOR_ATTR_SIZE		131
144 #define	SMART_RESERVED_SIZE		10
145 #define	COLLECTION_DATA_SIZE		6
146 
147 #define	DISK0_PHYSPATH	\
148 	"/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@0,0"
149 
150 #define	DISK1_PHYSPATH	\
151 	"/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@1,0"
152 
153 #define	DISK2_PHYSPATH  \
154 	"/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@2,0"
155 
156 #define	DISK3_PHYSPATH  \
157 	"/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@3,0"
158 
159 #define	ENV_DISK0_DEVFS	\
160 "/devices/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@0,0:a,raw"
161 
162 #define	ENV_DISK1_DEVFS	\
163 "/devices/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@1,0:a,raw"
164 
165 #define	ENV_DISK2_DEVFS \
166 "/devices/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@2,0:a,raw"
167 
168 #define	ENV_DISK3_DEVFS \
169 "/devices/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@3,0:a,raw"
170 
171 #define	DISK0_NODE_PATH	\
172 "name:/platform/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@0,0"
173 
174 #define	DISK1_NODE_PATH	\
175 "name:/platform/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@1,0"
176 
177 #define	DISK2_NODE_PATH \
178 "name:/platform/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@2,0"
179 
180 #define	DISK3_NODE_PATH \
181 "name:/platform/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1/sd@3,0"
182 
183 #define	SCSI_CONTROLLER_NODE_PATH	\
184 	"name:/platform/pci@1e,600000/pci@0/pci@a/pci@0/LSILogic,sas@1"
185 
186 /* CPU Path Names */
187 #define	CPU0_PATH		"_class:/jbus/cpu?ID=0"
188 #define	CPU1_PATH		"_class:/jbus/cpu?ID=1"
189 
190 #define	ENV_MONITOR_DEVFS	"/devices/ebus@1f,464000/env-monitor@3,0"
191 
192 
193 /*
194  * devfs-path for various fans and their min/max speeds
195  */
196 #define	ENV_SYSTEM_FAN0_DEVFS	\
197 	"/devices/ebus@1f,464000/env-monitor@3,0:fan_0"
198 #define	ENV_SYSTEM_FAN1_DEVFS	\
199 	"/devices/ebus@1f,464000/env-monitor@3,0:fan_1"
200 #define	ENV_SYSTEM_FAN2_DEVFS	\
201 	"/devices/ebus@1f,464000/env-monitor@3,0:fan_2"
202 #define	ENV_SYSTEM_FAN3_DEVFS	\
203 	"/devices/ebus@1f,464000/env-monitor@3,0:fan_3"
204 #define	ENV_SYSTEM_FAN4_DEVFS	\
205 	"/devices/ebus@1f,464000/env-monitor@3,0:fan_4"
206 
207 /* MIN and MAX SPEED are in RPM units */
208 
209 #define	CPU_FAN_SPEED_MIN	250
210 #define	CPU_FAN_SPEED_MAX	5000
211 
212 #define	SYSTEM_FAN_SPEED_MIN	250
213 #define	SYSTEM_FAN_SPEED_MAX	5000
214 
215 /*
216  * devfs-path for various temperature sensors and CPU platform path
217  */
218 #define	SENSOR_CPU0_DEVFS	\
219 	"/devices/ebus@1f,464000/env-monitor@3,0:cpu_0"
220 #define	SENSOR_CPU1_DEVFS	\
221 	"/devices/ebus@1f,464000/env-monitor@3,0:cpu_1"
222 #define	SENSOR_MB_DEVFS	\
223 	"/devices/ebus@1f,464000/env-monitor@3,0:mb"
224 #define	SENSOR_ADT7462_DEVFS	\
225 	"/devices/ebus@1f,464000/env-monitor@3,0:adt7462"
226 #define	SENSOR_LM95221_DEVFS	\
227 	"/devices/ebus@1f,464000/env-monitor@3,0:lm95221"
228 #define	SENSOR_FIRE_DEVFS	\
229 	"/devices/ebus@1f,464000/env-monitor@3,0:fire"
230 #define	SENSOR_LSI1064_DEVFS	\
231 	"/devices/ebus@1f,464000/env-monitor@3,0:lsi1064"
232 #define	SENSOR_FRONT_PANEL_DEVFS	\
233 	"/devices/ebus@1f,464000/env-monitor@3,0:front_panel"
234 
235 /*
236  * Temperature type
237  */
238 typedef int16_t tempr_t;
239 
240 /*
241  *				SEEPROM LAYOUT
242  *
243  *      The layout of environmental segment in the SEEPROM in Chicago is as
244  *      shown below. Note that this is a stripped-down version of the Envseg
245  *      Definition v2.0 (but compatible). In particular, piclenvd in Chicago
246  *      does not use the #FanEntries and the list of FANn_ID/FANn_DOFF
247  *      pairs, and it doesn't use the SensorPolicy and the list of
248  *      Measured/Corrected pairs for the temperature sensor values either.
249  *
250  *
251  *                   0         1         2         3         4         5
252  *		+---------+------------------+----------+---------+---------+
253  *	0x1800:	| HDR_TAG |      HDR_VER     |  HDR_LEN | HDR_CRC |  N_SEGS |
254  *		+---------+---------+--------+----------+---------+---------+
255  *	0x1806:	|     SEG1_NAME	    |	            SEG1_DESC               |
256  *		+-------------------+-------------------+-------------------+
257  *	0x180C:	|     SEG1_OFF	    |	  SEG1_LEN	|      SEG2_NAME    |
258  *		+-------------------+-------------------+-------------------+
259  *		~							    ~
260  *		.							    .
261  *		~							    ~
262  *		+-------------------+-------------------+-------------------+
263  *	0xXXXX:	|     SEGn_OFF	    |	  SEGn_LEN	|
264  *		+-------------------+-------------------+
265  *
266  *
267  *              +---------+---------+---------------------------------------+
268  *  ENVSEG_OFF:	| ESEG_VER| N_SNSRS |            SENSOR1_ID                 |
269  *              +---------+---------+---------------------------------------+
270  *	        |    SNSR1_DOFF     |            SENSOR2_ID                 |
271  *              +-------------------+---------------------------------------+
272  *		~							    ~
273  *		~							    ~
274  *		+-------------------+---------------------------------------+
275  *	        |    SNSRm_DOFF     |
276  *              +-------------------+
277  *
278  *
279  *		+---------+---------+--------+----------+---------+---------+
280  * SNSRk_DOFF:	| HI_POFF | HI_SHUT | HI_WARN| LO_WARN  | LO_SHUT | LO_POFF |
281  *              +-------------------+--------+----------+---------+---------+
282  */
283 
284 #define	I2C_DEVFS		"/devices/ebus@1f,464000/i2c@3,80"
285 #define	IOFRU_DEV		"front-io-fru-prom@0,a4:front-io-fru-prom"
286 #define	FRU_SEEPROM_NAME	"front-io-fru-prom"
287 
288 /*
289  * SEEPROM section header
290  */
291 #define	SSCN_TAG	0x08
292 #define	SSCN_VER	0x0001
293 #define	SSCN_OFFSET	0x1800
294 typedef struct {
295 	uint8_t sscn_tag;		/* section header tag */
296 	uint8_t sscn_ver[2];		/* section header version */
297 	uint8_t sscn_len;		/* section header length */
298 	uint8_t sscn_crc;		/* unused */
299 	uint8_t sscn_nsegs;		/* total number of segments */
300 } seeprom_scn_t;
301 
302 /*
303  * SEEPROM segment header
304  */
305 typedef struct {
306 	uint16_t sseg_name;		/* segment name */
307 	uint16_t sseg_desc[2];		/* segment descriptor */
308 	uint16_t sseg_off;		/* segment data offset */
309 	uint16_t sseg_len;		/* segment length */
310 } seeprom_seg_t;
311 #define	ENVSEG_NAME	0x4553		/* "ES" */
312 
313 /*
314  * Envseg layout V2 (stripped-down version)
315  */
316 typedef struct {
317 	uint8_t esb_high_power_off;
318 	uint8_t esb_high_shutdown;
319 	uint8_t esb_high_warning;
320 	uint8_t esb_low_warning;
321 	uint8_t esb_low_shutdown;
322 	uint8_t esb_low_power_off;
323 } es_sensor_blk_t;
324 
325 typedef struct {
326 	uint16_t ess_id[2];		/* unique sensor id (on this FRU) */
327 	uint16_t ess_off;		/* sensor data blk offset */
328 } es_sensor_t;
329 
330 #define	ENVSEG_VERSION	2
331 typedef struct {
332 	uint8_t esd_ver;		/* envseg version */
333 	uint8_t esd_nsensors;		/* envseg total number of sensor blks */
334 	es_sensor_t esd_sensors[1];	/* sensor table (variable length) */
335 } es_data_t;
336 
337 /*
338  * Macros to fetch 16 and 32 bit msb-to-lsb data from unaligned addresses
339  */
340 #define	GET_UNALIGN16(addr)	\
341 	(((*(uint8_t *)addr) << 8) | *((uint8_t *)addr + 1))
342 #define	GET_UNALIGN32(addr)	\
343 	(GET_UNALIGN16(addr) << 16) | GET_UNALIGN16((uint8_t *)addr + 2)
344 
345 /*
346  * Macros to check sensor/disk temperatures
347  */
348 #define	SENSOR_TEMP_IN_WARNING_RANGE(val, sensorp) \
349 	((val) > (sensorp)->es->esb_high_warning || \
350 	(val) < (char)((sensorp)->es->esb_low_warning))
351 
352 #define	SENSOR_TEMP_IN_SHUTDOWN_RANGE(val, sensorp) \
353 	((val) > (sensorp)->es->esb_high_shutdown || \
354 	(val) < (char)((sensorp)->es->esb_low_shutdown))
355 
356 #define	DISK_TEMP_IN_WARNING_RANGE(val, diskp) \
357 	((val) > (diskp)->high_warning || \
358 	(val) < (char)((diskp)->low_warning))
359 
360 #define	DISK_TEMP_IN_SHUTDOWN_RANGE(val, diskp) \
361 	((val) > (diskp)->high_shutdown || \
362 	(val) < (char)((diskp)->low_shutdown))
363 
364 #define	SENSOR_WARN		1
365 #define	SENSOR_OK		0
366 
367 #define	FAN_FAILED		1
368 #define	FAN_OK			0
369 
370 /*
371  * Default limits for sensors in case environmental segment is absent
372  */
373 #define	CPU0_HIGH_POWER_OFF		105
374 #define	CPU0_HIGH_SHUTDOWN		100
375 #define	CPU0_HIGH_WARNING		95
376 #define	CPU0_LOW_WARNING		5
377 #define	CPU0_LOW_SHUTDOWN		0
378 #define	CPU0_LOW_POWER_OFF		0
379 
380 #define	CPU1_HIGH_POWER_OFF		105
381 #define	CPU1_HIGH_SHUTDOWN		100
382 #define	CPU1_HIGH_WARNING		95
383 #define	CPU1_LOW_WARNING		5
384 #define	CPU1_LOW_SHUTDOWN		0
385 #define	CPU1_LOW_POWER_OFF		0
386 
387 #define	ADT7462_HIGH_POWER_OFF		80
388 #define	ADT7462_HIGH_SHUTDOWN		75
389 #define	ADT7462_HIGH_WARNING		70
390 #define	ADT7462_LOW_WARNING		5
391 #define	ADT7462_LOW_SHUTDOWN		0
392 #define	ADT7462_LOW_POWER_OFF		0
393 
394 #define	MB_HIGH_POWER_OFF		80
395 #define	MB_HIGH_SHUTDOWN		75
396 #define	MB_HIGH_WARNING			70
397 #define	MB_LOW_WARNING			5
398 #define	MB_LOW_SHUTDOWN			0
399 #define	MB_LOW_POWER_OFF		0
400 
401 #define	LM95221_HIGH_POWER_OFF		80
402 #define	LM95221_HIGH_SHUTDOWN		75
403 #define	LM95221_HIGH_WARNING		70
404 #define	LM95221_LOW_WARNING		5
405 #define	LM95221_LOW_SHUTDOWN		0
406 #define	LM95221_LOW_POWER_OFF		0
407 
408 #define	FIRE_HIGH_POWER_OFF		105
409 #define	FIRE_HIGH_SHUTDOWN		100
410 #define	FIRE_HIGH_WARNING		95
411 #define	FIRE_LOW_WARNING		5
412 #define	FIRE_LOW_SHUTDOWN		0
413 #define	FIRE_LOW_POWER_OFF		0
414 
415 #define	LSI1064_HIGH_POWER_OFF		105
416 #define	LSI1064_HIGH_SHUTDOWN		100
417 #define	LSI1064_HIGH_WARNING		95
418 #define	LSI1064_LOW_WARNING		5
419 #define	LSI1064_LOW_SHUTDOWN		0
420 #define	LSI1064_LOW_POWER_OFF		0
421 
422 #define	FRONT_PANEL_HIGH_POWER_OFF	75
423 #define	FRONT_PANEL_HIGH_SHUTDOWN	70
424 #define	FRONT_PANEL_HIGH_WARNING	60
425 #define	FRONT_PANEL_LOW_WARNING		5
426 #define	FRONT_PANEL_LOW_SHUTDOWN	0
427 #define	FRONT_PANEL_LOW_POWER_OFF	0
428 
429 /*
430  * Temperature sensor related data structure
431  */
432 typedef struct env_sensor {
433 	char		*name;			/* sensor name */
434 	char		*devfs_path;		/* sensor device devfs path */
435 	int		id;
436 	int		fd;			/* device file descriptor */
437 	es_sensor_blk_t	*es;
438 	int		error;			/* error flag */
439 	boolean_t 	present;		/* sensor present */
440 	tempr_t		cur_temp;		/* current temperature */
441 	time_t		warning_start;		/* warning start time (secs) */
442 	time_t		warning_tstamp;		/* last warning time (secs) */
443 	time_t		shutdown_tstamp;	/* shutdown temp time (secs) */
444 	boolean_t 	shutdown_initiated;	/* shutdown initated */
445 } env_sensor_t;
446 
447 extern	env_sensor_t *sensor_lookup(char *sensor_name);
448 extern	int get_temperature(env_sensor_t *, tempr_t *);
449 
450 typedef struct env_disk {
451 	char		*name;			/* disk name */
452 	char		*devfs_path;	/* disk device devfs path */
453 	char		*physpath;	/* used to be probe for IDLW TIME */
454 	char		*nodepath;	/* used to detect presence of disk */
455 	uchar_t		id;
456 	int		fd;		/* device file descriptor */
457 	boolean_t	present;	/* disk present */
458 	boolean_t	tpage_supported;	/* Temperature page */
459 	boolean_t	smart_supported;
460 	int		current_temp;
461 	int		ref_temp;
462 	int		reliability_temp;
463 	uchar_t  	high_shutdown;
464 	uchar_t  	high_warning;
465 	uchar_t  	low_warning;
466 	uchar_t  	low_shutdown;
467 	time_t		warning_start;		/* warning start time (secs) */
468 	time_t		warning_tstamp;		/* last warning time (secs) */
469 	time_t		shutdown_tstamp;	/* shutdown temp time (secs) */
470 	boolean_t 	shutdown_initiated;	/* shutdown initated */
471 } env_disk_t;
472 
473 extern	env_disk_t *disk_lookup(char *disk_name);
474 extern	int disk_temperature(env_disk_t *, tempr_t *);
475 
476 /*
477  * Fan information data structure
478  */
479 typedef int fanspeed_t;
480 
481 typedef struct env_fan {
482 	char		*name;			/* fan name */
483 	char		*devfs_path;	/* fan device devfs path */
484 	uchar_t		id;
485 	fanspeed_t	speed_min;		/* minimum speed */
486 	fanspeed_t	speed_max;		/* maximum speed */
487 	int		forced_speed;		/* forced (fixed) speed */
488 	int		fd;			/* device file descriptor */
489 	boolean_t	present;		/* fan present */
490 	int		last_status;		/* Fan status */
491 	uint8_t		cspeed;			/* Current speed (tach) */
492 	uint8_t		lspeed;			/* Last speed (tach) */
493 } env_fan_t;
494 
495 /*
496  * Tuneables
497  */
498 typedef struct env_tuneable {
499 	char		*name;
500 	char		type;
501 	void		*value;
502 	int		(*rfunc)(ptree_rarg_t *, void *);
503 	int		(*wfunc)(ptree_warg_t *, const void *);
504 	int		nbytes;
505 	picl_prophdl_t proph;
506 } env_tuneable_t;
507 
508 /*
509  * Smart structures
510  */
511 
512 typedef	struct smart_field {
513 	uint8_t id;
514 	uint8_t flags[SMART_FLAG_SIZE];
515 	uint8_t raw_data[ATTRIBUTE_DATA_SIZE];
516 	uint8_t	reserved;
517 } smart_attribute;
518 
519 typedef struct smart_struct {
520 	uint16_t	revision;		/* SMART version # */
521 	struct smart_field attribute[SMART_FIELDS];
522 			/* offline collection information */
523 	uint8_t		collection_status[COLLECTION_DATA_SIZE];
524 	uint16_t	capability;		/* SMART capability */
525 	uint8_t		reserved[SMART_RESERVED_SIZE];
526 	uint8_t		vendor_specific[VENDOR_ATTR_SIZE];
527 	uint8_t		checksum;		/* page checksum */
528 } smart_structure;
529 
530 extern	env_fan_t *fan_lookup(char *fan_name);
531 extern	int get_fan_speed(env_fan_t *, fanspeed_t *);
532 extern	int set_fan_speed(env_fan_t *, fanspeed_t);
533 
534 extern int env_debug;
535 extern void envd_log(int pri, const char *fmt, ...);
536 
537 /*
538  * Various messages
539  */
540 #define	ENVD_PLUGIN_INIT_FAILED		\
541 	gettext("SUNW_piclenvd: initialization failed!\n")
542 
543 #define	ENVD_PICL_SETUP_FAILED		\
544 	gettext("SUNW_piclenvd: PICL setup failed!\n")
545 
546 #define	PM_THREAD_CREATE_FAILED		\
547 	gettext("SUNW_piclenvd: pmthr thread creation failed!\n")
548 
549 #define	PM_THREAD_EXITING		\
550 	gettext("SUNW_piclenvd: pmthr exiting! errno:%d %s\n")
551 
552 #define	DISK_TEMP_THREAD_EXITING		\
553 	gettext("SUNW_piclenvd: Disk temp thread exiting."	\
554 	" Disk temperature will not be monitored. errno:%d %s\n")
555 
556 #define	ENVTHR_THREAD_CREATE_FAILED	\
557 	gettext("SUNW_piclenvd: envthr thread creation failed!\n")
558 
559 #define	ENV_SHUTDOWN_MSG		\
560 	gettext("SUNW_piclenvd: '%s' sensor temperature %d outside safe " \
561 	"limits (%d...%d). Shutting down the system.\n")
562 
563 #define	ENV_WARNING_MSG			\
564 	gettext("SUNW_piclenvd: '%s' sensor temperature %d outside safe " \
565 	"operating limits (%d...%d).\n")
566 
567 #define	ENV_FAN_OPEN_FAIL		\
568 	gettext("SUNW_piclenvd: can't open '%s' fan path:%s errno:%d %s\n")
569 
570 #define	ENV_SENSOR_OPEN_FAIL		\
571 	gettext("SUNW_piclenvd: can't open '%s' sensor path:%s errno:%d %s\n")
572 
573 #define	ENV_SENSOR_ACCESS_FAIL		\
574 	gettext("SUNW_piclenvd: can't access '%s' sensor errno:%d %s\n")
575 
576 #define	ENV_SENSOR_ACCESS_OK		\
577 	gettext("SUNW_piclenvd: '%s' sensor is accessible now.\n")
578 
579 #define	ENV_FAN_FAILURE_WARNING_MSG		\
580 	gettext("SUNW_piclenvd: %s has Failed.\n"	\
581 	"(rpm = %s status = %s)\n")
582 
583 #define	ENV_FAN_OK_MSG		\
584 	gettext("SUNW_piclenvd: %s is OKAY.\n")
585 
586 #define	ENV_FRU_OPEN_FAIL		\
587 	gettext("SUNW_piclenvd: can't open FRU SEEPROM path:%s errno:%d\n")
588 
589 #define	ENV_FRU_BAD_ENVSEG		\
590 	gettext("SUNW_piclenvd: version mismatch or environmental segment " \
591 		"header too short in FRU SEEPROM %s\n")
592 
593 #define	ENV_FRU_BAD_SCNHDR		\
594 	gettext("SUNW_piclenvd: invalid section header tag:%x version:%x\n")
595 
596 #define	ENV_FRU_NOMEM_FOR_SEG		\
597 	gettext("SUNW_piclenvd: cannot allocate %d bytes for env seg memory\n")
598 
599 #define	ENV_DEFAULT_LIMITS		\
600 	gettext("SUNW_piclenvd: error reading ES segment, using defaults\n")
601 
602 #ifdef	__cplusplus
603 }
604 #endif
605 
606 #endif	/* _ENVD_H */
607