xref: /titanic_51/usr/src/uts/sun4u/montecarlo/sys/scsbioctl.h (revision 03831d35f7499c87d51205817c93e9a8d42c4bae)
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 2000 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_MONTERCARLO_SYS_SCSBIOCTL_H
28 #define	_MONTERCARLO_SYS_SCSBIOCTL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * SCB HW information, which is needed in scsb.h for scsb.c.
38  * there are 32 data registers on the system controller board
39  * most are used in P1.0, all are used in P1.5
40  */
41 #define	SCSB_DATA_REGISTERS		48
42 
43 
44 #define	_SCSBIOC		('s' << 8)
45 
46 #define	SCSBIOC_GET_STATUS 	(_SCSBIOC | 1)		/* Internal	*/
47 #define	SCSBIOC_I2C_XFER	(_SCSBIOC | 2)		/* Internal	*/
48 
49 #define	SCSBIOC_ALL_LEDS_ON 	(_SCSBIOC | 3)		/* Diagnostics	*/
50 #define	SCSBIOC_ALL_LEDS_OFF 	(_SCSBIOC | 4)		/* Diagnostics	*/
51 
52 #define	SCSBIOC_FREEZE 		(_SCSBIOC | 5)		/* Internal	*/
53 #define	SCSBIOC_RESTORE 	(_SCSBIOC | 6)		/* Internal	*/
54 
55 #define	SCSBIOC_LED_NOK_SET	(_SCSBIOC | 7)		/* Diagnostics	*/
56 #define	SCSBIOC_LED_NOK_GET	(_SCSBIOC | 8)		/* Diagnostics	*/
57 #define	SCSBIOC_LED_OK_SET	(_SCSBIOC | 9)		/* Diagnostics	*/
58 #define	SCSBIOC_LED_OK_GET	(_SCSBIOC | 10)		/* Diagnostics	*/
59 #define	SCSBIOC_GET_FAN_STATUS	(_SCSBIOC | 11)		/* Internal	*/
60 #define	SCSBIOC_RESET_UNIT	(_SCSBIOC | 12)		/* Diagnostics	*/
61 #define	SCSBIOC_FAKE_INTR	(_SCSBIOC | 13)		/* Internal	*/
62 #define	SCSBIOC_BSELECT_SET	(_SCSBIOC | 14)		/* Internal	*/
63 #define	SCSBIOC_BSELECT_GET	(_SCSBIOC | 15)		/* Internal	*/
64 #define	SCSBIOC_BHEALTHY_SET	(_SCSBIOC | 16)		/* Internal	*/
65 #define	SCSBIOC_BHEALTHY_GET	(_SCSBIOC | 17)		/* Internal	*/
66 #define	SCSBIOC_GET_INTR_ARRAY	(_SCSBIOC | 18)		/* Internal	*/
67 
68 #define	ENVC_IOC_ACQUIRE_SLOT_LED_CTRL	(_SCSBIOC | 21)	/* EnvMon	*/
69 #define	ENVC_IOC_RELEASE_SLOT_LED_CTRL	(_SCSBIOC | 22)	/* EnvMon	*/
70 #define	ENVC_IOC_SETFSP		(_SCSBIOC | 23)		/* EnvMon	*/
71 #define	ENVC_IOC_GETDSKLED	(_SCSBIOC | 24)		/* EnvMon	*/
72 #define	ENVC_IOC_SETDSKLED	(_SCSBIOC | 25)		/* EnvMon	*/
73 #define	ENVC_IOC_REGISTER_PID	(_SCSBIOC | 26)		/* EnvMon	*/
74 #define	ENVC_IOC_UNREGISTER_PID	(_SCSBIOC | 27)		/* EnvMon	*/
75 #define	ENVC_IOC_ACCONF_RESTORED (_SCSBIOC | 28)	/* EnvMon	*/
76 #define	ENVC_IOC_ACCONF_STORED	(_SCSBIOC | 29)		/* EnvMon	*/
77 
78 #define	SCSBIOC_REG_READ	(_SCSBIOC | 31)		/* Diagnostic	*/
79 #define	SCSBIOC_REG_WRITE	(_SCSBIOC | 32)		/* Diagnostic	*/
80 #define	SCSBIOC_GET_VERSIONS	(_SCSBIOC | 33)		/* Diagnostic	*/
81 
82 /* these are for debug/testing and may be temporary */
83 #define	SCSBIOC_SHUTDOWN_POLL	(_SCSBIOC | 41)		/* Internal	*/
84 #define	SCSBIOC_SLOT_OCCUPANCY	(_SCSBIOC | 42)		/* Internal	*/
85 #define	SCSBIOC_INTEVENT_POLL	(_SCSBIOC | 43)		/* Internal	*/
86 #define	SCSBIOC_TOPOLOGY_DUMP	(_SCSBIOC | 44)		/* Internal	*/
87 #define	SCSBIOC_VALUE_MODE	(_SCSBIOC | 45)		/* Internal	*/
88 #define	SCSBIOC_GET_SLOT_INFO	(_SCSBIOC | 46)		/* Internal	*/
89 #define	SCSBIOC_DEBUG_MODE	(_SCSBIOC | 52)		/* Internal	*/
90 
91 /*
92  * SCSBIOC_GET_VERSIONS structure
93  */
94 #define	SCSB_MODSTR_LEN	64
95 #define	SCSB_VERSTR_LEN	12
96 typedef struct scsb_ids {
97 	char 	modldrv_string[SCSB_MODSTR_LEN];
98 	char	scsb_version[SCSB_VERSTR_LEN];
99 	uint8_t promid;
100 	uint8_t pad[3];
101 } scsb_ids_t;
102 
103 
104 typedef enum {
105 	GET  =	0,
106 	SET  =	1
107 } scsb_op_t;
108 
109 typedef enum {
110 	NOK =	0,
111 	OK  =	1,
112 	NOUSE =	2
113 } scsb_led_t;
114 
115 #define	SCSB_LED_TYPES		2
116 
117 typedef enum {
118 	OFF =	0,
119 	ON  =	1,
120 	BLINK =	2
121 } scsb_ustate_t;
122 
123 typedef struct {
124 	scsb_unum_t	unit_number;
125 	scsb_utype_t	unit_type;
126 	scsb_ustate_t	unit_state;
127 	scsb_led_t	led_type;
128 } scsb_uinfo_t;
129 
130 
131 /* SCSBIOC_GET_STATUS data */
132 typedef struct {
133 	uchar_t	scsb_reg[SCSB_DATA_REGISTERS];
134 } scsb_status_t;
135 
136 
137 /* SCSBIOC_REG_READ / SCSBIOC_REG_WRITE data */
138 typedef struct {
139 	int16_t		ioc_result;  /* O: return value			*/
140 	uint16_t	ioc_resio;   /* O: bytes not transfered		*/
141 	uint16_t	ioc_wlen;    /* I: length of write buffer	*/
142 	uint16_t	ioc_rlen;    /* I: length of read buffer	*/
143 	uchar_t		ioc_rbuf[64];
144 	uchar_t		ioc_wbuf[64];
145 	uchar_t		ioc_regindex;
146 } scsb_ioc_rdwr_t;
147 
148 
149 #ifdef	__cplusplus
150 }
151 #endif
152 
153 #endif	/* _MONTERCARLO_SYS_SCSBIOCTL_H */
154