xref: /titanic_41/usr/src/uts/i86pc/sys/sbd_ioctl.h (revision 726fad2a65f16c200a03969c29cb5c86c2d427db)
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 (c) 2010, Intel Corporation.
27  * All rights reserved.
28  */
29 
30 #ifndef	_SBD_IOCTL_H
31 #define	_SBD_IOCTL_H
32 
33 #ifndef	_ASM
34 #include <sys/types.h>
35 #include <sys/obpdefs.h>
36 #include <sys/processor.h>
37 #include <sys/param.h>
38 #endif
39 
40 #ifdef	__cplusplus
41 extern "C" {
42 #endif
43 
44 #ifndef	_ASM
45 typedef enum {
46 	SBD_COMP_NONE,
47 	SBD_COMP_CPU,
48 	SBD_COMP_MEM,
49 	SBD_COMP_IO,
50 	SBD_COMP_CMP,
51 	SBD_COMP_UNKNOWN
52 } sbd_comp_type_t;
53 
54 typedef enum {
55 	SBD_STAT_NONE = 0,
56 	SBD_STAT_EMPTY,
57 	SBD_STAT_DISCONNECTED,
58 	SBD_STAT_CONNECTED,
59 	SBD_STAT_UNCONFIGURED,
60 	SBD_STAT_CONFIGURED
61 } sbd_state_t;
62 
63 typedef enum {
64 	SBD_COND_UNKNOWN = 0,
65 	SBD_COND_OK,
66 	SBD_COND_FAILING,
67 	SBD_COND_FAILED,
68 	SBD_COND_UNUSABLE
69 } sbd_cond_t;
70 
71 typedef	int	sbd_busy_t;
72 
73 #define	SBD_MAX_UNSAFE		16
74 #define	SBD_TYPE_LEN		12
75 #define	SBD_NULL_UNIT		-1
76 
77 typedef struct {
78 	sbd_comp_type_t	c_type;
79 	int		c_unit;
80 	char		c_name[OBP_MAXPROPNAME];
81 } sbd_comp_id_t;
82 
83 typedef struct {
84 	sbd_comp_id_t	c_id;
85 	sbd_state_t	c_ostate;
86 	sbd_cond_t	c_cond;
87 	sbd_busy_t	c_busy;
88 	uint_t		c_sflags;
89 	time_t		c_time;
90 } sbd_cm_stat_t;
91 
92 #define	ci_type		c_id.c_type
93 #define	ci_unit		c_id.c_unit
94 #define	ci_name		c_id.c_name
95 
96 typedef struct {
97 	sbd_cm_stat_t	cs_cm;
98 	int		cs_isbootproc;
99 	processorid_t	cs_cpuid;
100 	int		cs_speed;
101 	int		cs_ecache;
102 } sbd_cpu_stat_t;
103 
104 #define	cs_type		cs_cm.ci_type
105 #define	cs_unit		cs_cm.ci_unit
106 #define	cs_name		cs_cm.ci_name
107 #define	cs_ostate	cs_cm.c_ostate
108 #define	cs_cond		cs_cm.c_cond
109 #define	cs_busy		cs_cm.c_busy
110 #define	cs_suspend	cs_cm.c_sflags
111 #define	cs_time		cs_cm.c_time
112 
113 typedef struct {
114 	sbd_cm_stat_t	ms_cm;
115 	int		ms_interleave;
116 	pfn_t		ms_basepfn;
117 	pgcnt_t		ms_totpages;
118 	pgcnt_t		ms_detpages;
119 	pgcnt_t		ms_pageslost;
120 	pgcnt_t		ms_managed_pages;
121 	pgcnt_t		ms_noreloc_pages;
122 	pgcnt_t		ms_noreloc_first;
123 	pgcnt_t		ms_noreloc_last;
124 	int		ms_cage_enabled;
125 	int		ms_peer_is_target;	/* else peer is source */
126 	char		ms_peer_ap_id[MAXPATHLEN];	/* board's AP name */
127 } sbd_mem_stat_t;
128 
129 #define	ms_type		ms_cm.ci_type
130 #define	ms_unit		ms_cm.ci_unit
131 #define	ms_name		ms_cm.ci_name
132 #define	ms_ostate	ms_cm.c_ostate
133 #define	ms_cond		ms_cm.c_cond
134 #define	ms_busy		ms_cm.c_busy
135 #define	ms_suspend	ms_cm.c_sflags
136 #define	ms_time		ms_cm.c_time
137 
138 typedef struct {
139 	sbd_cm_stat_t	is_cm;
140 	int		is_referenced;
141 	int		is_unsafe_count;
142 	int		is_unsafe_list[SBD_MAX_UNSAFE];
143 	char		is_pathname[MAXPATHLEN];
144 } sbd_io_stat_t;
145 
146 #define	is_type		is_cm.ci_type
147 #define	is_unit		is_cm.ci_unit
148 #define	is_name		is_cm.ci_name
149 #define	is_ostate	is_cm.c_ostate
150 #define	is_cond		is_cm.c_cond
151 #define	is_busy		is_cm.c_busy
152 #define	is_suspend	is_cm.c_sflags
153 #define	is_time		is_cm.c_time
154 
155 /* This constant must be the max of the max cores on all platforms */
156 #define	SBD_MAX_CORES_PER_CMP	64
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	256
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 /* Starfire error codes */
512 
513 #define	ESTF_NONE		2000	/* No error */
514 #define	ESTF_GETPROP		2001	/* Cannot read property value */
515 #define	ESTF_GETPROPLEN		2002	/* Cannot determine property length */
516 #define	ESTF_BNUM		2003	/* Invalid board number */
517 #define	ESTF_CONFIGBUSY		2004
518 	/* Cannot proceed; Board is configured or busy */
519 #define	ESTF_NOCPUID		2005	/* No CPU specified for connect */
520 #define	ESTF_PROBE		2006	/* Firmware probe failed */
521 #define	ESTF_DEPROBE		2007	/* Firmware deprobe failed */
522 #define	ESTF_MOVESIGB		2008	/* Firmware move-cpu0 failed */
523 #define	ESTF_JUGGLE		2009	/* Cannot move SIGB assignment */
524 #define	ESTF_HASSIGB		2010
525 	/* Cannot disconnect CPU; SIGB is currently assigned */
526 #define	ESTF_SUPPORT		2011	/* Operation not supported */
527 #define	ESTF_DRVFAIL		2012	/* Device driver failure */
528 #define	ESTF_SETCPUVAL		2013
529 	/* Must specify a CPU on the given board */
530 #define	ESTF_NODEV		2014	/* No such device */
531 #define	ESTF_INTERBOARD		2015
532 	/* Memory configured with inter-board interleaving */
533 #define	ESTF_UNKPTCMD		2016	/* Unrecognized platform command */
534 #define	ESTF_NOTID		2017	/* drmach parameter is not a valid ID */
535 #define	ESTF_INAPPROP		2018
536 	/* drmach parameter is inappropriate for operation */
537 #define	ESTF_INTERNAL		2019	/* Unexpected internal condition */
538 
539 /* Daktari error codes */
540 
541 #define	EDAK_NONE		3000	/* no error */
542 #define	EDAK_INTERNAL		3001	/* Internal error */
543 #define	EDAK_NOFRUINFO		3002	/* Didn't receive fru info */
544 #define	EDAK_NONDR_BOARD	3003
545 	/* DR is not supported on this board type */
546 #define	EDAK_POWERON		3004	/* Power on request failed */
547 #define	EDAK_POWEROK		3005	/* Failed to power on */
548 #define	EDAK_INTERRUPTED	3006	/* Operation interrupted */
549 #define	EDAK_BOARDINIT		3007	/* Board initialization failed */
550 #define	EDAK_CPUINIT		3008	/* CPU intialization failed */
551 #define	EDAK_MEMFAIL		3009	/* Memory operation failed */
552 
553 /* Serengeti error codes */
554 
555 #define	ESGT_NONE		4000	/* no error */
556 #define	ESGT_INTERNAL		4001	/* Internal error */
557 #define	ESGT_INVAL		4002	/* Invalid argument */
558 #define	ESGT_MEMFAIL		4003	/* Memory operation failed */
559 #define	ESGT_PROBE		4004	/* Board probe failed */
560 #define	ESGT_DEPROBE		4005	/* Board deprobe failed */
561 #define	ESGT_JUGGLE_BOOTPROC	4006	/* Failed to juggle bootproc */
562 #define	ESGT_NOT_CPUTYPE	4007	/* Not a cpu device */
563 #define	ESGT_NO_DEV_TYPE	4008	/* Cannot find device type */
564 #define	ESGT_BAD_PORTID		4009	/* Bad port id */
565 #define	ESGT_RESUME		4010	/* Failed to resume device */
566 #define	ESGT_SUSPEND		4011	/* Failed to suspend device */
567 #define	ESGT_KTHREAD		4012	/* failed to stop kernel thd */
568 #define	ESGT_UNSAFE		4013	/* unsafe */
569 #define	ESGT_RTTHREAD		4014	/* real time threads */
570 #define	ESGT_UTHREAD		4015	/* failed to stop user thd */
571 #define	ESGT_PROM_ATTACH	4016	/* prom failed attach board */
572 #define	ESGT_PROM_DETACH	4017	/* prom failed detach board */
573 #define	ESGT_SC_ERR		4018	/* sc return a failure */
574 #define	ESGT_GET_BOARD_STAT	4019	/* Failed to obtain board information */
575 #define	ESGT_WAKEUPCPU		4020	/* Failed to wake up cpu */
576 #define	ESGT_STOPCPU		4021	/* Failed to stop cpu */
577 /* Serengeti SC return codes */
578 #define	ESGT_HW_FAIL		4022	/* Hardware Failure */
579 #define	ESGT_BD_ACCESS		4023	/* Board access denied */
580 #define	ESGT_STALE_CMP		4024	/* Stale components */
581 #define	ESGT_STALE_OBJ		4025	/* Stale objects */
582 #define	ESGT_NO_SEPROM_SPACE	4026	/* No SEPROM space */
583 #define	ESGT_NOT_SUPP		4027	/* Operation not supported */
584 #define	ESGT_NO_MEM		4028	/* No Memory */
585 
586 /* OPL error codes */
587 
588 #define	EOPL_GETPROP		5001	/* Cannot read property value */
589 #define	EOPL_BNUM		5002	/* Invalid board number */
590 #define	EOPL_CONFIGBUSY		5003
591 	/* Cannot proceed; Board is configured or busy */
592 #define	EOPL_PROBE		5004	/* Firmware probe failed */
593 #define	EOPL_DEPROBE		5005	/* Firmware deprobe failed */
594 #define	EOPL_SUPPORT		5006	/* Operation not supported */
595 #define	EOPL_DRVFAIL		5007	/* Device driver failure */
596 #define	EOPL_UNKPTCMD		5008	/* Unrecognized platform command */
597 #define	EOPL_NOTID		5009	/* drmach parameter is not a valid ID */
598 #define	EOPL_INAPPROP		5010
599 	/* drmach parameter is inappropriate for operation */
600 #define	EOPL_INTERNAL		5011	/* Unexpected internal condition */
601 #define	EOPL_FINDDEVICE		5012	/* Firmware cannot find node. */
602 #define	EOPL_MC_SETUP		5013	/* Cannot setup memory node */
603 #define	EOPL_CPU_STATE		5014	/* Invalid CPU/core state */
604 #define	EOPL_MC_OPL		5015	/* Cannot find mc-opl interface */
605 #define	EOPL_SCF_FMEM		5016	/* Cannot find scf_fmem interface */
606 #define	EOPL_FMEM_SETUP		5017	/* Error setting up FMEM buffer */
607 #define	EOPL_SCF_FMEM_START	5018	/* scf_fmem_start error */
608 #define	EOPL_FMEM_ERROR		5019	/* FMEM error */
609 #define	EOPL_SCF_FMEM_CANCEL	5020	/* scf_fmem_cancel error */
610 #define	EOPL_FMEM_XC_TIMEOUT	5021	/* xcall timeout */
611 #define	EOPL_FMEM_COPY_TIMEOUT	5022	/* DR parellel copy timeout */
612 #define	EOPL_FMEM_SCF_BUSY	5023	/* SCF busy */
613 #define	EOPL_FMEM_RETRY_OUT	5024	/* SCF IO Retry Error */
614 #define	EOPL_FMEM_TIMEOUT	5025	/* FMEM command timeout */
615 #define	EOPL_FMEM_HW_ERROR	5026	/* Hardware error */
616 #define	EOPL_FMEM_TERMINATE	5027	/* FMEM operation Terminated */
617 #define	EOPL_FMEM_COPY_ERROR	5028	/* Memory copy error */
618 #define	EOPL_FMEM_SCF_ERR	5029	/* SCF error */
619 #define	EOPL_MIXED_CPU		5030
620 	/* Cannot add SPARC64-VI to domain booted with all SPARC64-VII CPUs */
621 #define	EOPL_FMEM_SCF_OFFLINE	5031	/* SCF OFFLINE */
622 
623 /* X86 error codes */
624 
625 #define	EX86_GETPROP		10001	/* Cannot read property value */
626 #define	EX86_BNUM		10002	/* Invalid board number */
627 #define	EX86_NOTID		10003	/* drmach parameter is not a valid ID */
628 #define	EX86_INAPPROP		10004
629 	/* drmach parameter is inappropriate for operation */
630 #define	EX86_PROBE		10005	/* Firmware probe failed */
631 #define	EX86_DEPROBE		10006	/* Firmware deprobe failed */
632 #define	EX86_SUPPORT		10007	/* Operation not supported */
633 #define	EX86_INTERNAL		10008	/* Unexpected internal condition */
634 #define	EX86_CONFIGBUSY		10009
635 	/* Cannot proceed, board is configured or busy */
636 #define	EX86_POWERBUSY		10010	/* Cannot proceed, board is powered */
637 #define	EX86_CONNECTBUSY	10011	/* Cannot proceed, board is connected */
638 #define	EX86_INVALID_ARG	10012	/* Invalid argument */
639 #define	EX86_DRVFAIL		10013	/* Device driver failure */
640 #define	EX86_UNKPTCMD		10014	/* Unrecognized platform command */
641 #define	EX86_ALLOC_CPUID	10015	/* Failed to allocate processor id */
642 #define	EX86_FREE_CPUID		10016	/* Failed to release processor id */
643 #define	EX86_POWERON		10017	/* Failed to power on board */
644 #define	EX86_POWEROFF		10018	/* Failed to power off board */
645 #define	EX86_MC_SETUP		10019	/* Cannot setup memory node */
646 #define	EX86_ACPIWALK		10020	/* Cannot walk ACPI namespace */
647 #define	EX86_WALK_DEPENDENCY	10021
648 	/* Failed to check dependency for board */
649 #define	EX86_IN_FAILURE		10022	/* Board is in failure state */
650 
651 #ifdef	__cplusplus
652 }
653 #endif
654 
655 #endif	/* _SBD_IOCTL_H */
656