xref: /titanic_50/usr/src/uts/sun4u/sys/rmc_comm_hproto.h (revision 733a5356058ae0150a67d61f0ad8e5260d2acae3)
1 /*
2  * Copyright 2001-2003 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef	_SYS_RMC_COMM_HPROTO_H
7 #define	_SYS_RMC_COMM_HPROTO_H
8 
9 #pragma ident	"%Z%%M%	%I%	%E% SMI"
10 
11 #ifdef	__cplusplus
12 extern "C" {
13 #endif
14 
15 /*
16  * data types used in the data protocol fields
17  */
18 
19 typedef unsigned char rsci8;
20 typedef unsigned short rsci16;
21 
22 typedef short rscis16;
23 
24 #ifdef _LP64
25 typedef unsigned int rsci32;
26 typedef unsigned long rsci64;
27 #else
28 typedef unsigned long rsci32;
29 typedef unsigned long long rsci64;
30 #endif
31 
32 /*
33  * handle definition. Handles are used in the high-level data protocol
34  * to identify FRU, sensors (temperature, voltage), and so on.
35  */
36 
37 typedef rsci16 dp_handle_t;
38 
39 #define	DP_NULL_HANDLE		0xffff
40 
41 #define	DP_MAX_HANDLE_NAME	32
42 
43 #define	DP_NULL_MSG		0x00
44 
45 /*
46  * Supported message types and associated data types:
47  */
48 
49 #define	DP_RESET_RSC		0x7A
50 
51 #define	DP_RESET_RSC_R		0x5A
52 
53 #define	DP_UPDATE_FLASH		0x66
54 
55 #define	DP_UPDATE_FLASH_R	0x46
56 typedef struct dp_update_flash_r {
57 	rsci32	status;		/* completion code */
58 } dp_update_flash_r_t;
59 
60 #define	DP_RUN_TEST		0x74
61 typedef struct dp_run_test {
62 	rsci32	testno;		/* test number to run; see below. */
63 	rsci32	param_len;	/* # bytes in test parameter data. */
64 } dp_run_test_t;
65 /* followed by test parameters; see individual tests below. */
66 
67 #define	DP_RUN_TEST_R		0x54
68 typedef struct dp_run_test_r {
69 	rsci32	status;		/* 0 = test passed, otherwise see failure */
70 				/* codes below. */
71 	rsci32	idatalen;	/* # items in input data array */
72 	rsci32	odatalen;	/* # items in output data array */
73 #define	DP_MAX_RUN_TEST_DATALEN (DP_MAX_MSGLEN-32)/2
74 	rsci8	idata[DP_MAX_RUN_TEST_DATALEN];	/* input data array */
75 	rsci8	odata[DP_MAX_RUN_TEST_DATALEN];	/* output data array */
76 } dp_run_test_r_t;
77 
78 #define	RSC_TEST_PASSED		0
79 #define	RSC_TEST_SW_FAILURE	1
80 #define	RSC_TEST_BAD_DATA	2
81 #define	RSC_TEST_NO_RESPONSE	3
82 #define	RSC_TEST_BAD_CRC	4
83 #define	RSC_TEST_BAD_PARAMS	5
84 #define	RSC_TEST_NO_DEVICE	6
85 #define	RSC_TEST_DEV_SETUP_FAIL	7
86 #define	RSC_TEST_MEM_ALLOC_FAIL	8
87 #define	RSC_TEST_ENET_ADDR_FAIL	9
88 #define	RSC_TEST_DEV_INFO_FAIL	10
89 #define	RSC_TEST_NYI		255
90 
91 #define	DP_RSC_STATUS		0x73
92 
93 #define	DP_RSC_STATUS_R		0x53
94 typedef struct dp_rsc_status_r {
95 /* The first six fields here must not be changed to ensure that they  */
96 /* are the same in all versions of RSC, most notably when compared to */
97 /* 1.x. New fields must be added to the end of the structure. */
98 	rsci16	main_rev_major;
99 	rsci16	main_rev_minor;
100 	rsci16	bootmon_rev_major;
101 	rsci16	bootmon_rev_minor;
102 	rsci16	post_status;
103 	rsci16	nusers;		/* number of users currently logged in to */
104 				/* CLI.  */
105 /* Any new fields in the structure may be added after this point ONLY! */
106 	rsci16	release_rev_major;
107 	rsci16	release_rev_minor;
108 	rsci16	release_rev_micro;
109 	rsci16	main_rev_micro;
110 	rsci16	bootmon_rev_micro;
111 	rsci16	hardware_rev;
112 
113 	rsci32 bm_cksum;
114 	rsci8  rsc_build;
115 	char creationDate[256];
116 	rsci32 fw_cksum;
117 	rsci32 sys_mem;
118 	rsci32 nvram_version;
119 
120 } dp_rsc_status_r_t;
121 
122 #define	DP_SET_CFGVAR		0x76
123 typedef struct dp_set_cfgvar {
124 	rsci32	hidden;		/* boolean */
125 } dp_set_cfgvar_t;
126 
127 /* Data is variable name & new value as zero-terminated ascii strings. */
128 
129 #define	DP_SET_CFGVAR_R		0x56
130 typedef struct dp_set_cfgvar_r {
131 	rsci32	status;		/* completion code */
132 } dp_set_cfgvar_r_t;
133 
134 #define	DP_GET_CFGVAR		0x67
135 /* Data is variable name as zero-terminated ascii string. */
136 
137 #define	DP_GET_CFGVAR_R		0x47
138 typedef struct dp_get_cfgvar_r {
139 	rsci32	status;		/* completion code */
140 } dp_get_cfgvar_r_t;
141 /* followed by value of variable as a zero-terminated ascii string. */
142 
143 #define	DP_GET_CFGVAR_NAME	0x6E
144 /*
145  * Data is variable name as zero-terminated ascii string.  A zero-length
146  * string means 'return the name of the "first" variable.'
147  */
148 
149 #define	DP_GET_CFGVAR_NAME_R	0x4E
150 typedef struct dp_get_cfgvar_name_r {
151 	rsci32	status;		/* completion code */
152 } dp_get_cfgvar_name_r_t;
153 /* followed by name of "next" variable as a zero-terminated ascii string. */
154 
155 #define	DP_SET_DATE_TIME		0x64
156 #define	DP_SET_DATE_TIME_IGNORE_FIELD	0xFFFF
157 typedef struct dp_set_date_time {
158 	rsci32	year;		/* Full year, IE 1997 */
159 	rsci32	month;		/* 1 = Jan, 2 = Feb, etc. */
160 	rsci32	day;		/* Day of the month, 1 to 31. */
161 	rsci32	hour;		/* 0 to 23 */
162 	rsci32	minute;		/* 0 to 59 */
163 	rsci32	second;		/* 0 to 59 */
164 } dp_set_date_time_t;
165 
166 #define	DP_SET_DATE_TIME_R	0x44
167 typedef struct dp_set_date_time_r {
168 	rsci32	status;		/* 0 - succes, non-zero - fail. */
169 } dp_set_date_time_r_t;
170 
171 #define	DP_GET_DATE_TIME	0x65
172 #define	DP_GET_DATE_TIME_R	0x45
173 typedef struct dp_get_date_time_r {
174 	rsci32	status;		/* completion code */
175 	rsci32	current_datetime; /* in Unix format */
176 } dp_get_date_time_r_t;
177 /* followed by the date represented as a zero-terminated ascii string. */
178 
179 
180 #define	DP_SEND_ALERT		0x61
181 typedef struct dp_send_alert {
182 	rsci32	critical; /* boolean */
183 } dp_send_alert_t;
184 
185 #define	DP_SEND_ALERT_R		0x41
186 typedef struct dp_send_alert_r {
187 	rsci32	status;		/* completion code */
188 } dp_send_alert_r_t;
189 
190 #define	DP_GET_TEMP		0x78
191 
192 #define	DP_GET_TEMP_R		0x58
193 typedef struct dp_get_temp_r {
194 	rsci32	status;
195 	rsci32	current_temp;
196 } dp_get_temp_r_t;
197 
198 #define	DP_GET_SDP_VERSION	0x7B
199 
200 #define	DP_GET_SDP_VERSION_R	0x5B
201 typedef struct dp_get_sdp_version_r {
202 	rsci32	version;
203 } dp_get_sdp_version_r_t;
204 
205 #define	DP_GET_TOD_CLOCK	0x7C
206 
207 #define	DP_GET_TOD_CLOCK_R	0x5C
208 typedef struct dp_get_tod_clock_r {
209 	rsci32	current_tod;
210 } dp_get_tod_clock_r_t;
211 
212 #define	DP_MAX_LOGSIZE		(DP_MAX_MSGLEN-24)
213 
214 #define	DP_GET_EVENT_LOG	0x7D
215 
216 #define	DP_GET_EVENT_LOG_R	0x5D
217 typedef struct dp_get_event_log_r {
218 	rsci32	entry_count;
219 	rsci8	data[DP_MAX_LOGSIZE];
220 } dp_get_event_log_r_t;
221 
222 typedef struct dp_event_log_entry {
223 	rsci32	eventTime;
224 	rsci32	eventId;
225 	rsci32	paramLen;
226 	char	param[256];
227 } dp_event_log_entry_t;
228 
229 #define	DP_GET_PCMCIA_INFO	0x7E
230 
231 #define	DP_GET_PCMCIA_INFO_R	0x5E
232 typedef struct dp_get_pcmcia_info_r {
233 	rsci32	card_present;	/* true=present, false=no card */
234 	rsci32	idInfoLen;
235 	rsci8	idInfo[256];
236 } dp_get_pcmcia_info_r_t;
237 
238 
239 #define	DP_USER_MAX		16
240 #define	DP_USER_NAME_SIZE	16
241 
242 /* User sub-commands */
243 #define	DP_USER_CMD_ADD		0x1
244 #define	DP_USER_CMD_DEL		0x2
245 #define	DP_USER_CMD_SHOW	0x3
246 #define	DP_USER_CMD_PASSWORD	0x4
247 #define	DP_USER_CMD_PERM	0x5
248 
249 /*
250  * The following fields are used to set the user permissions.
251  * Each must be represented as a single bit in the parm field.
252  */
253 #define	DP_USER_PERM_C		0x1
254 #define	DP_USER_PERM_U		0x2
255 #define	DP_USER_PERM_A		0x4
256 #define	DP_USER_PERM_R		0x8
257 
258 /*
259  * values for parm for CMD_SHOW.  Anything other than 0 will show
260  * the user # up to and including DP_USER_MAX
261  */
262 #define	DP_USER_SHOW_USERNAME	0x0
263 
264 /* Error values for status */
265 #define	DP_ERR_USER_FULL	0x1  /* No free user slots */
266 #define	DP_ERR_USER_NONE	0x2  /* User does not exist */
267 #define	DP_ERR_USER_BAD		0x3  /* Malformed username */
268 #define	DP_ERR_USER_NACT	0x4  /* user # not activated */
269 #define	DP_ERR_USER_THERE	0x5  /* user already registered */
270 #define	DP_ERR_USER_PASSWD	0x6  /* invalid password */
271 #define	DP_ERR_USER_WARNING	0x7  /* Malformed username warning */
272 #define	DP_ERR_USER_NYI		0xFD /* Not yet implemented */
273 #define	DP_ERR_USER_UNDEF	0xFE /* Undefine error */
274 #define	DP_ERR_USER_CMD		0xFF /* Invalid Command */
275 
276 #define	DP_USER_ADM		0x50
277 /*
278  * The parm field is used by the permission command to set specific
279  *  permissions.  The parm field is also used by the show command to
280  * indicate if the user name is specified or not.
281  */
282 typedef struct dp_user_adm {
283 	rsci32	command;
284 	rsci32	parm;
285 } dp_user_adm_t;
286 /*
287  * followed by zero-terminated ascii strings.  All user commands
288  * are followed by the username. The password command is also
289  * followed by the password.
290  */
291 
292 #define	DP_USER_ADM_R		0x51
293 /*
294  * the response field is used to return the user permissions
295  * for the user permissions command. The response is also used
296  * to echo back the user selection for the show command.
297  */
298 typedef struct dp_user_adm_r {
299 	rsci32	status;		/* completion code */
300 	rsci32  command;	/* echo back adm command */
301 	rsci32	response;
302 } dp_user_adm_r_t;
303 /* followed by a zero-terminated ascii string for the show command.  */
304 
305 
306 #define	DP_MODEM_PASS		0
307 #define	DP_MODEM_FAIL		-1
308 
309 /* Commands used for rscadm modem_setup */
310 #define	DP_MODEM_CONNECT	0x30
311 #define	DP_MODEM_CONNECT_R	0x31
312 typedef struct dp_modem_connect_r {
313 	rsci32	status;
314 } dp_modem_connect_r_t;
315 
316 /* There is no reponse to a modem_data command */
317 /* The modem data command goes in both directions */
318 #define	DP_MODEM_DATA		0x32
319 /* followed by a zero-terminated ascii string */
320 
321 #define	DP_MODEM_DISCONNECT	0x34
322 #define	DP_MODEM_DISCONNECT_R	0x35
323 typedef struct dp_modem_disconnect_r {
324 	rsci32	status;
325 } dp_modem_disconnect_r_t;
326 
327 
328 #define	DP_GET_TICKCNT		0x22
329 #define	DP_GET_TICKCNT_R	0x23
330 typedef struct dp_get_tickcnt_r {
331 	rsci32	upper;		/* MSW of 64 bit tick count */
332 	rsci32	lower;		/* LSW of 64 bit tick count */
333 } dp_get_tickcnt_r_t;
334 
335 
336 #define	DP_SET_DEFAULT_CFG	0x72
337 
338 #define	DP_SET_DEFAULT_CFG_R	0x52
339 typedef struct dp_set_default_cfg_r {
340 	rsci32	status;
341 } dp_set_default_cfg_r_t;
342 
343 
344 #define	DP_GET_NETWORK_CFG	0x59
345 
346 #define	DP_GET_NETWORK_CFG_R	0x79
347 typedef struct dp_get_network_cfg_r {
348 	rsci32	status;
349 	char	ipMode[7];
350 	char	ipAddr[16];
351 	char	ipMask[16];
352 	char	ipGateway[16];
353 	char	ethAddr[18];
354 	char	ipDHCPServer[16];
355 } dp_get_network_cfg_r_t;
356 
357 
358 /*
359  * Parameters for DP_RUN_TEST message:
360  */
361 
362 /*
363  * Test routines need to know what the low-level protocol sync
364  * character is.
365  */
366 
367 #define	RSC_TEST_SERIAL		0
368 typedef struct rsc_serial_test {
369 	rsci32	testtype;
370 #define	RSC_SERIAL_TTYC_LB	0
371 #define	RSC_SERIAL_TTYC_LB_OFF	1
372 #define	RSC_SERIAL_TTYD_LB	2
373 #define	RSC_SERIAL_TTYD_LB_OFF	3
374 #define	RSC_SERIAL_TTYCD_LB	4
375 #define	RSC_SERIAL_TTYCD_LB_OFF	5
376 #define	RSC_SERIAL_TTYU_INT_LB	6
377 #define	RSC_SERIAL_TTYU_EXT_LB	7
378 	rsci32	baud;
379 	rsci32	passes;
380 	rsci32	datalen;
381 	rsci8	data[DP_MAX_MSGLEN-32];
382 } rsc_serial_test_t;
383 
384 #define	RSC_TEST_ENET		1
385 typedef struct rsc_enet_test {
386 	rsci32	testtype;
387 #define	RSC_ENET_INT_LB		0
388 #define	RSC_ENET_EXT_LB		1
389 #define	RSC_ENET_PING		2
390 #define	RSC_ENET_INT_PHY_LB	3
391 	rsci8	ip_addr[4];
392 	rsci32	passes;
393 	rsci32	datalen;
394 	rsci8	data[DP_MAX_MSGLEN-32];
395 } rsc_enet_test_t;
396 
397 #define	RSC_TEST_FLASH_CRC	2
398 typedef struct rsc_flash_crcs_r {
399 	rsci32	boot_crc;
400 	rsci32	main_crc;
401 } rsc_flash_crcs_r_t;
402 
403 #define	RSC_TEST_SEEPROM_CRC	3
404 typedef struct rsc_seeprom_crcs_r {
405 	rsci32	hdr_crc;
406 	rsci32	main_crc;
407 } rsc_seeprom_crcs_r_t;
408 
409 #define	RSC_TEST_FRU_SEEPROM_CRC 4
410 typedef struct rsc_fru_crcs_r {
411 	rsci32	ro_hdr_crc;
412 	rsci32	seg_sd_crc;
413 } rsc_fru_crcs_r_t;
414 
415 
416 /*
417  * new commands definitions
418  */
419 
420 #define	DP_GET_SYSINFO		0x20
421 
422 #define	DP_GET_SYSINFO_R	0x21
423 typedef struct dp_get_sysinfo_r {
424 	rsci8 maxTemp;		/* max number of temperature sensors */
425 	rsci8 maxFan;		/* max number of FANs */
426 	rsci8 maxPSU;		/* max number of PSUs slot */
427 	rsci8 maxLED;		/* max number of LEDs */
428 	rsci8 maxVolt;		/* max number of voltage sensors */
429 	rsci8 maxFRU;		/* max number of FRUs (field replac. unit)  */
430 	rsci8 maxCircuitBrks;	/* max number of circuit breakers */
431 	rsci8 keyswitch;	/* key switch setting value */
432 } dp_get_sysinfo_r_t;
433 
434 
435 #define	DP_GET_TEMPERATURES	0x24
436 typedef struct dp_get_temperatures {
437 	dp_handle_t handle;	/* handle of a temperature sensor */
438 				/* or <null handle> (0xffff) */
439 } dp_get_temperatures_t;
440 
441 /* Data is variable name & new value as zero-terminated ascii strings. */
442 
443 #define	DP_GET_TEMPERATURES_R	0x25
444 typedef rscis16		dp_tempr_t;
445 
446 enum sensor_status {
447 	DP_SENSOR_DATA_AVAILABLE = 0,
448 	DP_SENSOR_DATA_UNAVAILABLE,
449 	DP_SENSOR_NOT_PRESENT
450 };
451 
452 typedef struct dp_tempr_status {
453 	dp_handle_t	handle;
454 	rsci8		sensor_status; 	/* tells whether the reading is */
455 					/* available or not */
456 	dp_tempr_t	value;	/* temperature value (celsius). */
457 
458 	dp_tempr_t 	low_warning;
459 	dp_tempr_t 	low_soft_shutdown;
460 	dp_tempr_t 	low_hard_shutdown;
461 	dp_tempr_t 	high_warning;
462 	dp_tempr_t 	high_soft_shutdown;
463 	dp_tempr_t 	high_hard_shutdown;
464 
465 } dp_tempr_status_t;
466 
467 typedef struct dp_get_temperatures_r {
468 	rsci8			num_temps;
469 	dp_tempr_status_t	temp_status[1];
470 
471 } dp_get_temperatures_r_t;
472 
473 
474 #define	DP_GET_FAN_STATUS	0x26
475 typedef struct dp_get_fan_status {
476 	dp_handle_t handle;	/* handle of a temperature sensor */
477 				/* or <null handle> (0xffff) */
478 } dp_get_fan_status_t;
479 
480 #define	DP_GET_FAN_STATUS_R	0x27
481 
482 typedef struct dp_fan_status {
483 	dp_handle_t	handle;
484 	rsci8		sensor_status; 	/* tells whether the reading is */
485 					/* available or not */
486 	rsci8 		flag;
487 
488 #define	DP_FAN_PRESENCE		0x01	/* FAN presence (bit set=FAN present) */
489 #define	DP_FAN_SPEED_VAL_UNIT	0x02	/* speed unit	(bit set=relative, */
490 					/*		bit clear=RPM) */
491 #define	DP_FAN_STATUS		0x04	/* FAN status (bit set=error) */
492 
493 	rsci16		speed;	/* FAN speed. */
494 	rsci16		minspeed; /* minimum FAN speed warning threshold */
495 
496 } dp_fan_status_t;
497 
498 typedef struct dp_get_fan_status_r {
499 	rsci8		num_fans;
500 	dp_fan_status_t	fan_status[1];
501 
502 } dp_get_fan_status_r_t;
503 
504 
505 #define	DP_GET_PSU_STATUS	0x28
506 typedef struct dp_get_psu_status {
507 	dp_handle_t handle;	/* handle of a temperature sensor */
508 				/* or <null handle> (0xffff) */
509 } dp_get_psu_status_t;
510 
511 #define	DP_GET_PSU_STATUS_R	0x29
512 typedef struct dp_psu_status {
513 	dp_handle_t	handle;
514 	rsci8		sensor_status; 	/* tells whether the reading is */
515 					/* available or not */
516 	rsci16 		mask;		/* flag bit mask (feature presence) */
517 	rsci16 		flag;		/* status bits */
518 
519 #define	DP_PSU_PRESENCE			0x0001	/* PSU presence  */
520 #define	DP_PSU_OUTPUT_STATUS		0x0002	/* output status */
521 #define	DP_PSU_INPUT_STATUS		0x0004	/* input status */
522 #define	DP_PSU_SEC_INPUT_STATUS		0x0008	/* secondary input status */
523 #define	DP_PSU_OVERTEMP_FAULT		0x0010	/* over temperature fault */
524 #define	DP_PSU_FAN_FAULT    		0x0020	/* FAN fault */
525 #define	DP_PSU_FAIL_STATUS		0x0040	/* PSU generic fault */
526 #define	DP_PSU_OUTPUT_VLO_STATUS	0x0080	/* output under voltage */
527 #define	DP_PSU_OUTPUT_VHI_STATUS	0x0100	/* output over voltage */
528 #define	DP_PSU_OUTPUT_AHI_STATUS	0x0200	/* output over current */
529 #define	DP_PSU_ALERT_STATUS		0x0400	/* PSU alert indication */
530 #define	DP_PSU_PDCT_FAN			0x0800	/* predicted fan fail */
531 #define	DP_PSU_NR_WARNING		0x1000	/* non-redundancy condition */
532 
533 			/* presence: 	bit clear=not present */
534 			/*		bit set=present */
535 			/* status:	bit clear=ok */
536 			/*		bit set=generic fault */
537 } dp_psu_status_t;
538 
539 typedef struct dp_get_psu_status_r {
540 
541 	rsci8		num_psus;
542 	dp_psu_status_t	psu_status[1];
543 
544 } dp_get_psu_status_r_t;
545 
546 #define	DP_GET_FRU_STATUS	0x2A
547 typedef struct dp_get_fru_status {
548 	dp_handle_t handle;	/* handle of a hot pluggable unit */
549 				/* or <null handle> (0xffff)	  */
550 } dp_get_fru_status_t;
551 
552 
553 #define	DP_GET_FRU_STATUS_R	0x2B
554 typedef struct dp_fru_status {
555 
556 	dp_handle_t	handle;
557 	rsci8		sensor_status; 	/* tells whether the reading is */
558 					/* available or not */
559 	rsci8		presence;	/* 1=FRU present */
560 	rsci8		status;
561 
562 } dp_fru_status_t;
563 
564 enum dp_fru_status_type {
565 	DP_FRU_STATUS_OK = 1,
566 	DP_FRU_STATUS_FAILED,
567 	DP_FRU_STATUS_BLACKLISTED,
568 	DP_FRU_STATUS_UNKNOWN
569 };
570 
571 typedef struct dp_get_fru_status_r {
572 	rsci8		num_frus;
573 	dp_fru_status_t	fru_status[1];
574 
575 } dp_get_fru_status_r_t;
576 
577 /*
578  * DP_GET_DEVICE(_R) command is used to discover I2C devices dynamically
579  * (used by SunVTS)
580  */
581 #define	DP_GET_DEVICE		0x2C
582 
583 typedef struct dp_get_device {
584 	dp_handle_t	handle;	/* handle of a device or */
585 				/* <null handle>(0xffff) */
586 } dp_get_device_t;
587 
588 #define	DP_GET_DEVICE_R		0x2D
589 
590 #define	DP_MAX_DEVICE_TYPE_NAME	32
591 
592 typedef struct dp_device {
593 	dp_handle_t	handle;
594 	rsci8		presence;	/* 0 is not present, 1 is present */
595 	char		device_type[DP_MAX_DEVICE_TYPE_NAME];
596 } dp_device_t;
597 
598 typedef struct dp_get_device_r {
599 	rsci8		num_devices;
600 	dp_device_t	device[1];
601 } dp_get_device_r_t;
602 
603 
604 #define	DP_SET_CPU_SIGNATURE	0x33
605 
606 typedef struct dp_set_cpu_signature {
607 	int		cpu_id;		/* see PSARC 2000/205 for more */
608 	ushort_t	sig; 		/* information on the value/meaning */
609 	uchar_t		states;		/* of these fields */
610 	uchar_t		sub_state;
611 
612 } dp_cpu_signature_t;
613 
614 
615 #define	DP_SET_CPU_NODENAME	0x38
616 
617 #define	DP_MAX_NODENAME		256
618 
619 typedef struct dp_set_nodename {
620 	char		nodename[DP_MAX_NODENAME];
621 } dp_set_nodename_t;
622 
623 
624 #define	DP_GET_LED_STATE	0x3C
625 
626 typedef struct dp_get_led_state {
627 	dp_handle_t handle;	/* handle of a hot pluggable unit */
628 				/* or <null handle> (0xffff) */
629 } dp_get_led_state_t;
630 
631 #define	DP_GET_LED_STATE_R	0x3D
632 
633 typedef struct dp_led_state {
634 	dp_handle_t	handle;
635 	rsci8		sensor_status; 	/* tells whether the reading is */
636 					/* available or not */
637 	rsci8		state;
638 	rsci8		colour;
639 } dp_led_state_t;
640 
641 typedef struct dp_get_led_state_r {
642 	rsci8		num_leds;
643 	dp_led_state_t	led_state[1];
644 } dp_get_led_state_r_t;
645 
646 /* LED states */
647 
648 enum dp_led_states {
649 	DP_LED_OFF = 0,
650 	DP_LED_ON,
651 	DP_LED_FLASHING,
652 	DP_LED_BLINKING
653 };
654 
655 enum dp_led_colours {
656 	DP_LED_COLOUR_NONE = -1,
657 	DP_LED_COLOUR_ANY,
658 	DP_LED_COLOUR_WHITE,
659 	DP_LED_COLOUR_BLUE,
660 	DP_LED_COLOUR_GREEN,
661 	DP_LED_COLOUR_AMBER
662 };
663 
664 
665 #define	DP_SET_LED_STATE	0x3E
666 
667 typedef struct dp_set_led_state {
668 	dp_handle_t	handle;		/* handle of a LED */
669 	rsci8		state;
670 } dp_set_led_state_t;
671 
672 #define	DP_SET_LED_STATE_R	0x3F
673 typedef struct dp_set_led_state_r {
674 	rsci8		status;
675 } dp_set_led_state_r_t;
676 
677 enum dp_set_led_status {
678 	DP_SET_LED_OK = 0,
679 	DP_SET_LED_INVALID_HANDLE,
680 	DP_SET_LED_ERROR
681 };
682 
683 
684 #define	DP_GET_ALARM_STATE	0x68
685 
686 typedef struct dp_get_alarm_state {
687 	dp_handle_t handle;	/* handle of an alarm relay */
688 				/* or <null handle> (0xffff) */
689 } dp_get_alarm_state_t;
690 
691 #define	DP_GET_ALARM_STATE_R	0x69
692 
693 typedef struct dp_alarm_state {
694 	dp_handle_t	handle;
695 	rsci8		sensor_status; 	/* tells whether the reading is */
696 					/* available or not */
697 	rsci8		state;
698 } dp_alarm_state_t;
699 
700 typedef struct dp_get_alarm_state_r {
701 	rsci8		num_alarms;
702 	dp_alarm_state_t	alarm_state[1];
703 } dp_get_alarm_state_r_t;
704 
705 /* ALARM states */
706 
707 enum dp_alarm_states {
708 	DP_ALARM_OFF = 0,
709 	DP_ALARM_ON
710 };
711 
712 #define	DP_SET_ALARM_STATE	0x6A
713 
714 typedef struct dp_set_alarm_state {
715 	dp_handle_t	handle;		/* handle of a ALARM */
716 	rsci8		state;
717 } dp_set_alarm_state_t;
718 
719 #define	DP_SET_ALARM_STATE_R	0x6B
720 typedef struct dp_set_alarm_state_r {
721 	rsci8		status;
722 } dp_set_alarm_state_r_t;
723 
724 enum dp_set_alarm_status {
725 	DP_SET_ALARM_OK = 0,
726 	DP_SET_ALARM_INVALID_HANDLE,
727 	DP_SET_ALARM_ERROR
728 };
729 
730 
731 #define	DP_GET_VOLTS		0x42
732 
733 typedef struct dp_get_volts {
734 	dp_handle_t	handle;		/* handle of a voltage sensor */
735 } dp_get_volts_t;
736 
737 #define	DP_GET_VOLTS_R		0x43
738 
739 typedef rscis16		dp_volt_reading_t;	/* unit in mV */
740 
741 typedef struct dp_volt_status {
742 	dp_handle_t		handle;
743 	rsci8			sensor_status; 	/* tells whether the reading */
744 						/* is available or not */
745 	rsci8			status;		/* 0=ok, 1=error */
746 	dp_volt_reading_t	reading;	/* value in mV. */
747 	dp_volt_reading_t	low_warning;
748 	dp_volt_reading_t	low_soft_shutdown;
749 	dp_volt_reading_t	low_hard_shutdown;
750 	dp_volt_reading_t	high_warning;
751 	dp_volt_reading_t	high_soft_shutdown;
752 	dp_volt_reading_t	high_hard_shutdown;
753 
754 } dp_volt_status_t;
755 
756 typedef struct dp_get_volts_r {
757 	rsci8			num_volts;
758 	dp_volt_status_t	volt_status[1];
759 
760 } dp_get_volts_r_t;
761 
762 
763 #define	DP_GET_CIRCUIT_BRKS	0x62
764 
765 typedef struct dp_get_circuit_brks {
766 	dp_handle_t handle;	/* handle of a circuit breaker */
767 				/* or <null handle> (0xffff) */
768 } dp_get_circuit_brks_t;
769 
770 #define	DP_GET_CIRCUIT_BRKS_R	0x63
771 
772 typedef struct dp_circuit_brk_status {
773 	dp_handle_t	handle;
774 	rsci8		sensor_status; 	/* tells whether the reading is */
775 					/* available or not */
776 	rsci8		status;		/* 0=ok, 1=error */
777 
778 } dp_circuit_brk_status_t;
779 
780 typedef struct dp_get_circuit_brks_r {
781 	rsci8			num_circuit_brks;
782 	dp_circuit_brk_status_t	circuit_brk_status[1];
783 
784 } dp_get_circuit_brks_r_t;
785 
786 
787 #define	DP_SET_HOST_WATCHDOG	0x48
788 
789 typedef struct dp_set_host_watchdog {
790 	rsci8	enable;		/* 0=enable watchdog, 1=disable watchdog */
791 } dp_set_host_watchdog_t;
792 
793 
794 #define	DP_GET_HANDLE_NAME	0x4A
795 
796 typedef struct dp_get_handle_name {
797 	dp_handle_t	handle;
798 } dp_get_handle_name_t;
799 
800 #define	DP_GET_HANDLE_NAME_R	0x4B
801 
802 typedef struct dp_get_handle_name_r {
803 	dp_handle_t	handle;
804 	char 		name[DP_MAX_HANDLE_NAME];
805 } dp_get_handle_name_r_t;
806 
807 
808 #define	DP_GET_HANDLE		0x4C
809 
810 typedef struct dp_get_handle {
811 	char 		name[DP_MAX_HANDLE_NAME];
812 } dp_get_handle_t;
813 
814 #define	DP_GET_HANDLE_R		0x4D
815 
816 typedef struct dp_get_handle_r {
817 	dp_handle_t 	handle;
818 } dp_get_handle_r_t;
819 
820 
821 #define	DP_RMC_EVENTS		0x57
822 
823 typedef rsci16	dp_event_t;
824 
825 /*
826  * list of events
827  */
828 
829 enum rmc_events {
830 	RMC_INIT_EVENT	= 0x01,
831 	RMC_HPU_EVENT,
832 	RMC_ENV_EVENT,
833 	RMC_KEYSWITCH_EVENT,
834 	RMC_LOG_EVENT
835 };
836 
837 /*
838  * event data structures
839  */
840 enum rmc_hpu_events {
841 	RMC_HPU_INSERT_EVENT	= 0x20,
842 	RMC_HPU_REMOVE_EVENT,
843 	RMC_HPU_HWERROR_EVENT
844 };
845 
846 typedef struct dp_hpu_event {
847 	dp_handle_t	hpu_hdl;
848 	dp_event_t	sub_event;
849 
850 } dp_hpu_event_t;
851 
852 
853 enum rmc_env_events {
854 	RMC_ENV_WARNING_THRESHOLD_EVENT = 0x31,
855 	RMC_ENV_SHUTDOWN_THRESHOLD_EVENT,
856 	RMC_ENV_FAULT_EVENT,
857 	RMC_ENV_OK_EVENT
858 };
859 
860 typedef struct dp_env_event {
861 	dp_handle_t	env_hdl;
862 	dp_event_t	sub_event;
863 
864 } dp_env_event_t;
865 
866 
867 enum rmc_keyswitch_pos {
868 	RMC_KEYSWITCH_POS_UNKNOWN	= 0x00,
869 	RMC_KEYSWITCH_POS_NORMAL,
870 	RMC_KEYSWITCH_POS_DIAG,
871 	RMC_KEYSWITCH_POS_LOCKED,
872 	RMC_KEYSWITCH_POS_OFF
873 };
874 
875 typedef struct dp_keyswitch_event {
876 	rsci8	key_position;
877 } dp_keyswitch_event_t;
878 
879 
880 typedef struct dp_rmclog_event {
881 	int	log_record_size;
882 	rsci8	log_record[DP_MAX_LOGSIZE];
883 } dp_rmclog_event_t;
884 
885 typedef union dp_event_info {
886 	dp_hpu_event_t		ev_hpunot;
887 	dp_env_event_t		ev_envnot;
888 	dp_keyswitch_event_t	ev_keysw;
889 	dp_rmclog_event_t	ev_rmclog;
890 } dp_event_info_t;
891 
892 typedef struct dp_event_notification {
893 	dp_event_t	event;
894 	rsci32		event_seqno; 	/* event sequence number */
895 	rsci32		timestamp;	/* timestamp of the event */
896 	dp_event_info_t	event_info;	/* event information */
897 } dp_event_notification_t;
898 
899 #define	DP_RMC_EVENTS_R		0x5F
900 
901 typedef struct dp_event_notification_r {
902 	rsci32		event_seqno; 	/* event sequence number */
903 } dp_event_notification_r_t;
904 
905 #ifdef	__cplusplus
906 }
907 #endif
908 
909 #endif	/* _SYS_RMC_COMM_HPROTO_H */
910