xref: /illumos-gate/usr/src/uts/sun4u/sys/sbd_ioctl.h (revision 2a1fd0ff)
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  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 /*
26  * Copyright 2019 Peter Tribble.
27  */
28 
29 #ifndef	_SBD_IOCTL_H
30 #define	_SBD_IOCTL_H
31 
32 #ifndef	_ASM
33 #include <sys/types.h>
34 #include <sys/obpdefs.h>
35 #include <sys/processor.h>
36 #include <sys/param.h>
37 #endif
38 
39 #ifdef	__cplusplus
40 extern "C" {
41 #endif
42 
43 #ifndef	_ASM
44 typedef enum {
45 	SBD_COMP_NONE,
46 	SBD_COMP_CPU,
47 	SBD_COMP_MEM,
48 	SBD_COMP_IO,
49 	SBD_COMP_CMP,
50 	SBD_COMP_UNKNOWN
51 } sbd_comp_type_t;
52 
53 typedef enum {
54 	SBD_STAT_NONE = 0,
55 	SBD_STAT_EMPTY,
56 	SBD_STAT_DISCONNECTED,
57 	SBD_STAT_CONNECTED,
58 	SBD_STAT_UNCONFIGURED,
59 	SBD_STAT_CONFIGURED
60 } sbd_state_t;
61 
62 typedef enum {
63 	SBD_COND_UNKNOWN = 0,
64 	SBD_COND_OK,
65 	SBD_COND_FAILING,
66 	SBD_COND_FAILED,
67 	SBD_COND_UNUSABLE
68 } sbd_cond_t;
69 
70 typedef	int	sbd_busy_t;
71 
72 #define	SBD_MAX_UNSAFE		16
73 #define	SBD_TYPE_LEN		12
74 #define	SBD_NULL_UNIT		-1
75 
76 typedef struct {
77 	sbd_comp_type_t	c_type;
78 	int		c_unit;
79 	char		c_name[OBP_MAXPROPNAME];
80 } sbd_comp_id_t;
81 
82 typedef struct {
83 	sbd_comp_id_t	c_id;
84 	sbd_state_t	c_ostate;
85 	sbd_cond_t	c_cond;
86 	sbd_busy_t	c_busy;
87 	uint_t		c_sflags;
88 	time_t		c_time;
89 } sbd_cm_stat_t;
90 
91 #define	ci_type		c_id.c_type
92 #define	ci_unit		c_id.c_unit
93 #define	ci_name		c_id.c_name
94 
95 typedef struct {
96 	sbd_cm_stat_t	cs_cm;
97 	int		cs_isbootproc;
98 	processorid_t	cs_cpuid;
99 	int		cs_speed;
100 	int		cs_ecache;
101 } sbd_cpu_stat_t;
102 
103 #define	cs_type		cs_cm.ci_type
104 #define	cs_unit		cs_cm.ci_unit
105 #define	cs_name		cs_cm.ci_name
106 #define	cs_ostate	cs_cm.c_ostate
107 #define	cs_cond		cs_cm.c_cond
108 #define	cs_busy		cs_cm.c_busy
109 #define	cs_suspend	cs_cm.c_sflags
110 #define	cs_time		cs_cm.c_time
111 
112 typedef struct {
113 	sbd_cm_stat_t	ms_cm;
114 	int		ms_interleave;
115 	pfn_t		ms_basepfn;
116 	pgcnt_t		ms_totpages;
117 	pgcnt_t		ms_detpages;
118 	pgcnt_t		ms_pageslost;
119 	pgcnt_t		ms_managed_pages;
120 	pgcnt_t		ms_noreloc_pages;
121 	pgcnt_t		ms_noreloc_first;
122 	pgcnt_t		ms_noreloc_last;
123 	int		ms_cage_enabled;
124 	int		ms_peer_is_target;	/* else peer is source */
125 	char		ms_peer_ap_id[MAXPATHLEN];	/* board's AP name */
126 } sbd_mem_stat_t;
127 
128 #define	ms_type		ms_cm.ci_type
129 #define	ms_unit		ms_cm.ci_unit
130 #define	ms_name		ms_cm.ci_name
131 #define	ms_ostate	ms_cm.c_ostate
132 #define	ms_cond		ms_cm.c_cond
133 #define	ms_busy		ms_cm.c_busy
134 #define	ms_suspend	ms_cm.c_sflags
135 #define	ms_time		ms_cm.c_time
136 
137 typedef struct {
138 	sbd_cm_stat_t	is_cm;
139 	int		is_referenced;
140 	int		is_unsafe_count;
141 	int		is_unsafe_list[SBD_MAX_UNSAFE];
142 	char		is_pathname[MAXPATHLEN];
143 } sbd_io_stat_t;
144 
145 #define	is_type		is_cm.ci_type
146 #define	is_unit		is_cm.ci_unit
147 #define	is_name		is_cm.ci_name
148 #define	is_ostate	is_cm.c_ostate
149 #define	is_cond		is_cm.c_cond
150 #define	is_busy		is_cm.c_busy
151 #define	is_suspend	is_cm.c_sflags
152 #define	is_time		is_cm.c_time
153 
154 /* This constant must be the max of the max cores on all platforms */
155 
156 #define	SBD_MAX_CORES_PER_CMP	8
157 
158 typedef struct {
159 	sbd_cm_stat_t	ps_cm;
160 	processorid_t	ps_cpuid[SBD_MAX_CORES_PER_CMP];
161 	int		ps_ncores;
162 	int		ps_speed;
163 	int		ps_ecache;
164 } sbd_cmp_stat_t;
165 
166 #define	ps_type		ps_cm.ci_type
167 #define	ps_unit		ps_cm.ci_unit
168 #define	ps_name		ps_cm.ci_name
169 #define	ps_ostate	ps_cm.c_ostate
170 #define	ps_cond		ps_cm.c_cond
171 #define	ps_busy		ps_cm.c_busy
172 #define	ps_suspend	ps_cm.c_sflags
173 #define	ps_time		ps_cm.c_time
174 
175 typedef union {
176 	sbd_cm_stat_t	d_cm;
177 	sbd_cpu_stat_t	d_cpu;
178 	sbd_mem_stat_t	d_mem;
179 	sbd_io_stat_t	d_io;
180 	sbd_cmp_stat_t	d_cmp;
181 } sbd_dev_stat_t;
182 
183 #define	ds_type		d_cm.ci_type
184 #define	ds_unit		d_cm.ci_unit
185 #define	ds_name		d_cm.ci_name
186 #define	ds_ostate	d_cm.c_ostate
187 #define	ds_cond		d_cm.c_cond
188 #define	ds_busy		d_cm.c_busy
189 #define	ds_suspend	d_cm.c_sflags
190 #define	ds_time		d_cm.c_time
191 
192 #define	SBD_MAX_INFO	64
193 
194 typedef struct {
195 	int		s_board;
196 	char		s_type[SBD_TYPE_LEN];
197 	char		s_info[SBD_MAX_INFO];
198 	sbd_state_t	s_rstate;
199 	sbd_state_t	s_ostate;
200 	sbd_cond_t	s_cond;
201 	sbd_busy_t	s_busy;
202 	time_t		s_time;
203 	uint_t		s_power:1;
204 	uint_t		s_assigned:1;
205 	uint_t		s_platopts;
206 	int		s_nstat;
207 	sbd_dev_stat_t	s_stat[1];
208 } sbd_stat_t;
209 
210 typedef struct {
211 	sbd_comp_id_t	c_id;
212 	uint_t		c_flags;
213 	int		c_len;
214 	caddr_t		c_opts;
215 } sbd_cm_cmd_t;
216 
217 typedef struct {
218 	sbd_cm_cmd_t	g_cm;
219 	int		g_ncm;
220 } sbd_getncm_cmd_t;
221 
222 typedef struct {
223 	sbd_cm_cmd_t	s_cm;
224 	int		s_nbytes;
225 	caddr_t		s_statp;
226 } sbd_stat_cmd_t;
227 
228 typedef union {
229 	sbd_cm_cmd_t		cmd_cm;
230 	sbd_getncm_cmd_t	cmd_getncm;
231 	sbd_stat_cmd_t		cmd_stat;
232 } sbd_cmd_t;
233 
234 typedef struct {
235 	int		e_code;
236 	char		e_rsc[MAXPATHLEN];
237 } sbd_error_t;
238 
239 typedef struct {
240 	sbd_cmd_t	i_cmd;
241 	sbd_error_t	i_err;
242 } sbd_ioctl_arg_t;
243 
244 typedef struct {
245 	int		t_base;
246 	int		t_bnd;
247 	char		**t_text;
248 } sbd_etab_t;
249 
250 #define	i_flags		i_cmd.cmd_cm.c_flags
251 #define	i_len		i_cmd.cmd_cm.c_len
252 #define	i_opts		i_cmd.cmd_cm.c_opts
253 #define	ic_type		i_cmd.cmd_cm.ci_type
254 #define	ic_name		i_cmd.cmd_cm.ci_name
255 #define	ic_unit		i_cmd.cmd_cm.ci_unit
256 #define	ie_code		i_err.e_code
257 #define	ie_rsc		i_err.e_rsc
258 
259 #define	_SBD_IOC		(('D' << 16) | ('R' << 8))
260 
261 #define	SBD_CMD_ASSIGN		(_SBD_IOC | 0x01)
262 #define	SBD_CMD_UNASSIGN	(_SBD_IOC | 0x02)
263 #define	SBD_CMD_POWERON		(_SBD_IOC | 0x03)
264 #define	SBD_CMD_POWEROFF	(_SBD_IOC | 0x04)
265 #define	SBD_CMD_TEST		(_SBD_IOC | 0x05)
266 #define	SBD_CMD_CONNECT		(_SBD_IOC | 0x06)
267 #define	SBD_CMD_CONFIGURE	(_SBD_IOC | 0x07)
268 #define	SBD_CMD_UNCONFIGURE	(_SBD_IOC | 0x08)
269 #define	SBD_CMD_DISCONNECT	(_SBD_IOC | 0x09)
270 #define	SBD_CMD_STATUS		(_SBD_IOC | 0x0a)
271 #define	SBD_CMD_GETNCM		(_SBD_IOC | 0x0b)
272 #define	SBD_CMD_PASSTHRU	(_SBD_IOC | 0x0c)
273 
274 #define	SBD_CHECK_SUSPEND(cmd, c_sflags) \
275 		(((c_sflags) >> (((cmd) & 0xf) - 1)) & 0x01)
276 
277 #define	SBD_SET_SUSPEND(cmd, c_sflags) \
278 		((c_sflags) |= (0x01 << (((cmd) & 0xf) - 1)))
279 
280 #define	SBD_CHECK_PLATOPTS(cmd, c_platopts) \
281 		(((c_platopts) >> (((cmd) & 0xf) - 1)) & 0x01)
282 
283 #define	SBD_SET_PLATOPTS(cmd, c_platopts) \
284 		((c_platopts) &= ~(0x01 << (((cmd) & 0xf) - 1)))
285 
286 #define	SBD_FLAG_FORCE		0x1
287 #define	SBD_FLAG_ALLCMP		0x2
288 #define	SBD_FLAG_QUIESCE_OKAY	0x4
289 
290 #if defined(_SYSCALL32)
291 
292 typedef struct {
293 	int32_t		c_type;
294 	int32_t		c_unit;
295 	char		c_name[OBP_MAXPROPNAME];
296 } sbd_comp_id32_t;
297 
298 typedef struct {
299 	sbd_comp_id32_t	c_id;
300 	int32_t		c_ostate;
301 	int32_t		c_cond;
302 	int32_t		c_busy;
303 	uint32_t	c_sflags;
304 	time32_t	c_time;
305 } sbd_cm_stat32_t;
306 
307 typedef struct {
308 	sbd_cm_stat32_t	cs_cm;
309 	int32_t		cs_isbootproc;
310 	int32_t		cs_cpuid;
311 	int32_t		cs_speed;
312 	int32_t		cs_ecache;
313 } sbd_cpu_stat32_t;
314 
315 typedef struct {
316 	sbd_cm_stat32_t	ms_cm;
317 	int32_t		ms_interleave;
318 	uint32_t	ms_basepfn;
319 	uint32_t	ms_totpages;
320 	uint32_t	ms_detpages;
321 	int32_t		ms_pageslost;
322 	uint32_t	ms_managed_pages;
323 	uint32_t	ms_noreloc_pages;
324 	uint32_t	ms_noreloc_first;
325 	uint32_t	ms_noreloc_last;
326 	int32_t		ms_cage_enabled;
327 	int32_t		ms_peer_is_target;
328 	char		ms_peer_ap_id[MAXPATHLEN];
329 } sbd_mem_stat32_t;
330 
331 typedef struct {
332 	sbd_cm_stat32_t	is_cm;
333 	int32_t		is_referenced;
334 	int32_t		is_unsafe_count;
335 	int32_t		is_unsafe_list[SBD_MAX_UNSAFE];
336 	char		is_pathname[MAXPATHLEN];
337 } sbd_io_stat32_t;
338 
339 typedef struct {
340 	sbd_cm_stat32_t	ps_cm;
341 	int32_t		ps_cpuid[SBD_MAX_CORES_PER_CMP];
342 	int32_t		ps_ncores;
343 	int32_t		ps_speed;
344 	int32_t		ps_ecache;
345 } sbd_cmp_stat32_t;
346 
347 typedef union {
348 	sbd_cm_stat32_t		d_cm;
349 	sbd_cpu_stat32_t	d_cpu;
350 	sbd_mem_stat32_t	d_mem;
351 	sbd_io_stat32_t		d_io;
352 	sbd_cmp_stat32_t	d_cmp;
353 } sbd_dev_stat32_t;
354 
355 typedef struct {
356 	int32_t			s_board;
357 	char			s_type[SBD_TYPE_LEN];
358 	char			s_info[SBD_MAX_INFO];
359 	int32_t			s_rstate;
360 	int32_t			s_ostate;
361 	int32_t			s_cond;
362 	int32_t			s_busy;
363 	time32_t		s_time;
364 	uint32_t		s_power:1;
365 	uint32_t		s_assigned:1;
366 	uint32_t		s_platopts;
367 	int32_t			s_nstat;
368 	sbd_dev_stat32_t	s_stat[1];
369 } sbd_stat32_t;
370 
371 typedef struct {
372 	int32_t			e_code;
373 	char			e_rsc[MAXPATHLEN];
374 } sbd_error32_t;
375 
376 typedef struct {
377 	sbd_comp_id32_t		c_id;
378 	uint32_t		c_flags;
379 	int32_t			c_len;
380 	caddr32_t		c_opts;
381 } sbd_cm_cmd32_t;
382 
383 typedef struct {
384 	sbd_cm_cmd32_t	g_cm;
385 	int32_t		g_ncm;
386 } sbd_getncm_cmd32_t;
387 
388 typedef struct {
389 	sbd_cm_cmd32_t	s_cm;
390 	int32_t		s_nbytes;
391 	caddr32_t	s_statp;
392 } sbd_stat_cmd32_t;
393 
394 typedef union {
395 	sbd_cm_cmd32_t		cmd_cm;
396 	sbd_getncm_cmd32_t	cmd_getncm;
397 	sbd_stat_cmd32_t	cmd_stat;
398 } sbd_cmd32_t;
399 
400 typedef struct {
401 	sbd_cmd32_t		i_cmd;
402 	sbd_error32_t		i_err;
403 } sbd_ioctl_arg32_t;
404 
405 typedef struct {
406 	int32_t			t_base;
407 	int32_t			t_bnd;
408 	char			**t_text;
409 } sbd_etab32_t;
410 
411 #endif	/* _SYSCALL32 */
412 #endif	/* _ASM */
413 
414 /* Common error codes */
415 
416 #define	ESBD_NOERROR		0	/* no error */
417 #define	ESBD_INTERNAL		1	/* Internal error */
418 #define	ESBD_NOMEM		2	/* Insufficient memory */
419 #define	ESBD_PROTO		3	/* Protocol error */
420 #define	ESBD_BUSY		4	/* Device busy */
421 #define	ESBD_NODEV		5	/* No such device */
422 #define	ESBD_ALREADY		6	/* Operation already in progress */
423 #define	ESBD_IO			7	/* I/O error */
424 #define	ESBD_FAULT		8	/* Bad address */
425 #define	ESBD_EMPTY_BD		9	/* No device(s) on board */
426 #define	ESBD_INVAL		10	/* Invalid argument */
427 #define	ESBD_STATE		11	/* Invalid state transition */
428 #define	ESBD_FATAL_STATE	12	/* Device in fatal state */
429 #define	ESBD_OUTSTANDING	13	/* Outstanding error */
430 #define	ESBD_SUSPEND		14	/* Device failed to suspend */
431 #define	ESBD_RESUME		15	/* Device failed to resume */
432 #define	ESBD_UTHREAD		16	/* Cannot stop user thread */
433 #define	ESBD_RTTHREAD		17	/* Cannot quiesce realtime thread */
434 #define	ESBD_KTHREAD		18	/* Cannot stop kernel thread  */
435 #define	ESBD_OFFLINE		19	/* Failed to off-line */
436 #define	ESBD_ONLINE		20	/* Failed to on-line */
437 #define	ESBD_CPUSTART		21	/* Failed to start CPU */
438 #define	ESBD_CPUSTOP		22	/* Failed to stop CPU */
439 #define	ESBD_INVAL_COMP		23	/* Invalid component type */
440 #define	ESBD_KCAGE_OFF		24	/* Kernel cage is disabled */
441 #define	ESBD_NO_TARGET		25	/* No available memory target */
442 #define	ESBD_HW_PROGRAM		26	/* Hardware programming error */
443 #define	ESBD_MEM_NOTVIABLE	27	/* VM viability test failed */
444 #define	ESBD_MEM_REFUSED	28	/* Memory operation refused */
445 #define	ESBD_MEM_NONRELOC	29	/* Non-relocatable pages in span */
446 #define	ESBD_MEM_CANCELLED	30	/* Memory operation cancelled */
447 #define	ESBD_MEMFAIL		31	/* Memory operation failed */
448 #define	ESBD_MEMONLINE		32	/* Can't unconfig cpu if mem online */
449 #define	ESBD_QUIESCE_REQD	33
450 	/* Operator confirmation for quiesce is required */
451 #define	ESBD_MEMINTLV		34
452 	/* Memory is interleaved across boards */
453 #define	ESBD_CPUONLINE		35
454 	/* Can't config memory if not all cpus are online */
455 #define	ESBD_UNSAFE		36	/* Unsafe driver present */
456 #define	ESBD_INVAL_OPT		37	/* option invalid */
457 
458 /* Starcat error codes */
459 
460 #define	ESTC_NONE		1000	/* No error */
461 #define	ESTC_GETPROP		1001	/* Cannot read property value */
462 #define	ESTC_BNUM		1002	/* Invalid board number */
463 #define	ESTC_CONFIGBUSY		1003
464 	/* Cannot proceed; Board is configured or busy */
465 #define	ESTC_PROBE		1004	/* Solaris failed to probe */
466 #define	ESTC_DEPROBE		1005	/* Solaris failed to deprobe */
467 #define	ESTC_MOVESIGB		1006	/* Firmware move-cpu0 failed */
468 #define	ESTC_SUPPORT		1007	/* Operation not supported */
469 #define	ESTC_DRVFAIL		1008	/* Device driver failure */
470 #define	ESTC_UNKPTCMD		1012	/* Unrecognized platform command */
471 #define	ESTC_NOTID		1013
472 	/* drmach parameter is not a valid ID */
473 #define	ESTC_INAPPROP		1014
474 	/* drmach parameter is inappropriate for operation */
475 #define	ESTC_INTERNAL		1015	/* Unexpected internal condition */
476 #define	ESTC_MBXRQST		1016
477 	/* Mailbox framework failure: outgoing */
478 #define	ESTC_MBXRPLY		1017
479 	/* Mailbox framework failure: incoming */
480 #define	ESTC_NOACL		1018	/* Board is not in domain ACL */
481 #define	ESTC_NOT_ASSIGNED	1019	/* Board is not assigned to domain */
482 #define	ESTC_NOT_ACTIVE		1020	/* Board is not active */
483 #define	ESTC_EMPTY_SLOT		1021	/* Slot is empty */
484 #define	ESTC_POWER_OFF		1022	/* Board is powered off */
485 #define	ESTC_TEST_IN_PROGRESS	1023	/* Board is already being tested */
486 #define	ESTC_TESTING_BUSY	1024
487 	/* Wait: All SC test resources are in use */
488 #define	ESTC_TEST_REQUIRED	1025	/* Board requires test prior to use */
489 #define	ESTC_TEST_ABORTED	1026	/* Board test has been aborted */
490 #define	ESTC_MBOX_UNKNOWN	1027
491 	/* Unknown error type received from SC */
492 #define	ESTC_TEST_STATUS_UNKNOWN	1028
493 	/* Test completed with unknown status */
494 #define	ESTC_TEST_RESULT_UNKNOWN	1029
495 	/* Unknown test result returned by SC */
496 #define	ESTC_TEST_FAILED	1030
497 	/* SMS hpost reported error, see POST log for details */
498 #define	ESTC_UNAVAILABLE	1031	/* Slot is unavailable to the domain */
499 #define	ESTC_NZ_LPA		1032	/* Nonzero LPA not yet supported */
500 #define	ESTC_IOSWITCH		1033
501 	/* Cannot unconfigure I/O board: tunnel switch failed */
502 #define	ESTC_IOCAGE_NO_CPU_AVAIL	1034
503 	/* No CPU available for I/O cage test. */
504 #define	ESTC_SMS_ERR_RECOVERABLE	1035
505 	/* SMS reported recoverable error: check SMS status and Retry */
506 #define	ESTC_SMS_ERR_UNRECOVERABLE	1036
507 	/* SMS reported unrecoverable error: Board is Unusable */
508 #define	ESTC_NWSWITCH		1037
509 	/* Cannot unconfigure I/O board: network switch failed */
510 
511 /* Daktari error codes */
512 
513 #define	EDAK_NONE		3000	/* no error */
514 #define	EDAK_INTERNAL		3001	/* Internal error */
515 #define	EDAK_NOFRUINFO		3002	/* Didn't receive fru info */
516 #define	EDAK_NONDR_BOARD	3003
517 	/* DR is not supported on this board type */
518 #define	EDAK_POWERON		3004	/* Power on request failed */
519 #define	EDAK_POWEROK		3005	/* Failed to power on */
520 #define	EDAK_INTERRUPTED	3006	/* Operation interrupted */
521 #define	EDAK_BOARDINIT		3007	/* Board initialization failed */
522 #define	EDAK_CPUINIT		3008	/* CPU intialization failed */
523 #define	EDAK_MEMFAIL		3009	/* Memory operation failed */
524 
525 /* Serengeti error codes */
526 
527 #define	ESGT_NONE		4000	/* no error */
528 #define	ESGT_INTERNAL		4001	/* Internal error */
529 #define	ESGT_INVAL		4002	/* Invalid argument */
530 #define	ESGT_MEMFAIL		4003	/* Memory operation failed */
531 #define	ESGT_PROBE		4004	/* Board probe failed */
532 #define	ESGT_DEPROBE		4005	/* Board deprobe failed */
533 #define	ESGT_JUGGLE_BOOTPROC	4006	/* Failed to juggle bootproc */
534 #define	ESGT_NOT_CPUTYPE	4007	/* Not a cpu device */
535 #define	ESGT_NO_DEV_TYPE	4008	/* Cannot find device type */
536 #define	ESGT_BAD_PORTID		4009	/* Bad port id */
537 #define	ESGT_RESUME		4010	/* Failed to resume device */
538 #define	ESGT_SUSPEND		4011	/* Failed to suspend device */
539 #define	ESGT_KTHREAD		4012	/* failed to stop kernel thd */
540 #define	ESGT_UNSAFE		4013	/* unsafe */
541 #define	ESGT_RTTHREAD		4014	/* real time threads */
542 #define	ESGT_UTHREAD		4015	/* failed to stop user thd */
543 #define	ESGT_PROM_ATTACH	4016	/* prom failed attach board */
544 #define	ESGT_PROM_DETACH	4017	/* prom failed detach board */
545 #define	ESGT_SC_ERR		4018	/* sc return a failure */
546 #define	ESGT_GET_BOARD_STAT	4019	/* Failed to obtain board information */
547 #define	ESGT_WAKEUPCPU		4020	/* Failed to wake up cpu */
548 #define	ESGT_STOPCPU		4021	/* Failed to stop cpu */
549 /* Serengeti SC return codes */
550 #define	ESGT_HW_FAIL		4022	/* Hardware Failure */
551 #define	ESGT_BD_ACCESS		4023	/* Board access denied */
552 #define	ESGT_STALE_CMP		4024	/* Stale components */
553 #define	ESGT_STALE_OBJ		4025	/* Stale objects */
554 #define	ESGT_NO_SEPROM_SPACE	4026	/* No SEPROM space */
555 #define	ESGT_NOT_SUPP		4027	/* Operation not supported */
556 #define	ESGT_NO_MEM		4028	/* No Memory */
557 
558 /* OPL error codes */
559 
560 #define	EOPL_GETPROP		5001	/* Cannot read property value */
561 #define	EOPL_BNUM		5002	/* Invalid board number */
562 #define	EOPL_CONFIGBUSY		5003
563 	/* Cannot proceed; Board is configured or busy */
564 #define	EOPL_PROBE		5004	/* Firmware probe failed */
565 #define	EOPL_DEPROBE		5005	/* Firmware deprobe failed */
566 #define	EOPL_SUPPORT		5006	/* Operation not supported */
567 #define	EOPL_DRVFAIL		5007	/* Device driver failure */
568 #define	EOPL_UNKPTCMD		5008	/* Unrecognized platform command */
569 #define	EOPL_NOTID		5009	/* drmach parameter is not a valid ID */
570 #define	EOPL_INAPPROP		5010
571 	/* drmach parameter is inappropriate for operation */
572 #define	EOPL_INTERNAL		5011	/* Unexpected internal condition */
573 #define	EOPL_FINDDEVICE		5012	/* Firmware cannot find node. */
574 #define	EOPL_MC_SETUP		5013	/* Cannot setup memory node */
575 #define	EOPL_CPU_STATE		5014	/* Invalid CPU/core state */
576 #define	EOPL_MC_OPL		5015	/* Cannot find mc-opl interface */
577 #define	EOPL_SCF_FMEM		5016	/* Cannot find scf_fmem interface */
578 #define	EOPL_FMEM_SETUP		5017	/* Error setting up FMEM buffer */
579 #define	EOPL_SCF_FMEM_START	5018	/* scf_fmem_start error */
580 #define	EOPL_FMEM_ERROR		5019	/* FMEM error */
581 #define	EOPL_SCF_FMEM_CANCEL	5020	/* scf_fmem_cancel error */
582 #define	EOPL_FMEM_XC_TIMEOUT	5021	/* xcall timeout */
583 #define	EOPL_FMEM_COPY_TIMEOUT	5022	/* DR parellel copy timeout */
584 #define	EOPL_FMEM_SCF_BUSY	5023	/* SCF busy */
585 #define	EOPL_FMEM_RETRY_OUT	5024	/* SCF IO Retry Error */
586 #define	EOPL_FMEM_TIMEOUT	5025	/* FMEM command timeout */
587 #define	EOPL_FMEM_HW_ERROR	5026	/* Hardware error */
588 #define	EOPL_FMEM_TERMINATE	5027	/* FMEM operation Terminated */
589 #define	EOPL_FMEM_COPY_ERROR	5028	/* Memory copy error */
590 #define	EOPL_FMEM_SCF_ERR	5029	/* SCF error */
591 #define	EOPL_MIXED_CPU		5030
592 	/* Cannot add SPARC64-VI to domain booted with all SPARC64-VII CPUs */
593 #define	EOPL_FMEM_SCF_OFFLINE	5031	/* SCF OFFLINE */
594 
595 #ifdef	__cplusplus
596 }
597 #endif
598 
599 #endif	/* _SBD_IOCTL_H */
600