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