xref: /titanic_52/usr/src/uts/common/sys/consconfig_dacf.h (revision b7d62af5b42f0da2eb668e8d33d24d2f4fdd98a8)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #define	CONS_MS		1
37 #define	CONS_KBD	2
38 
39 
40 /*
41  * This structure contains information about keyboard
42  * and mouse used for auto-configuration.
43  */
44 typedef struct cons_prop {
45 	struct cons_prop	*cp_next;
46 	int			cp_type;
47 	dev_t			cp_dev;
48 	int			cp_muxid;
49 	char			*cp_pushmod;
50 } cons_prop_t;
51 
52 /*
53  * This structure contains information about the console
54  */
55 typedef struct cons_state {
56 	char	*cons_keyboard_path;	/* Keyboard path */
57 	char	*cons_mouse_path;	/* Mouse path */
58 	char	*cons_stdin_path;	/* Standard input path */
59 	char	*cons_stdout_path;	/* Standard output path */
60 
61 	char	*cons_fb_path;		/* Frame Buffer path */
62 
63 	int	cons_input_type;	/* Type of console input (See below) */
64 	int	cons_keyboard_problem;	/* problem with console keyboard */
65 
66 	ldi_ident_t	cons_li;
67 	vnode_t		*cons_wc_vp;
68 
69 	ldi_handle_t	conskbd_lh;
70 	int		conskbd_muxid;
71 
72 	ldi_handle_t	consms_lh;
73 	dev_t		consms_dev;
74 
75 	kmutex_t	cons_lock;
76 
77 	cons_prop_t	*cons_km_prop;
78 } cons_state_t;
79 
80 /*
81  * Types of console input
82  */
83 #define	CONSOLE_LOCAL			0x1	/* keyboard */
84 #define	CONSOLE_TIP			0x2	/* serial line */
85 #define	CONSOLE_SERIAL_KEYBOARD		0x4	/* serial kbd */
86 
87 /*
88  * These macros indicate the state of the system while
89  * the console configuration is running.
90  * CONSCONFIG_BOOTING implies that the driver loading
91  * is in process during boot.  CONSCONFIG_DRIVERS_LOADED
92  * means that the driver loading during boot has completed.
93  *
94  * During driver loading while the boot is happening, the
95  * keyboard and mouse minor nodes that are hooked into the console
96  * stream must match those defined by the firmware.  After boot
97  * minor nodes are hooked according to a first come first serve
98  * basis.
99  */
100 #define	CONSCONFIG_BOOTING			1
101 #define	CONSCONFIG_DRIVERS_LOADED		0
102 
103 /*
104  * Debug information
105  * Severity levels for printing
106  */
107 #define	DPRINT_L0	0	/* print every message */
108 #define	DPRINT_L1	1	/* debug */
109 #define	DPRINT_L2	2	/* minor errors */
110 #define	DPRINT_L3	3	/* major errors */
111 #define	DPRINT_L4	4	/* catastrophic errors */
112 
113 #define	DPRINTF consconfig_dprintf
114 
115 /*
116  * Implementation functions from consplat
117  */
118 extern int	plat_use_polled_debug(void);
119 extern char	*plat_stdinpath(void);
120 extern char	*plat_stdoutpath(void);
121 extern char	*plat_fbpath(void);
122 extern char	*plat_kbdpath(void);
123 extern char	*plat_mousepath(void);
124 extern int	plat_stdout_is_framebuffer(void);
125 extern int	plat_stdin_is_keyboard(void);
126 
127 
128 /*
129  * Other external functions
130  */
131 extern void	kadb_uses_kernel(void);
132 
133 
134 #ifdef	__cplusplus
135 }
136 #endif
137 
138 #endif	/* _SYS_CONSCONFIG_DACF_H */
139