xref: /illumos-gate/usr/src/uts/common/sys/consconfig_dacf.h (revision 142d813a06c6f9a6142e2c276b62129a17a31a65)
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 2009 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_CONSCONFIG_DACF_H
28 #define	_SYS_CONSCONFIG_DACF_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 #define	CONS_MS		1
35 #define	CONS_KBD	2
36 
37 /*
38  * This structure contains information about keyboard
39  * and mouse used for auto-configuration.
40  */
41 typedef struct cons_prop {
42 	struct cons_prop	*cp_next;
43 	int			cp_type;
44 	dev_t			cp_dev;
45 	int			cp_muxid;
46 	char			*cp_pushmod;
47 } cons_prop_t;
48 
49 /*
50  * This structure contains information about the console
51  */
52 typedef struct cons_state {
53 	char	*cons_keyboard_path;	/* Keyboard path */
54 	char	*cons_mouse_path;	/* Mouse path */
55 	char	*cons_stdin_path;	/* Standard input path */
56 	char	*cons_stdout_path;	/* Standard output path */
57 	char	*cons_diag_path;	/* Diag device path */
58 
59 	char	*cons_fb_path;		/* Frame Buffer path */
60 
61 	int	cons_input_type;	/* Type of console input (See below) */
62 	int	cons_keyboard_problem;	/* problem with console keyboard */
63 
64 	ldi_ident_t	cons_li;
65 	vnode_t		*cons_wc_vp;
66 
67 	ldi_handle_t	conskbd_lh;
68 	int		conskbd_muxid;
69 
70 	ldi_handle_t	consms_lh;
71 	dev_t		consms_dev;
72 
73 	kmutex_t	cons_lock;
74 
75 	cons_prop_t	*cons_km_prop;
76 	int		cons_tem_supported;
77 	int		cons_stdin_is_kbd;
78 	int		cons_stdout_is_fb;
79 	boolean_t	cons_initialized;
80 } cons_state_t;
81 
82 /*
83  * Types of console input
84  */
85 #define	CONSOLE_LOCAL			0x1	/* keyboard */
86 #define	CONSOLE_TIP			0x2	/* serial line */
87 #define	CONSOLE_SERIAL_KEYBOARD		0x4	/* serial kbd */
88 
89 /*
90  * These macros indicate the state of the system while
91  * the console configuration is running.
92  * CONSCONFIG_BOOTING implies that the driver loading
93  * is in process during boot.  CONSCONFIG_DRIVERS_LOADED
94  * means that the driver loading during boot has completed.
95  *
96  * During driver loading while the boot is happening, the
97  * keyboard and mouse minor nodes that are hooked into the console
98  * stream must match those defined by the firmware.  After boot
99  * minor nodes are hooked according to a first come first serve
100  * basis.
101  */
102 #define	CONSCONFIG_BOOTING			1
103 #define	CONSCONFIG_DRIVERS_LOADED		0
104 
105 /*
106  * Debug information
107  * Severity levels for printing
108  */
109 #define	DPRINT_L0	0	/* print every message */
110 #define	DPRINT_L1	1	/* debug */
111 #define	DPRINT_L2	2	/* minor errors */
112 #define	DPRINT_L3	3	/* major errors */
113 #define	DPRINT_L4	4	/* catastrophic errors */
114 
115 #define	DPRINTF consconfig_dprintf
116 
117 extern void	kadb_uses_kernel(void);
118 
119 #ifdef	__cplusplus
120 }
121 #endif
122 
123 #endif	/* _SYS_CONSCONFIG_DACF_H */
124