xref: /onnv-gate/usr/src/uts/sun4u/sys/rmc_comm_hproto.h (revision 1182:d01b8d059bf5)
11103Sjbeloro /*
21103Sjbeloro  * CDDL HEADER START
31103Sjbeloro  *
41103Sjbeloro  * The contents of this file are subject to the terms of the
51103Sjbeloro  * Common Development and Distribution License (the "License").
61103Sjbeloro  * You may not use this file except in compliance with the License.
71103Sjbeloro  *
81103Sjbeloro  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
91103Sjbeloro  * or http://www.opensolaris.org/os/licensing.
101103Sjbeloro  * See the License for the specific language governing permissions
111103Sjbeloro  * and limitations under the License.
121103Sjbeloro  *
131103Sjbeloro  * When distributing Covered Code, include this CDDL HEADER in each
141103Sjbeloro  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
151103Sjbeloro  * If applicable, add the following below this CDDL HEADER, with the
161103Sjbeloro  * fields enclosed by brackets "[]" replaced with your own identifying
171103Sjbeloro  * information: Portions Copyright [yyyy] [name of copyright owner]
181103Sjbeloro  *
191103Sjbeloro  * CDDL HEADER END
201103Sjbeloro  */
211103Sjbeloro 
220Sstevel@tonic-gate /*
23467Ssc121708  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	_SYS_RMC_COMM_HPROTO_H
280Sstevel@tonic-gate #define	_SYS_RMC_COMM_HPROTO_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #ifdef	__cplusplus
330Sstevel@tonic-gate extern "C" {
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 
360Sstevel@tonic-gate /*
370Sstevel@tonic-gate  * data types used in the data protocol fields
380Sstevel@tonic-gate  */
390Sstevel@tonic-gate 
400Sstevel@tonic-gate typedef unsigned char rsci8;
410Sstevel@tonic-gate typedef unsigned short rsci16;
420Sstevel@tonic-gate 
430Sstevel@tonic-gate typedef short rscis16;
440Sstevel@tonic-gate 
450Sstevel@tonic-gate #ifdef _LP64
460Sstevel@tonic-gate typedef unsigned int rsci32;
470Sstevel@tonic-gate typedef unsigned long rsci64;
480Sstevel@tonic-gate #else
490Sstevel@tonic-gate typedef unsigned long rsci32;
500Sstevel@tonic-gate typedef unsigned long long rsci64;
510Sstevel@tonic-gate #endif
520Sstevel@tonic-gate 
530Sstevel@tonic-gate /*
540Sstevel@tonic-gate  * handle definition. Handles are used in the high-level data protocol
550Sstevel@tonic-gate  * to identify FRU, sensors (temperature, voltage), and so on.
560Sstevel@tonic-gate  */
570Sstevel@tonic-gate 
580Sstevel@tonic-gate typedef rsci16 dp_handle_t;
590Sstevel@tonic-gate 
600Sstevel@tonic-gate #define	DP_NULL_HANDLE		0xffff
610Sstevel@tonic-gate 
620Sstevel@tonic-gate #define	DP_MAX_HANDLE_NAME	32
630Sstevel@tonic-gate 
640Sstevel@tonic-gate #define	DP_NULL_MSG		0x00
650Sstevel@tonic-gate 
660Sstevel@tonic-gate /*
670Sstevel@tonic-gate  * Supported message types and associated data types:
680Sstevel@tonic-gate  */
690Sstevel@tonic-gate 
700Sstevel@tonic-gate #define	DP_RESET_RSC		0x7A
710Sstevel@tonic-gate 
720Sstevel@tonic-gate #define	DP_RESET_RSC_R		0x5A
730Sstevel@tonic-gate 
740Sstevel@tonic-gate #define	DP_UPDATE_FLASH		0x66
750Sstevel@tonic-gate 
760Sstevel@tonic-gate #define	DP_UPDATE_FLASH_R	0x46
770Sstevel@tonic-gate typedef struct dp_update_flash_r {
780Sstevel@tonic-gate 	rsci32	status;		/* completion code */
790Sstevel@tonic-gate } dp_update_flash_r_t;
800Sstevel@tonic-gate 
810Sstevel@tonic-gate #define	DP_RUN_TEST		0x74
820Sstevel@tonic-gate typedef struct dp_run_test {
830Sstevel@tonic-gate 	rsci32	testno;		/* test number to run; see below. */
840Sstevel@tonic-gate 	rsci32	param_len;	/* # bytes in test parameter data. */
850Sstevel@tonic-gate } dp_run_test_t;
860Sstevel@tonic-gate /* followed by test parameters; see individual tests below. */
870Sstevel@tonic-gate 
880Sstevel@tonic-gate #define	DP_RUN_TEST_R		0x54
890Sstevel@tonic-gate typedef struct dp_run_test_r {
900Sstevel@tonic-gate 	rsci32	status;		/* 0 = test passed, otherwise see failure */
910Sstevel@tonic-gate 				/* codes below. */
920Sstevel@tonic-gate 	rsci32	idatalen;	/* # items in input data array */
930Sstevel@tonic-gate 	rsci32	odatalen;	/* # items in output data array */
940Sstevel@tonic-gate #define	DP_MAX_RUN_TEST_DATALEN (DP_MAX_MSGLEN-32)/2
950Sstevel@tonic-gate 	rsci8	idata[DP_MAX_RUN_TEST_DATALEN];	/* input data array */
960Sstevel@tonic-gate 	rsci8	odata[DP_MAX_RUN_TEST_DATALEN];	/* output data array */
970Sstevel@tonic-gate } dp_run_test_r_t;
980Sstevel@tonic-gate 
990Sstevel@tonic-gate #define	RSC_TEST_PASSED		0
1000Sstevel@tonic-gate #define	RSC_TEST_SW_FAILURE	1
1010Sstevel@tonic-gate #define	RSC_TEST_BAD_DATA	2
1020Sstevel@tonic-gate #define	RSC_TEST_NO_RESPONSE	3
1030Sstevel@tonic-gate #define	RSC_TEST_BAD_CRC	4
1040Sstevel@tonic-gate #define	RSC_TEST_BAD_PARAMS	5
1050Sstevel@tonic-gate #define	RSC_TEST_NO_DEVICE	6
1060Sstevel@tonic-gate #define	RSC_TEST_DEV_SETUP_FAIL	7
1070Sstevel@tonic-gate #define	RSC_TEST_MEM_ALLOC_FAIL	8
1080Sstevel@tonic-gate #define	RSC_TEST_ENET_ADDR_FAIL	9
1090Sstevel@tonic-gate #define	RSC_TEST_DEV_INFO_FAIL	10
1100Sstevel@tonic-gate #define	RSC_TEST_NYI		255
1110Sstevel@tonic-gate 
1120Sstevel@tonic-gate #define	DP_RSC_STATUS		0x73
1130Sstevel@tonic-gate 
1140Sstevel@tonic-gate #define	DP_RSC_STATUS_R		0x53
1150Sstevel@tonic-gate typedef struct dp_rsc_status_r {
1160Sstevel@tonic-gate /* The first six fields here must not be changed to ensure that they  */
1170Sstevel@tonic-gate /* are the same in all versions of RSC, most notably when compared to */
1180Sstevel@tonic-gate /* 1.x. New fields must be added to the end of the structure. */
1190Sstevel@tonic-gate 	rsci16	main_rev_major;
1200Sstevel@tonic-gate 	rsci16	main_rev_minor;
1210Sstevel@tonic-gate 	rsci16	bootmon_rev_major;
1220Sstevel@tonic-gate 	rsci16	bootmon_rev_minor;
1230Sstevel@tonic-gate 	rsci16	post_status;
1240Sstevel@tonic-gate 	rsci16	nusers;		/* number of users currently logged in to */
1250Sstevel@tonic-gate 				/* CLI.  */
1260Sstevel@tonic-gate /* Any new fields in the structure may be added after this point ONLY! */
1270Sstevel@tonic-gate 	rsci16	release_rev_major;
1280Sstevel@tonic-gate 	rsci16	release_rev_minor;
1290Sstevel@tonic-gate 	rsci16	release_rev_micro;
1300Sstevel@tonic-gate 	rsci16	main_rev_micro;
1310Sstevel@tonic-gate 	rsci16	bootmon_rev_micro;
1320Sstevel@tonic-gate 	rsci16	hardware_rev;
1330Sstevel@tonic-gate 
1340Sstevel@tonic-gate 	rsci32 bm_cksum;
1350Sstevel@tonic-gate 	rsci8  rsc_build;
1360Sstevel@tonic-gate 	char creationDate[256];
1370Sstevel@tonic-gate 	rsci32 fw_cksum;
1380Sstevel@tonic-gate 	rsci32 sys_mem;
1390Sstevel@tonic-gate 	rsci32 nvram_version;
1400Sstevel@tonic-gate 
1410Sstevel@tonic-gate } dp_rsc_status_r_t;
1420Sstevel@tonic-gate 
1430Sstevel@tonic-gate #define	DP_SET_CFGVAR		0x76
1440Sstevel@tonic-gate typedef struct dp_set_cfgvar {
1450Sstevel@tonic-gate 	rsci32	hidden;		/* boolean */
1460Sstevel@tonic-gate } dp_set_cfgvar_t;
1470Sstevel@tonic-gate 
1480Sstevel@tonic-gate /* Data is variable name & new value as zero-terminated ascii strings. */
1490Sstevel@tonic-gate 
1500Sstevel@tonic-gate #define	DP_SET_CFGVAR_R		0x56
1510Sstevel@tonic-gate typedef struct dp_set_cfgvar_r {
1520Sstevel@tonic-gate 	rsci32	status;		/* completion code */
1530Sstevel@tonic-gate } dp_set_cfgvar_r_t;
1540Sstevel@tonic-gate 
1550Sstevel@tonic-gate #define	DP_GET_CFGVAR		0x67
1560Sstevel@tonic-gate /* Data is variable name as zero-terminated ascii string. */
1570Sstevel@tonic-gate 
1580Sstevel@tonic-gate #define	DP_GET_CFGVAR_R		0x47
1590Sstevel@tonic-gate typedef struct dp_get_cfgvar_r {
1600Sstevel@tonic-gate 	rsci32	status;		/* completion code */
1610Sstevel@tonic-gate } dp_get_cfgvar_r_t;
1620Sstevel@tonic-gate /* followed by value of variable as a zero-terminated ascii string. */
1630Sstevel@tonic-gate 
1640Sstevel@tonic-gate #define	DP_GET_CFGVAR_NAME	0x6E
1650Sstevel@tonic-gate /*
1660Sstevel@tonic-gate  * Data is variable name as zero-terminated ascii string.  A zero-length
1670Sstevel@tonic-gate  * string means 'return the name of the "first" variable.'
1680Sstevel@tonic-gate  */
1690Sstevel@tonic-gate 
1700Sstevel@tonic-gate #define	DP_GET_CFGVAR_NAME_R	0x4E
1710Sstevel@tonic-gate typedef struct dp_get_cfgvar_name_r {
1720Sstevel@tonic-gate 	rsci32	status;		/* completion code */
1730Sstevel@tonic-gate } dp_get_cfgvar_name_r_t;
1740Sstevel@tonic-gate /* followed by name of "next" variable as a zero-terminated ascii string. */
1750Sstevel@tonic-gate 
1760Sstevel@tonic-gate #define	DP_SET_DATE_TIME		0x64
1770Sstevel@tonic-gate #define	DP_SET_DATE_TIME_IGNORE_FIELD	0xFFFF
1780Sstevel@tonic-gate typedef struct dp_set_date_time {
1790Sstevel@tonic-gate 	rsci32	year;		/* Full year, IE 1997 */
1800Sstevel@tonic-gate 	rsci32	month;		/* 1 = Jan, 2 = Feb, etc. */
1810Sstevel@tonic-gate 	rsci32	day;		/* Day of the month, 1 to 31. */
1820Sstevel@tonic-gate 	rsci32	hour;		/* 0 to 23 */
1830Sstevel@tonic-gate 	rsci32	minute;		/* 0 to 59 */
1840Sstevel@tonic-gate 	rsci32	second;		/* 0 to 59 */
1850Sstevel@tonic-gate } dp_set_date_time_t;
1860Sstevel@tonic-gate 
1870Sstevel@tonic-gate #define	DP_SET_DATE_TIME_R	0x44
1880Sstevel@tonic-gate typedef struct dp_set_date_time_r {
1890Sstevel@tonic-gate 	rsci32	status;		/* 0 - succes, non-zero - fail. */
1900Sstevel@tonic-gate } dp_set_date_time_r_t;
1910Sstevel@tonic-gate 
1920Sstevel@tonic-gate #define	DP_GET_DATE_TIME	0x65
1930Sstevel@tonic-gate #define	DP_GET_DATE_TIME_R	0x45
1940Sstevel@tonic-gate typedef struct dp_get_date_time_r {
1950Sstevel@tonic-gate 	rsci32	status;		/* completion code */
1960Sstevel@tonic-gate 	rsci32	current_datetime; /* in Unix format */
1970Sstevel@tonic-gate } dp_get_date_time_r_t;
1980Sstevel@tonic-gate /* followed by the date represented as a zero-terminated ascii string. */
1990Sstevel@tonic-gate 
2000Sstevel@tonic-gate 
2010Sstevel@tonic-gate #define	DP_SEND_ALERT		0x61
2020Sstevel@tonic-gate typedef struct dp_send_alert {
2030Sstevel@tonic-gate 	rsci32	critical; /* boolean */
2040Sstevel@tonic-gate } dp_send_alert_t;
2050Sstevel@tonic-gate 
2060Sstevel@tonic-gate #define	DP_SEND_ALERT_R		0x41
2070Sstevel@tonic-gate typedef struct dp_send_alert_r {
2080Sstevel@tonic-gate 	rsci32	status;		/* completion code */
2090Sstevel@tonic-gate } dp_send_alert_r_t;
2100Sstevel@tonic-gate 
2110Sstevel@tonic-gate #define	DP_GET_TEMP		0x78
2120Sstevel@tonic-gate 
2130Sstevel@tonic-gate #define	DP_GET_TEMP_R		0x58
2140Sstevel@tonic-gate typedef struct dp_get_temp_r {
2150Sstevel@tonic-gate 	rsci32	status;
2160Sstevel@tonic-gate 	rsci32	current_temp;
2170Sstevel@tonic-gate } dp_get_temp_r_t;
2180Sstevel@tonic-gate 
219*1182Sfw157321 /*
220*1182Sfw157321  * Implementations using this level of protocol or above,
221*1182Sfw157321  * will generate a response to any supplied command code.
222*1182Sfw157321  * This doesn't mean they will support a given command.
223*1182Sfw157321  * It only means that they will generate a response to that
224*1182Sfw157321  * command.
225*1182Sfw157321  */
226*1182Sfw157321 #define	SDP_RESPONDS_TO_ALL_CMDS	3
227*1182Sfw157321 
2280Sstevel@tonic-gate #define	DP_GET_SDP_VERSION	0x7B
2290Sstevel@tonic-gate 
2300Sstevel@tonic-gate #define	DP_GET_SDP_VERSION_R	0x5B
2310Sstevel@tonic-gate typedef struct dp_get_sdp_version_r {
2320Sstevel@tonic-gate 	rsci32	version;
2330Sstevel@tonic-gate } dp_get_sdp_version_r_t;
2340Sstevel@tonic-gate 
2350Sstevel@tonic-gate #define	DP_GET_TOD_CLOCK	0x7C
2360Sstevel@tonic-gate 
2370Sstevel@tonic-gate #define	DP_GET_TOD_CLOCK_R	0x5C
2380Sstevel@tonic-gate typedef struct dp_get_tod_clock_r {
2390Sstevel@tonic-gate 	rsci32	current_tod;
2400Sstevel@tonic-gate } dp_get_tod_clock_r_t;
2410Sstevel@tonic-gate 
2420Sstevel@tonic-gate #define	DP_MAX_LOGSIZE		(DP_MAX_MSGLEN-24)
2430Sstevel@tonic-gate 
2440Sstevel@tonic-gate #define	DP_GET_EVENT_LOG	0x7D
2450Sstevel@tonic-gate 
2461103Sjbeloro /*
2471103Sjbeloro  * NOTE: changing this or the dp_event_log_entry structure will almost
2481103Sjbeloro  * certainly require changing the code that parses these structures
2491103Sjbeloro  * in scadm.  See src/cmd/scadm/sparcv9/mpxu/common/eventlog.c.
2501103Sjbeloro  */
2510Sstevel@tonic-gate #define	DP_GET_EVENT_LOG_R	0x5D
2520Sstevel@tonic-gate typedef struct dp_get_event_log_r {
2530Sstevel@tonic-gate 	rsci32	entry_count;
2540Sstevel@tonic-gate 	rsci8	data[DP_MAX_LOGSIZE];
2550Sstevel@tonic-gate } dp_get_event_log_r_t;
2560Sstevel@tonic-gate 
2570Sstevel@tonic-gate typedef struct dp_event_log_entry {
2580Sstevel@tonic-gate 	rsci32	eventTime;
2590Sstevel@tonic-gate 	rsci32	eventId;
2600Sstevel@tonic-gate 	rsci32	paramLen;
2610Sstevel@tonic-gate 	char	param[256];
2620Sstevel@tonic-gate } dp_event_log_entry_t;
2630Sstevel@tonic-gate 
2640Sstevel@tonic-gate #define	DP_GET_PCMCIA_INFO	0x7E
2650Sstevel@tonic-gate 
2660Sstevel@tonic-gate #define	DP_GET_PCMCIA_INFO_R	0x5E
2670Sstevel@tonic-gate typedef struct dp_get_pcmcia_info_r {
2680Sstevel@tonic-gate 	rsci32	card_present;	/* true=present, false=no card */
2690Sstevel@tonic-gate 	rsci32	idInfoLen;
2700Sstevel@tonic-gate 	rsci8	idInfo[256];
2710Sstevel@tonic-gate } dp_get_pcmcia_info_r_t;
2720Sstevel@tonic-gate 
2730Sstevel@tonic-gate 
2740Sstevel@tonic-gate #define	DP_USER_MAX		16
2750Sstevel@tonic-gate #define	DP_USER_NAME_SIZE	16
2760Sstevel@tonic-gate 
2770Sstevel@tonic-gate /* User sub-commands */
2780Sstevel@tonic-gate #define	DP_USER_CMD_ADD		0x1
2790Sstevel@tonic-gate #define	DP_USER_CMD_DEL		0x2
2800Sstevel@tonic-gate #define	DP_USER_CMD_SHOW	0x3
2810Sstevel@tonic-gate #define	DP_USER_CMD_PASSWORD	0x4
2820Sstevel@tonic-gate #define	DP_USER_CMD_PERM	0x5
2830Sstevel@tonic-gate 
2840Sstevel@tonic-gate /*
2850Sstevel@tonic-gate  * The following fields are used to set the user permissions.
2860Sstevel@tonic-gate  * Each must be represented as a single bit in the parm field.
2870Sstevel@tonic-gate  */
2880Sstevel@tonic-gate #define	DP_USER_PERM_C		0x1
2890Sstevel@tonic-gate #define	DP_USER_PERM_U		0x2
2900Sstevel@tonic-gate #define	DP_USER_PERM_A		0x4
2910Sstevel@tonic-gate #define	DP_USER_PERM_R		0x8
2920Sstevel@tonic-gate 
2930Sstevel@tonic-gate /*
2940Sstevel@tonic-gate  * values for parm for CMD_SHOW.  Anything other than 0 will show
2950Sstevel@tonic-gate  * the user # up to and including DP_USER_MAX
2960Sstevel@tonic-gate  */
2970Sstevel@tonic-gate #define	DP_USER_SHOW_USERNAME	0x0
2980Sstevel@tonic-gate 
2990Sstevel@tonic-gate /* Error values for status */
3000Sstevel@tonic-gate #define	DP_ERR_USER_FULL	0x1  /* No free user slots */
3010Sstevel@tonic-gate #define	DP_ERR_USER_NONE	0x2  /* User does not exist */
3020Sstevel@tonic-gate #define	DP_ERR_USER_BAD		0x3  /* Malformed username */
3030Sstevel@tonic-gate #define	DP_ERR_USER_NACT	0x4  /* user # not activated */
3040Sstevel@tonic-gate #define	DP_ERR_USER_THERE	0x5  /* user already registered */
3050Sstevel@tonic-gate #define	DP_ERR_USER_PASSWD	0x6  /* invalid password */
3060Sstevel@tonic-gate #define	DP_ERR_USER_WARNING	0x7  /* Malformed username warning */
3070Sstevel@tonic-gate #define	DP_ERR_USER_NYI		0xFD /* Not yet implemented */
3080Sstevel@tonic-gate #define	DP_ERR_USER_UNDEF	0xFE /* Undefine error */
3090Sstevel@tonic-gate #define	DP_ERR_USER_CMD		0xFF /* Invalid Command */
3100Sstevel@tonic-gate 
3110Sstevel@tonic-gate #define	DP_USER_ADM		0x50
3120Sstevel@tonic-gate /*
3130Sstevel@tonic-gate  * The parm field is used by the permission command to set specific
3140Sstevel@tonic-gate  *  permissions.  The parm field is also used by the show command to
3150Sstevel@tonic-gate  * indicate if the user name is specified or not.
3160Sstevel@tonic-gate  */
3170Sstevel@tonic-gate typedef struct dp_user_adm {
3180Sstevel@tonic-gate 	rsci32	command;
3190Sstevel@tonic-gate 	rsci32	parm;
3200Sstevel@tonic-gate } dp_user_adm_t;
3210Sstevel@tonic-gate /*
3220Sstevel@tonic-gate  * followed by zero-terminated ascii strings.  All user commands
3230Sstevel@tonic-gate  * are followed by the username. The password command is also
3240Sstevel@tonic-gate  * followed by the password.
3250Sstevel@tonic-gate  */
3260Sstevel@tonic-gate 
3270Sstevel@tonic-gate #define	DP_USER_ADM_R		0x51
3280Sstevel@tonic-gate /*
3290Sstevel@tonic-gate  * the response field is used to return the user permissions
3300Sstevel@tonic-gate  * for the user permissions command. The response is also used
3310Sstevel@tonic-gate  * to echo back the user selection for the show command.
3320Sstevel@tonic-gate  */
3330Sstevel@tonic-gate typedef struct dp_user_adm_r {
3340Sstevel@tonic-gate 	rsci32	status;		/* completion code */
3350Sstevel@tonic-gate 	rsci32  command;	/* echo back adm command */
3360Sstevel@tonic-gate 	rsci32	response;
3370Sstevel@tonic-gate } dp_user_adm_r_t;
3380Sstevel@tonic-gate /* followed by a zero-terminated ascii string for the show command.  */
3390Sstevel@tonic-gate 
3400Sstevel@tonic-gate 
3410Sstevel@tonic-gate #define	DP_MODEM_PASS		0
3420Sstevel@tonic-gate #define	DP_MODEM_FAIL		-1
3430Sstevel@tonic-gate 
3440Sstevel@tonic-gate /* Commands used for rscadm modem_setup */
3450Sstevel@tonic-gate #define	DP_MODEM_CONNECT	0x30
3460Sstevel@tonic-gate #define	DP_MODEM_CONNECT_R	0x31
3470Sstevel@tonic-gate typedef struct dp_modem_connect_r {
3480Sstevel@tonic-gate 	rsci32	status;
3490Sstevel@tonic-gate } dp_modem_connect_r_t;
3500Sstevel@tonic-gate 
3510Sstevel@tonic-gate /* There is no reponse to a modem_data command */
3520Sstevel@tonic-gate /* The modem data command goes in both directions */
3530Sstevel@tonic-gate #define	DP_MODEM_DATA		0x32
3540Sstevel@tonic-gate /* followed by a zero-terminated ascii string */
3550Sstevel@tonic-gate 
3560Sstevel@tonic-gate #define	DP_MODEM_DISCONNECT	0x34
3570Sstevel@tonic-gate #define	DP_MODEM_DISCONNECT_R	0x35
3580Sstevel@tonic-gate typedef struct dp_modem_disconnect_r {
3590Sstevel@tonic-gate 	rsci32	status;
3600Sstevel@tonic-gate } dp_modem_disconnect_r_t;
3610Sstevel@tonic-gate 
3620Sstevel@tonic-gate 
3630Sstevel@tonic-gate #define	DP_GET_TICKCNT		0x22
3640Sstevel@tonic-gate #define	DP_GET_TICKCNT_R	0x23
3650Sstevel@tonic-gate typedef struct dp_get_tickcnt_r {
3660Sstevel@tonic-gate 	rsci32	upper;		/* MSW of 64 bit tick count */
3670Sstevel@tonic-gate 	rsci32	lower;		/* LSW of 64 bit tick count */
3680Sstevel@tonic-gate } dp_get_tickcnt_r_t;
3690Sstevel@tonic-gate 
3700Sstevel@tonic-gate 
3710Sstevel@tonic-gate #define	DP_SET_DEFAULT_CFG	0x72
3720Sstevel@tonic-gate 
3730Sstevel@tonic-gate #define	DP_SET_DEFAULT_CFG_R	0x52
3740Sstevel@tonic-gate typedef struct dp_set_default_cfg_r {
3750Sstevel@tonic-gate 	rsci32	status;
3760Sstevel@tonic-gate } dp_set_default_cfg_r_t;
3770Sstevel@tonic-gate 
3780Sstevel@tonic-gate 
3790Sstevel@tonic-gate #define	DP_GET_NETWORK_CFG	0x59
3800Sstevel@tonic-gate 
3810Sstevel@tonic-gate #define	DP_GET_NETWORK_CFG_R	0x79
3820Sstevel@tonic-gate typedef struct dp_get_network_cfg_r {
3830Sstevel@tonic-gate 	rsci32	status;
3840Sstevel@tonic-gate 	char	ipMode[7];
3850Sstevel@tonic-gate 	char	ipAddr[16];
3860Sstevel@tonic-gate 	char	ipMask[16];
3870Sstevel@tonic-gate 	char	ipGateway[16];
3880Sstevel@tonic-gate 	char	ethAddr[18];
3890Sstevel@tonic-gate 	char	ipDHCPServer[16];
3900Sstevel@tonic-gate } dp_get_network_cfg_r_t;
3910Sstevel@tonic-gate 
3920Sstevel@tonic-gate 
3930Sstevel@tonic-gate /*
3940Sstevel@tonic-gate  * Parameters for DP_RUN_TEST message:
3950Sstevel@tonic-gate  */
3960Sstevel@tonic-gate 
3970Sstevel@tonic-gate /*
3980Sstevel@tonic-gate  * Test routines need to know what the low-level protocol sync
3990Sstevel@tonic-gate  * character is.
4000Sstevel@tonic-gate  */
4010Sstevel@tonic-gate 
4020Sstevel@tonic-gate #define	RSC_TEST_SERIAL		0
4030Sstevel@tonic-gate typedef struct rsc_serial_test {
4040Sstevel@tonic-gate 	rsci32	testtype;
4050Sstevel@tonic-gate #define	RSC_SERIAL_TTYC_LB	0
4060Sstevel@tonic-gate #define	RSC_SERIAL_TTYC_LB_OFF	1
4070Sstevel@tonic-gate #define	RSC_SERIAL_TTYD_LB	2
4080Sstevel@tonic-gate #define	RSC_SERIAL_TTYD_LB_OFF	3
4090Sstevel@tonic-gate #define	RSC_SERIAL_TTYCD_LB	4
4100Sstevel@tonic-gate #define	RSC_SERIAL_TTYCD_LB_OFF	5
4110Sstevel@tonic-gate #define	RSC_SERIAL_TTYU_INT_LB	6
4120Sstevel@tonic-gate #define	RSC_SERIAL_TTYU_EXT_LB	7
4130Sstevel@tonic-gate 	rsci32	baud;
4140Sstevel@tonic-gate 	rsci32	passes;
4150Sstevel@tonic-gate 	rsci32	datalen;
4160Sstevel@tonic-gate 	rsci8	data[DP_MAX_MSGLEN-32];
4170Sstevel@tonic-gate } rsc_serial_test_t;
4180Sstevel@tonic-gate 
4190Sstevel@tonic-gate #define	RSC_TEST_ENET		1
4200Sstevel@tonic-gate typedef struct rsc_enet_test {
4210Sstevel@tonic-gate 	rsci32	testtype;
4220Sstevel@tonic-gate #define	RSC_ENET_INT_LB		0
4230Sstevel@tonic-gate #define	RSC_ENET_EXT_LB		1
4240Sstevel@tonic-gate #define	RSC_ENET_PING		2
4250Sstevel@tonic-gate #define	RSC_ENET_INT_PHY_LB	3
4260Sstevel@tonic-gate 	rsci8	ip_addr[4];
4270Sstevel@tonic-gate 	rsci32	passes;
4280Sstevel@tonic-gate 	rsci32	datalen;
4290Sstevel@tonic-gate 	rsci8	data[DP_MAX_MSGLEN-32];
4300Sstevel@tonic-gate } rsc_enet_test_t;
4310Sstevel@tonic-gate 
4320Sstevel@tonic-gate #define	RSC_TEST_FLASH_CRC	2
4330Sstevel@tonic-gate typedef struct rsc_flash_crcs_r {
4340Sstevel@tonic-gate 	rsci32	boot_crc;
4350Sstevel@tonic-gate 	rsci32	main_crc;
4360Sstevel@tonic-gate } rsc_flash_crcs_r_t;
4370Sstevel@tonic-gate 
4380Sstevel@tonic-gate #define	RSC_TEST_SEEPROM_CRC	3
4390Sstevel@tonic-gate typedef struct rsc_seeprom_crcs_r {
4400Sstevel@tonic-gate 	rsci32	hdr_crc;
4410Sstevel@tonic-gate 	rsci32	main_crc;
4420Sstevel@tonic-gate } rsc_seeprom_crcs_r_t;
4430Sstevel@tonic-gate 
4440Sstevel@tonic-gate #define	RSC_TEST_FRU_SEEPROM_CRC 4
4450Sstevel@tonic-gate typedef struct rsc_fru_crcs_r {
4460Sstevel@tonic-gate 	rsci32	ro_hdr_crc;
4470Sstevel@tonic-gate 	rsci32	seg_sd_crc;
4480Sstevel@tonic-gate } rsc_fru_crcs_r_t;
4490Sstevel@tonic-gate 
4500Sstevel@tonic-gate 
4510Sstevel@tonic-gate /*
4520Sstevel@tonic-gate  * new commands definitions
4530Sstevel@tonic-gate  */
4540Sstevel@tonic-gate 
4550Sstevel@tonic-gate #define	DP_GET_SYSINFO		0x20
4560Sstevel@tonic-gate 
4570Sstevel@tonic-gate #define	DP_GET_SYSINFO_R	0x21
4580Sstevel@tonic-gate typedef struct dp_get_sysinfo_r {
4590Sstevel@tonic-gate 	rsci8 maxTemp;		/* max number of temperature sensors */
4600Sstevel@tonic-gate 	rsci8 maxFan;		/* max number of FANs */
4610Sstevel@tonic-gate 	rsci8 maxPSU;		/* max number of PSUs slot */
4620Sstevel@tonic-gate 	rsci8 maxLED;		/* max number of LEDs */
4630Sstevel@tonic-gate 	rsci8 maxVolt;		/* max number of voltage sensors */
4640Sstevel@tonic-gate 	rsci8 maxFRU;		/* max number of FRUs (field replac. unit)  */
4650Sstevel@tonic-gate 	rsci8 maxCircuitBrks;	/* max number of circuit breakers */
4660Sstevel@tonic-gate 	rsci8 keyswitch;	/* key switch setting value */
4670Sstevel@tonic-gate } dp_get_sysinfo_r_t;
4680Sstevel@tonic-gate 
4690Sstevel@tonic-gate 
4700Sstevel@tonic-gate #define	DP_GET_TEMPERATURES	0x24
4710Sstevel@tonic-gate typedef struct dp_get_temperatures {
4720Sstevel@tonic-gate 	dp_handle_t handle;	/* handle of a temperature sensor */
4730Sstevel@tonic-gate 				/* or <null handle> (0xffff) */
4740Sstevel@tonic-gate } dp_get_temperatures_t;
4750Sstevel@tonic-gate 
4760Sstevel@tonic-gate /* Data is variable name & new value as zero-terminated ascii strings. */
4770Sstevel@tonic-gate 
4780Sstevel@tonic-gate #define	DP_GET_TEMPERATURES_R	0x25
4790Sstevel@tonic-gate typedef rscis16		dp_tempr_t;
4800Sstevel@tonic-gate 
4810Sstevel@tonic-gate enum sensor_status {
4820Sstevel@tonic-gate 	DP_SENSOR_DATA_AVAILABLE = 0,
4830Sstevel@tonic-gate 	DP_SENSOR_DATA_UNAVAILABLE,
4840Sstevel@tonic-gate 	DP_SENSOR_NOT_PRESENT
4850Sstevel@tonic-gate };
4860Sstevel@tonic-gate 
4870Sstevel@tonic-gate typedef struct dp_tempr_status {
4880Sstevel@tonic-gate 	dp_handle_t	handle;
4890Sstevel@tonic-gate 	rsci8		sensor_status; 	/* tells whether the reading is */
4900Sstevel@tonic-gate 					/* available or not */
4910Sstevel@tonic-gate 	dp_tempr_t	value;	/* temperature value (celsius). */
4920Sstevel@tonic-gate 
4930Sstevel@tonic-gate 	dp_tempr_t 	low_warning;
4940Sstevel@tonic-gate 	dp_tempr_t 	low_soft_shutdown;
4950Sstevel@tonic-gate 	dp_tempr_t 	low_hard_shutdown;
4960Sstevel@tonic-gate 	dp_tempr_t 	high_warning;
4970Sstevel@tonic-gate 	dp_tempr_t 	high_soft_shutdown;
4980Sstevel@tonic-gate 	dp_tempr_t 	high_hard_shutdown;
4990Sstevel@tonic-gate 
5000Sstevel@tonic-gate } dp_tempr_status_t;
5010Sstevel@tonic-gate 
5020Sstevel@tonic-gate typedef struct dp_get_temperatures_r {
5030Sstevel@tonic-gate 	rsci8			num_temps;
5040Sstevel@tonic-gate 	dp_tempr_status_t	temp_status[1];
5050Sstevel@tonic-gate 
5060Sstevel@tonic-gate } dp_get_temperatures_r_t;
5070Sstevel@tonic-gate 
5080Sstevel@tonic-gate 
5090Sstevel@tonic-gate #define	DP_GET_FAN_STATUS	0x26
5100Sstevel@tonic-gate typedef struct dp_get_fan_status {
5110Sstevel@tonic-gate 	dp_handle_t handle;	/* handle of a temperature sensor */
5120Sstevel@tonic-gate 				/* or <null handle> (0xffff) */
5130Sstevel@tonic-gate } dp_get_fan_status_t;
5140Sstevel@tonic-gate 
5150Sstevel@tonic-gate #define	DP_GET_FAN_STATUS_R	0x27
5160Sstevel@tonic-gate 
5170Sstevel@tonic-gate typedef struct dp_fan_status {
5180Sstevel@tonic-gate 	dp_handle_t	handle;
5190Sstevel@tonic-gate 	rsci8		sensor_status; 	/* tells whether the reading is */
5200Sstevel@tonic-gate 					/* available or not */
5210Sstevel@tonic-gate 	rsci8 		flag;
5220Sstevel@tonic-gate 
5230Sstevel@tonic-gate #define	DP_FAN_PRESENCE		0x01	/* FAN presence (bit set=FAN present) */
5240Sstevel@tonic-gate #define	DP_FAN_SPEED_VAL_UNIT	0x02	/* speed unit	(bit set=relative, */
5250Sstevel@tonic-gate 					/*		bit clear=RPM) */
5260Sstevel@tonic-gate #define	DP_FAN_STATUS		0x04	/* FAN status (bit set=error) */
5270Sstevel@tonic-gate 
5280Sstevel@tonic-gate 	rsci16		speed;	/* FAN speed. */
5290Sstevel@tonic-gate 	rsci16		minspeed; /* minimum FAN speed warning threshold */
5300Sstevel@tonic-gate 
5310Sstevel@tonic-gate } dp_fan_status_t;
5320Sstevel@tonic-gate 
5330Sstevel@tonic-gate typedef struct dp_get_fan_status_r {
5340Sstevel@tonic-gate 	rsci8		num_fans;
5350Sstevel@tonic-gate 	dp_fan_status_t	fan_status[1];
5360Sstevel@tonic-gate 
5370Sstevel@tonic-gate } dp_get_fan_status_r_t;
5380Sstevel@tonic-gate 
5390Sstevel@tonic-gate 
5400Sstevel@tonic-gate #define	DP_GET_PSU_STATUS	0x28
5410Sstevel@tonic-gate typedef struct dp_get_psu_status {
5420Sstevel@tonic-gate 	dp_handle_t handle;	/* handle of a temperature sensor */
5430Sstevel@tonic-gate 				/* or <null handle> (0xffff) */
5440Sstevel@tonic-gate } dp_get_psu_status_t;
5450Sstevel@tonic-gate 
5460Sstevel@tonic-gate #define	DP_GET_PSU_STATUS_R	0x29
5470Sstevel@tonic-gate typedef struct dp_psu_status {
5480Sstevel@tonic-gate 	dp_handle_t	handle;
5490Sstevel@tonic-gate 	rsci8		sensor_status; 	/* tells whether the reading is */
5500Sstevel@tonic-gate 					/* available or not */
5510Sstevel@tonic-gate 	rsci16 		mask;		/* flag bit mask (feature presence) */
5520Sstevel@tonic-gate 	rsci16 		flag;		/* status bits */
5530Sstevel@tonic-gate 
5540Sstevel@tonic-gate #define	DP_PSU_PRESENCE			0x0001	/* PSU presence  */
5550Sstevel@tonic-gate #define	DP_PSU_OUTPUT_STATUS		0x0002	/* output status */
5560Sstevel@tonic-gate #define	DP_PSU_INPUT_STATUS		0x0004	/* input status */
5570Sstevel@tonic-gate #define	DP_PSU_SEC_INPUT_STATUS		0x0008	/* secondary input status */
5580Sstevel@tonic-gate #define	DP_PSU_OVERTEMP_FAULT		0x0010	/* over temperature fault */
5590Sstevel@tonic-gate #define	DP_PSU_FAN_FAULT    		0x0020	/* FAN fault */
5600Sstevel@tonic-gate #define	DP_PSU_FAIL_STATUS		0x0040	/* PSU generic fault */
5610Sstevel@tonic-gate #define	DP_PSU_OUTPUT_VLO_STATUS	0x0080	/* output under voltage */
5620Sstevel@tonic-gate #define	DP_PSU_OUTPUT_VHI_STATUS	0x0100	/* output over voltage */
5630Sstevel@tonic-gate #define	DP_PSU_OUTPUT_AHI_STATUS	0x0200	/* output over current */
5640Sstevel@tonic-gate #define	DP_PSU_ALERT_STATUS		0x0400	/* PSU alert indication */
5650Sstevel@tonic-gate #define	DP_PSU_PDCT_FAN			0x0800	/* predicted fan fail */
5660Sstevel@tonic-gate #define	DP_PSU_NR_WARNING		0x1000	/* non-redundancy condition */
5670Sstevel@tonic-gate 
5680Sstevel@tonic-gate 			/* presence: 	bit clear=not present */
5690Sstevel@tonic-gate 			/*		bit set=present */
5700Sstevel@tonic-gate 			/* status:	bit clear=ok */
5710Sstevel@tonic-gate 			/*		bit set=generic fault */
5720Sstevel@tonic-gate } dp_psu_status_t;
5730Sstevel@tonic-gate 
5740Sstevel@tonic-gate typedef struct dp_get_psu_status_r {
5750Sstevel@tonic-gate 
5760Sstevel@tonic-gate 	rsci8		num_psus;
5770Sstevel@tonic-gate 	dp_psu_status_t	psu_status[1];
5780Sstevel@tonic-gate 
5790Sstevel@tonic-gate } dp_get_psu_status_r_t;
5800Sstevel@tonic-gate 
5810Sstevel@tonic-gate #define	DP_GET_FRU_STATUS	0x2A
5820Sstevel@tonic-gate typedef struct dp_get_fru_status {
5830Sstevel@tonic-gate 	dp_handle_t handle;	/* handle of a hot pluggable unit */
5840Sstevel@tonic-gate 				/* or <null handle> (0xffff)	  */
5850Sstevel@tonic-gate } dp_get_fru_status_t;
5860Sstevel@tonic-gate 
5870Sstevel@tonic-gate 
5880Sstevel@tonic-gate #define	DP_GET_FRU_STATUS_R	0x2B
5890Sstevel@tonic-gate typedef struct dp_fru_status {
5900Sstevel@tonic-gate 
5910Sstevel@tonic-gate 	dp_handle_t	handle;
5920Sstevel@tonic-gate 	rsci8		sensor_status; 	/* tells whether the reading is */
5930Sstevel@tonic-gate 					/* available or not */
5940Sstevel@tonic-gate 	rsci8		presence;	/* 1=FRU present */
5950Sstevel@tonic-gate 	rsci8		status;
5960Sstevel@tonic-gate 
5970Sstevel@tonic-gate } dp_fru_status_t;
5980Sstevel@tonic-gate 
5990Sstevel@tonic-gate enum dp_fru_status_type {
6000Sstevel@tonic-gate 	DP_FRU_STATUS_OK = 1,
6010Sstevel@tonic-gate 	DP_FRU_STATUS_FAILED,
6020Sstevel@tonic-gate 	DP_FRU_STATUS_BLACKLISTED,
6030Sstevel@tonic-gate 	DP_FRU_STATUS_UNKNOWN
6040Sstevel@tonic-gate };
6050Sstevel@tonic-gate 
6060Sstevel@tonic-gate typedef struct dp_get_fru_status_r {
6070Sstevel@tonic-gate 	rsci8		num_frus;
6080Sstevel@tonic-gate 	dp_fru_status_t	fru_status[1];
6090Sstevel@tonic-gate 
6100Sstevel@tonic-gate } dp_get_fru_status_r_t;
6110Sstevel@tonic-gate 
6120Sstevel@tonic-gate /*
6130Sstevel@tonic-gate  * DP_GET_DEVICE(_R) command is used to discover I2C devices dynamically
6140Sstevel@tonic-gate  * (used by SunVTS)
6150Sstevel@tonic-gate  */
6160Sstevel@tonic-gate #define	DP_GET_DEVICE		0x2C
6170Sstevel@tonic-gate 
6180Sstevel@tonic-gate typedef struct dp_get_device {
6190Sstevel@tonic-gate 	dp_handle_t	handle;	/* handle of a device or */
6200Sstevel@tonic-gate 				/* <null handle>(0xffff) */
6210Sstevel@tonic-gate } dp_get_device_t;
6220Sstevel@tonic-gate 
6230Sstevel@tonic-gate #define	DP_GET_DEVICE_R		0x2D
6240Sstevel@tonic-gate 
6250Sstevel@tonic-gate #define	DP_MAX_DEVICE_TYPE_NAME	32
6260Sstevel@tonic-gate 
6270Sstevel@tonic-gate typedef struct dp_device {
6280Sstevel@tonic-gate 	dp_handle_t	handle;
6290Sstevel@tonic-gate 	rsci8		presence;	/* 0 is not present, 1 is present */
6300Sstevel@tonic-gate 	char		device_type[DP_MAX_DEVICE_TYPE_NAME];
6310Sstevel@tonic-gate } dp_device_t;
6320Sstevel@tonic-gate 
6330Sstevel@tonic-gate typedef struct dp_get_device_r {
6340Sstevel@tonic-gate 	rsci8		num_devices;
6350Sstevel@tonic-gate 	dp_device_t	device[1];
6360Sstevel@tonic-gate } dp_get_device_r_t;
6370Sstevel@tonic-gate 
6380Sstevel@tonic-gate 
6390Sstevel@tonic-gate #define	DP_SET_CPU_SIGNATURE	0x33
6400Sstevel@tonic-gate 
6410Sstevel@tonic-gate typedef struct dp_set_cpu_signature {
6420Sstevel@tonic-gate 	int		cpu_id;		/* see PSARC 2000/205 for more */
6430Sstevel@tonic-gate 	ushort_t	sig; 		/* information on the value/meaning */
6440Sstevel@tonic-gate 	uchar_t		states;		/* of these fields */
6450Sstevel@tonic-gate 	uchar_t		sub_state;
6460Sstevel@tonic-gate 
6470Sstevel@tonic-gate } dp_cpu_signature_t;
6480Sstevel@tonic-gate 
6490Sstevel@tonic-gate 
6500Sstevel@tonic-gate #define	DP_SET_CPU_NODENAME	0x38
6510Sstevel@tonic-gate 
6520Sstevel@tonic-gate #define	DP_MAX_NODENAME		256
6530Sstevel@tonic-gate 
6540Sstevel@tonic-gate typedef struct dp_set_nodename {
6550Sstevel@tonic-gate 	char		nodename[DP_MAX_NODENAME];
6560Sstevel@tonic-gate } dp_set_nodename_t;
6570Sstevel@tonic-gate 
6580Sstevel@tonic-gate 
6590Sstevel@tonic-gate #define	DP_GET_LED_STATE	0x3C
6600Sstevel@tonic-gate 
6610Sstevel@tonic-gate typedef struct dp_get_led_state {
6620Sstevel@tonic-gate 	dp_handle_t handle;	/* handle of a hot pluggable unit */
6630Sstevel@tonic-gate 				/* or <null handle> (0xffff) */
6640Sstevel@tonic-gate } dp_get_led_state_t;
6650Sstevel@tonic-gate 
6660Sstevel@tonic-gate #define	DP_GET_LED_STATE_R	0x3D
6670Sstevel@tonic-gate 
6680Sstevel@tonic-gate typedef struct dp_led_state {
6690Sstevel@tonic-gate 	dp_handle_t	handle;
6700Sstevel@tonic-gate 	rsci8		sensor_status; 	/* tells whether the reading is */
6710Sstevel@tonic-gate 					/* available or not */
6720Sstevel@tonic-gate 	rsci8		state;
6730Sstevel@tonic-gate 	rsci8		colour;
6740Sstevel@tonic-gate } dp_led_state_t;
6750Sstevel@tonic-gate 
6760Sstevel@tonic-gate typedef struct dp_get_led_state_r {
6770Sstevel@tonic-gate 	rsci8		num_leds;
6780Sstevel@tonic-gate 	dp_led_state_t	led_state[1];
6790Sstevel@tonic-gate } dp_get_led_state_r_t;
6800Sstevel@tonic-gate 
6810Sstevel@tonic-gate /* LED states */
6820Sstevel@tonic-gate 
6830Sstevel@tonic-gate enum dp_led_states {
6840Sstevel@tonic-gate 	DP_LED_OFF = 0,
6850Sstevel@tonic-gate 	DP_LED_ON,
6860Sstevel@tonic-gate 	DP_LED_FLASHING,
6870Sstevel@tonic-gate 	DP_LED_BLINKING
6880Sstevel@tonic-gate };
6890Sstevel@tonic-gate 
6900Sstevel@tonic-gate enum dp_led_colours {
6910Sstevel@tonic-gate 	DP_LED_COLOUR_NONE = -1,
6920Sstevel@tonic-gate 	DP_LED_COLOUR_ANY,
6930Sstevel@tonic-gate 	DP_LED_COLOUR_WHITE,
6940Sstevel@tonic-gate 	DP_LED_COLOUR_BLUE,
6950Sstevel@tonic-gate 	DP_LED_COLOUR_GREEN,
6960Sstevel@tonic-gate 	DP_LED_COLOUR_AMBER
6970Sstevel@tonic-gate };
6980Sstevel@tonic-gate 
6990Sstevel@tonic-gate 
7000Sstevel@tonic-gate #define	DP_SET_LED_STATE	0x3E
7010Sstevel@tonic-gate 
7020Sstevel@tonic-gate typedef struct dp_set_led_state {
7030Sstevel@tonic-gate 	dp_handle_t	handle;		/* handle of a LED */
7040Sstevel@tonic-gate 	rsci8		state;
7050Sstevel@tonic-gate } dp_set_led_state_t;
7060Sstevel@tonic-gate 
7070Sstevel@tonic-gate #define	DP_SET_LED_STATE_R	0x3F
7080Sstevel@tonic-gate typedef struct dp_set_led_state_r {
7090Sstevel@tonic-gate 	rsci8		status;
7100Sstevel@tonic-gate } dp_set_led_state_r_t;
7110Sstevel@tonic-gate 
7120Sstevel@tonic-gate enum dp_set_led_status {
7130Sstevel@tonic-gate 	DP_SET_LED_OK = 0,
7140Sstevel@tonic-gate 	DP_SET_LED_INVALID_HANDLE,
7150Sstevel@tonic-gate 	DP_SET_LED_ERROR
7160Sstevel@tonic-gate };
7170Sstevel@tonic-gate 
7180Sstevel@tonic-gate 
7190Sstevel@tonic-gate #define	DP_GET_ALARM_STATE	0x68
7200Sstevel@tonic-gate 
7210Sstevel@tonic-gate typedef struct dp_get_alarm_state {
7220Sstevel@tonic-gate 	dp_handle_t handle;	/* handle of an alarm relay */
7230Sstevel@tonic-gate 				/* or <null handle> (0xffff) */
7240Sstevel@tonic-gate } dp_get_alarm_state_t;
7250Sstevel@tonic-gate 
7260Sstevel@tonic-gate #define	DP_GET_ALARM_STATE_R	0x69
7270Sstevel@tonic-gate 
7280Sstevel@tonic-gate typedef struct dp_alarm_state {
7290Sstevel@tonic-gate 	dp_handle_t	handle;
7300Sstevel@tonic-gate 	rsci8		sensor_status; 	/* tells whether the reading is */
7310Sstevel@tonic-gate 					/* available or not */
7320Sstevel@tonic-gate 	rsci8		state;
7330Sstevel@tonic-gate } dp_alarm_state_t;
7340Sstevel@tonic-gate 
7350Sstevel@tonic-gate typedef struct dp_get_alarm_state_r {
7360Sstevel@tonic-gate 	rsci8		num_alarms;
7370Sstevel@tonic-gate 	dp_alarm_state_t	alarm_state[1];
7380Sstevel@tonic-gate } dp_get_alarm_state_r_t;
7390Sstevel@tonic-gate 
7400Sstevel@tonic-gate /* ALARM states */
7410Sstevel@tonic-gate 
7420Sstevel@tonic-gate enum dp_alarm_states {
7430Sstevel@tonic-gate 	DP_ALARM_OFF = 0,
7440Sstevel@tonic-gate 	DP_ALARM_ON
7450Sstevel@tonic-gate };
7460Sstevel@tonic-gate 
7470Sstevel@tonic-gate #define	DP_SET_ALARM_STATE	0x6A
7480Sstevel@tonic-gate 
7490Sstevel@tonic-gate typedef struct dp_set_alarm_state {
7500Sstevel@tonic-gate 	dp_handle_t	handle;		/* handle of a ALARM */
7510Sstevel@tonic-gate 	rsci8		state;
7520Sstevel@tonic-gate } dp_set_alarm_state_t;
7530Sstevel@tonic-gate 
7540Sstevel@tonic-gate #define	DP_SET_ALARM_STATE_R	0x6B
7550Sstevel@tonic-gate typedef struct dp_set_alarm_state_r {
7560Sstevel@tonic-gate 	rsci8		status;
7570Sstevel@tonic-gate } dp_set_alarm_state_r_t;
7580Sstevel@tonic-gate 
7590Sstevel@tonic-gate enum dp_set_alarm_status {
7600Sstevel@tonic-gate 	DP_SET_ALARM_OK = 0,
7610Sstevel@tonic-gate 	DP_SET_ALARM_INVALID_HANDLE,
7620Sstevel@tonic-gate 	DP_SET_ALARM_ERROR
7630Sstevel@tonic-gate };
7640Sstevel@tonic-gate 
7650Sstevel@tonic-gate 
766467Ssc121708 #define	DP_SET_USER_WATCHDOG	0x60
767467Ssc121708 #define	DP_SET_USER_WATCHDOG_R	0x6F
768467Ssc121708 #define	DP_GET_USER_WATCHDOG	0x70
769467Ssc121708 #define	DP_GET_USER_WATCHDOG_R	0x71
770467Ssc121708 
771467Ssc121708 #define	DP_USER_WATCHDOG_ENABLE		0x01
772467Ssc121708 #define	DP_USER_WATCHDOG_DISABLE	0x00
773467Ssc121708 
774467Ssc121708 enum dp_user_watchdog_status {
775467Ssc121708 	DP_USER_WDT_OK = 0,
776467Ssc121708 	DP_USER_WDT_ERROR
777467Ssc121708 };
778467Ssc121708 
779467Ssc121708 typedef struct dp_set_user_watchdog {
780467Ssc121708 	rsci8 enable;	/* enable = 1 */
781467Ssc121708 } dp_set_user_watchdog_t;
782467Ssc121708 
783467Ssc121708 typedef struct dp_set_user_watchdog_r {
784467Ssc121708 	rsci8 status;
785467Ssc121708 } dp_set_user_watchdog_r_t;
786467Ssc121708 
787467Ssc121708 typedef struct dp_get_user_watchdog_r {
788467Ssc121708 	rsci8 enable;
789467Ssc121708 } dp_get_user_watchdog_r_t;
790467Ssc121708 
7910Sstevel@tonic-gate #define	DP_GET_VOLTS		0x42
7920Sstevel@tonic-gate 
7930Sstevel@tonic-gate typedef struct dp_get_volts {
7940Sstevel@tonic-gate 	dp_handle_t	handle;		/* handle of a voltage sensor */
7950Sstevel@tonic-gate } dp_get_volts_t;
7960Sstevel@tonic-gate 
7970Sstevel@tonic-gate #define	DP_GET_VOLTS_R		0x43
7980Sstevel@tonic-gate 
7990Sstevel@tonic-gate typedef rscis16		dp_volt_reading_t;	/* unit in mV */
8000Sstevel@tonic-gate 
8010Sstevel@tonic-gate typedef struct dp_volt_status {
8020Sstevel@tonic-gate 	dp_handle_t		handle;
8030Sstevel@tonic-gate 	rsci8			sensor_status; 	/* tells whether the reading */
8040Sstevel@tonic-gate 						/* is available or not */
8050Sstevel@tonic-gate 	rsci8			status;		/* 0=ok, 1=error */
8060Sstevel@tonic-gate 	dp_volt_reading_t	reading;	/* value in mV. */
8070Sstevel@tonic-gate 	dp_volt_reading_t	low_warning;
8080Sstevel@tonic-gate 	dp_volt_reading_t	low_soft_shutdown;
8090Sstevel@tonic-gate 	dp_volt_reading_t	low_hard_shutdown;
8100Sstevel@tonic-gate 	dp_volt_reading_t	high_warning;
8110Sstevel@tonic-gate 	dp_volt_reading_t	high_soft_shutdown;
8120Sstevel@tonic-gate 	dp_volt_reading_t	high_hard_shutdown;
8130Sstevel@tonic-gate 
8140Sstevel@tonic-gate } dp_volt_status_t;
8150Sstevel@tonic-gate 
8160Sstevel@tonic-gate typedef struct dp_get_volts_r {
8170Sstevel@tonic-gate 	rsci8			num_volts;
8180Sstevel@tonic-gate 	dp_volt_status_t	volt_status[1];
8190Sstevel@tonic-gate 
8200Sstevel@tonic-gate } dp_get_volts_r_t;
8210Sstevel@tonic-gate 
8220Sstevel@tonic-gate 
8230Sstevel@tonic-gate #define	DP_GET_CIRCUIT_BRKS	0x62
8240Sstevel@tonic-gate 
8250Sstevel@tonic-gate typedef struct dp_get_circuit_brks {
8260Sstevel@tonic-gate 	dp_handle_t handle;	/* handle of a circuit breaker */
8270Sstevel@tonic-gate 				/* or <null handle> (0xffff) */
8280Sstevel@tonic-gate } dp_get_circuit_brks_t;
8290Sstevel@tonic-gate 
8300Sstevel@tonic-gate #define	DP_GET_CIRCUIT_BRKS_R	0x63
8310Sstevel@tonic-gate 
8320Sstevel@tonic-gate typedef struct dp_circuit_brk_status {
8330Sstevel@tonic-gate 	dp_handle_t	handle;
8340Sstevel@tonic-gate 	rsci8		sensor_status; 	/* tells whether the reading is */
8350Sstevel@tonic-gate 					/* available or not */
8360Sstevel@tonic-gate 	rsci8		status;		/* 0=ok, 1=error */
8370Sstevel@tonic-gate 
8380Sstevel@tonic-gate } dp_circuit_brk_status_t;
8390Sstevel@tonic-gate 
8400Sstevel@tonic-gate typedef struct dp_get_circuit_brks_r {
8410Sstevel@tonic-gate 	rsci8			num_circuit_brks;
8420Sstevel@tonic-gate 	dp_circuit_brk_status_t	circuit_brk_status[1];
8430Sstevel@tonic-gate 
8440Sstevel@tonic-gate } dp_get_circuit_brks_r_t;
8450Sstevel@tonic-gate 
8460Sstevel@tonic-gate 
8470Sstevel@tonic-gate #define	DP_SET_HOST_WATCHDOG	0x48
8480Sstevel@tonic-gate 
8490Sstevel@tonic-gate typedef struct dp_set_host_watchdog {
8500Sstevel@tonic-gate 	rsci8	enable;		/* 0=enable watchdog, 1=disable watchdog */
8510Sstevel@tonic-gate } dp_set_host_watchdog_t;
8520Sstevel@tonic-gate 
8530Sstevel@tonic-gate 
8540Sstevel@tonic-gate #define	DP_GET_HANDLE_NAME	0x4A
8550Sstevel@tonic-gate 
8560Sstevel@tonic-gate typedef struct dp_get_handle_name {
8570Sstevel@tonic-gate 	dp_handle_t	handle;
8580Sstevel@tonic-gate } dp_get_handle_name_t;
8590Sstevel@tonic-gate 
8600Sstevel@tonic-gate #define	DP_GET_HANDLE_NAME_R	0x4B
8610Sstevel@tonic-gate 
8620Sstevel@tonic-gate typedef struct dp_get_handle_name_r {
8630Sstevel@tonic-gate 	dp_handle_t	handle;
8640Sstevel@tonic-gate 	char 		name[DP_MAX_HANDLE_NAME];
8650Sstevel@tonic-gate } dp_get_handle_name_r_t;
8660Sstevel@tonic-gate 
8670Sstevel@tonic-gate 
8680Sstevel@tonic-gate #define	DP_GET_HANDLE		0x4C
8690Sstevel@tonic-gate 
8700Sstevel@tonic-gate typedef struct dp_get_handle {
8710Sstevel@tonic-gate 	char 		name[DP_MAX_HANDLE_NAME];
8720Sstevel@tonic-gate } dp_get_handle_t;
8730Sstevel@tonic-gate 
8740Sstevel@tonic-gate #define	DP_GET_HANDLE_R		0x4D
8750Sstevel@tonic-gate 
8760Sstevel@tonic-gate typedef struct dp_get_handle_r {
8770Sstevel@tonic-gate 	dp_handle_t 	handle;
8780Sstevel@tonic-gate } dp_get_handle_r_t;
8790Sstevel@tonic-gate 
8800Sstevel@tonic-gate 
8810Sstevel@tonic-gate #define	DP_RMC_EVENTS		0x57
8820Sstevel@tonic-gate 
8830Sstevel@tonic-gate typedef rsci16	dp_event_t;
8840Sstevel@tonic-gate 
8850Sstevel@tonic-gate /*
8860Sstevel@tonic-gate  * list of events
8870Sstevel@tonic-gate  */
8880Sstevel@tonic-gate 
8890Sstevel@tonic-gate enum rmc_events {
8900Sstevel@tonic-gate 	RMC_INIT_EVENT	= 0x01,
8910Sstevel@tonic-gate 	RMC_HPU_EVENT,
8920Sstevel@tonic-gate 	RMC_ENV_EVENT,
8930Sstevel@tonic-gate 	RMC_KEYSWITCH_EVENT,
8940Sstevel@tonic-gate 	RMC_LOG_EVENT
8950Sstevel@tonic-gate };
8960Sstevel@tonic-gate 
8970Sstevel@tonic-gate /*
8980Sstevel@tonic-gate  * event data structures
8990Sstevel@tonic-gate  */
9000Sstevel@tonic-gate enum rmc_hpu_events {
9010Sstevel@tonic-gate 	RMC_HPU_INSERT_EVENT	= 0x20,
9020Sstevel@tonic-gate 	RMC_HPU_REMOVE_EVENT,
9030Sstevel@tonic-gate 	RMC_HPU_HWERROR_EVENT
9040Sstevel@tonic-gate };
9050Sstevel@tonic-gate 
9060Sstevel@tonic-gate typedef struct dp_hpu_event {
9070Sstevel@tonic-gate 	dp_handle_t	hpu_hdl;
9080Sstevel@tonic-gate 	dp_event_t	sub_event;
9090Sstevel@tonic-gate 
9100Sstevel@tonic-gate } dp_hpu_event_t;
9110Sstevel@tonic-gate 
9120Sstevel@tonic-gate 
9130Sstevel@tonic-gate enum rmc_env_events {
9140Sstevel@tonic-gate 	RMC_ENV_WARNING_THRESHOLD_EVENT = 0x31,
9150Sstevel@tonic-gate 	RMC_ENV_SHUTDOWN_THRESHOLD_EVENT,
9160Sstevel@tonic-gate 	RMC_ENV_FAULT_EVENT,
9170Sstevel@tonic-gate 	RMC_ENV_OK_EVENT
9180Sstevel@tonic-gate };
9190Sstevel@tonic-gate 
9200Sstevel@tonic-gate typedef struct dp_env_event {
9210Sstevel@tonic-gate 	dp_handle_t	env_hdl;
9220Sstevel@tonic-gate 	dp_event_t	sub_event;
9230Sstevel@tonic-gate 
9240Sstevel@tonic-gate } dp_env_event_t;
9250Sstevel@tonic-gate 
9260Sstevel@tonic-gate 
9270Sstevel@tonic-gate enum rmc_keyswitch_pos {
9280Sstevel@tonic-gate 	RMC_KEYSWITCH_POS_UNKNOWN	= 0x00,
9290Sstevel@tonic-gate 	RMC_KEYSWITCH_POS_NORMAL,
9300Sstevel@tonic-gate 	RMC_KEYSWITCH_POS_DIAG,
9310Sstevel@tonic-gate 	RMC_KEYSWITCH_POS_LOCKED,
9320Sstevel@tonic-gate 	RMC_KEYSWITCH_POS_OFF
9330Sstevel@tonic-gate };
9340Sstevel@tonic-gate 
9350Sstevel@tonic-gate typedef struct dp_keyswitch_event {
9360Sstevel@tonic-gate 	rsci8	key_position;
9370Sstevel@tonic-gate } dp_keyswitch_event_t;
9380Sstevel@tonic-gate 
9390Sstevel@tonic-gate 
9400Sstevel@tonic-gate typedef struct dp_rmclog_event {
9410Sstevel@tonic-gate 	int	log_record_size;
9420Sstevel@tonic-gate 	rsci8	log_record[DP_MAX_LOGSIZE];
9430Sstevel@tonic-gate } dp_rmclog_event_t;
9440Sstevel@tonic-gate 
9450Sstevel@tonic-gate typedef union dp_event_info {
9460Sstevel@tonic-gate 	dp_hpu_event_t		ev_hpunot;
9470Sstevel@tonic-gate 	dp_env_event_t		ev_envnot;
9480Sstevel@tonic-gate 	dp_keyswitch_event_t	ev_keysw;
9490Sstevel@tonic-gate 	dp_rmclog_event_t	ev_rmclog;
9500Sstevel@tonic-gate } dp_event_info_t;
9510Sstevel@tonic-gate 
9520Sstevel@tonic-gate typedef struct dp_event_notification {
9530Sstevel@tonic-gate 	dp_event_t	event;
9540Sstevel@tonic-gate 	rsci32		event_seqno; 	/* event sequence number */
9550Sstevel@tonic-gate 	rsci32		timestamp;	/* timestamp of the event */
9560Sstevel@tonic-gate 	dp_event_info_t	event_info;	/* event information */
9570Sstevel@tonic-gate } dp_event_notification_t;
9580Sstevel@tonic-gate 
9590Sstevel@tonic-gate #define	DP_RMC_EVENTS_R		0x5F
9600Sstevel@tonic-gate 
9610Sstevel@tonic-gate typedef struct dp_event_notification_r {
9620Sstevel@tonic-gate 	rsci32		event_seqno; 	/* event sequence number */
9630Sstevel@tonic-gate } dp_event_notification_r_t;
9640Sstevel@tonic-gate 
9651103Sjbeloro #define	DP_GET_CHASSIS_SERIALNUM	0x2E
9661103Sjbeloro #define	DP_GET_CHASSIS_SERIALNUM_R	0x2F
9671103Sjbeloro typedef struct dp_get_serialnum_r {
9681103Sjbeloro 	rsci8		chassis_serial_number[32];
9691103Sjbeloro } dp_get_serialnum_r_t;
9701103Sjbeloro 
9711103Sjbeloro #define	DP_GET_CONSOLE_LOG	0x1A
9721103Sjbeloro typedef struct dp_get_console_log {
9731103Sjbeloro 	rsci64		start_seq; 	/* sequence number of first log byte */
9741103Sjbeloro 	rsci16		length;		/* expected size of retrieved data */
9751103Sjbeloro } dp_get_console_log_t;
9761103Sjbeloro 
9771103Sjbeloro #define	DP_GET_CONSOLE_LOG_R	0x1B
9781103Sjbeloro typedef struct dp_get_console_log_r {
9791103Sjbeloro 	rsci64		next_seq;	/* sequence number of next log byte */
9801103Sjbeloro 	rsci64		remaining_log_bytes;	/* bytes left to retrieve */
9811103Sjbeloro 	rsci16		length;		/* size of retrieved data */
9821103Sjbeloro 	char		buffer[DP_MAX_MSGLEN - (sizeof (rsci64) * 2 +
9831103Sjbeloro 			    sizeof (rsci16))];
9841103Sjbeloro } dp_get_console_log_r_t;
9851103Sjbeloro 
9861103Sjbeloro #define	DP_GET_CONFIG_LOG	0x1C
9871103Sjbeloro typedef struct dp_get_config_log {
9881103Sjbeloro 	rsci64		start_seq;	/* sequence number of first log byte */
9891103Sjbeloro 	rsci16		length;		/* size of retrieved data */
9901103Sjbeloro } dp_get_config_log_t;
9911103Sjbeloro 
9921103Sjbeloro #define	DP_GET_CONFIG_LOG_R	0x1D
9931103Sjbeloro typedef struct dp_get_config_log_r {
9941103Sjbeloro 	rsci64		next_seq;	/* sequence number of next log byte */
9951103Sjbeloro 	rsci64		remaining_log_bytes;	/* bytes left to retrieve */
9961103Sjbeloro 	rsci16		length;		/* size of retrieved data */
9971103Sjbeloro 	char		buffer[DP_MAX_MSGLEN - (sizeof (rsci64) * 2 +
9981103Sjbeloro 			    sizeof (rsci16))];
9991103Sjbeloro } dp_get_config_log_r_t;
10001103Sjbeloro 
10011103Sjbeloro #define	DP_GET_EVENT_LOG2	0x1E
10021103Sjbeloro typedef struct dp_get_event_log2 {
10031103Sjbeloro 	rsci64		start_seq;	/* sequence number of first log event */
10041103Sjbeloro 	rsci16		length;		/* size of retrieved data */
10051103Sjbeloro } dp_get_event_log2_t;
10061103Sjbeloro 
10071103Sjbeloro #define	DP_GET_EVENT_LOG2_R	0x1F
10081103Sjbeloro typedef struct dp_get_event_log2_r {
10091103Sjbeloro 	rsci64		next_seq;	/* sequence number of next log event */
10101103Sjbeloro 	rsci64		remaining_log_events;	/* events left to retrieve */
10111103Sjbeloro 	rsci16		num_events;		/* size of retrieved data */
10121103Sjbeloro 	char		buffer[DP_MAX_MSGLEN - (sizeof (rsci64) * 2 +
10131103Sjbeloro 			    sizeof (rsci16))];
10141103Sjbeloro } dp_get_event_log2_r_t;
10151103Sjbeloro 
1016*1182Sfw157321 /*
1017*1182Sfw157321  * This is ALOM's response to command codes it does not know.  It will
1018*1182Sfw157321  * return the unknown command code in inv_type.  Note that this is
1019*1182Sfw157321  * available starting with protocol version 3.  ALOM will not respond
1020*1182Sfw157321  * to unknown commands in older versions of the protocol.
1021*1182Sfw157321  */
1022*1182Sfw157321 #define	DP_INVCMD	0x7F
1023*1182Sfw157321 typedef struct dp_invcmd {
1024*1182Sfw157321 	uint8_t inv_type;
1025*1182Sfw157321 } dp_invcmd_t;
1026*1182Sfw157321 
10270Sstevel@tonic-gate #ifdef	__cplusplus
10280Sstevel@tonic-gate }
10290Sstevel@tonic-gate #endif
10300Sstevel@tonic-gate 
10310Sstevel@tonic-gate #endif	/* _SYS_RMC_COMM_HPROTO_H */
1032