xref: /illumos-gate/usr/src/uts/common/sys/consconfig_dacf.h (revision 90221f9148b67fdc90178b67f9600b7bd4e3bc7c)
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 
58 	char	*cons_fb_path;		/* Frame Buffer path */
59 
60 	int	cons_input_type;	/* Type of console input (See below) */
61 	int	cons_keyboard_problem;	/* problem with console keyboard */
62 
63 	ldi_ident_t	cons_li;
64 	vnode_t		*cons_wc_vp;
65 
66 	ldi_handle_t	conskbd_lh;
67 	int		conskbd_muxid;
68 
69 	ldi_handle_t	consms_lh;
70 	dev_t		consms_dev;
71 
72 	kmutex_t	cons_lock;
73 
74 	cons_prop_t	*cons_km_prop;
75 	int		cons_tem_supported;
76 	int		cons_stdin_is_kbd;
77 	int		cons_stdout_is_fb;
78 	boolean_t	cons_initialized;
79 } cons_state_t;
80 
81 /*
82  * Types of console input
83  */
84 #define	CONSOLE_LOCAL			0x1	/* keyboard */
85 #define	CONSOLE_TIP			0x2	/* serial line */
86 #define	CONSOLE_SERIAL_KEYBOARD		0x4	/* serial kbd */
87 
88 /*
89  * These macros indicate the state of the system while
90  * the console configuration is running.
91  * CONSCONFIG_BOOTING implies that the driver loading
92  * is in process during boot.  CONSCONFIG_DRIVERS_LOADED
93  * means that the driver loading during boot has completed.
94  *
95  * During driver loading while the boot is happening, the
96  * keyboard and mouse minor nodes that are hooked into the console
97  * stream must match those defined by the firmware.  After boot
98  * minor nodes are hooked according to a first come first serve
99  * basis.
100  */
101 #define	CONSCONFIG_BOOTING			1
102 #define	CONSCONFIG_DRIVERS_LOADED		0
103 
104 /*
105  * Debug information
106  * Severity levels for printing
107  */
108 #define	DPRINT_L0	0	/* print every message */
109 #define	DPRINT_L1	1	/* debug */
110 #define	DPRINT_L2	2	/* minor errors */
111 #define	DPRINT_L3	3	/* major errors */
112 #define	DPRINT_L4	4	/* catastrophic errors */
113 
114 #define	DPRINTF consconfig_dprintf
115 
116 extern void	kadb_uses_kernel(void);
117 
118 #ifdef	__cplusplus
119 }
120 #endif
121 
122 #endif	/* _SYS_CONSCONFIG_DACF_H */
123