summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/consconfig_dacf.h
blob: 99b06288b0f70a99cb87c7773651088faa399de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */

/*
 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef	_SYS_CONSCONFIG_DACF_H
#define	_SYS_CONSCONFIG_DACF_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef	__cplusplus
extern "C" {
#endif

#define	CONS_MS		1
#define	CONS_KBD	2


/*
 * This structure contains information about keyboard
 * and mouse used for auto-configuration.
 */
typedef struct cons_prop {
	struct cons_prop	*cp_next;
	int			cp_type;
	dev_t			cp_dev;
	int			cp_muxid;
	char			*cp_pushmod;
} cons_prop_t;

/*
 * This structure contains information about the console
 */
typedef struct cons_state {
	char	*cons_keyboard_path;	/* Keyboard path */
	char	*cons_mouse_path;	/* Mouse path */
	char	*cons_stdin_path;	/* Standard input path */
	char	*cons_stdout_path;	/* Standard output path */

	char	*cons_fb_path;		/* Frame Buffer path */

	int	cons_input_type;	/* Type of console input (See below) */
	int	cons_keyboard_problem;	/* problem with console keyboard */

	ldi_ident_t	cons_li;
	vnode_t		*cons_wc_vp;

	ldi_handle_t	conskbd_lh;
	int		conskbd_muxid;

	ldi_handle_t	consms_lh;
	dev_t		consms_dev;

	kmutex_t	cons_lock;

	cons_prop_t	*cons_km_prop;
} cons_state_t;

/*
 * Types of console input
 */
#define	CONSOLE_LOCAL			0x1	/* keyboard */
#define	CONSOLE_TIP			0x2	/* serial line */
#define	CONSOLE_SERIAL_KEYBOARD		0x4	/* serial kbd */

/*
 * These macros indicate the state of the system while
 * the console configuration is running.
 * CONSCONFIG_BOOTING implies that the driver loading
 * is in process during boot.  CONSCONFIG_DRIVERS_LOADED
 * means that the driver loading during boot has completed.
 *
 * During driver loading while the boot is happening, the
 * keyboard and mouse minor nodes that are hooked into the console
 * stream must match those defined by the firmware.  After boot
 * minor nodes are hooked according to a first come first serve
 * basis.
 */
#define	CONSCONFIG_BOOTING			1
#define	CONSCONFIG_DRIVERS_LOADED		0

/*
 * Debug information
 * Severity levels for printing
 */
#define	DPRINT_L0	0	/* print every message */
#define	DPRINT_L1	1	/* debug */
#define	DPRINT_L2	2	/* minor errors */
#define	DPRINT_L3	3	/* major errors */
#define	DPRINT_L4	4	/* catastrophic errors */

#define	DPRINTF consconfig_dprintf

/*
 * Implementation functions from consplat
 */
extern int	plat_use_polled_debug(void);
extern char	*plat_stdinpath(void);
extern char	*plat_stdoutpath(void);
extern char	*plat_fbpath(void);
extern char	*plat_kbdpath(void);
extern char	*plat_mousepath(void);
extern int	plat_stdout_is_framebuffer(void);
extern int	plat_stdin_is_keyboard(void);

extern void	plat_tem_get_inverses(int *, int *);
extern void	plat_tem_get_prom_font_size(int *, int *);
extern void	plat_tem_get_prom_size(size_t *, size_t *);
extern void	plat_tem_hide_prom_cursor(void);
extern void	plat_tem_get_prom_pos(uint32_t *, uint32_t *);


/*
 * Other external functions
 */
extern void	kadb_uses_kernel(void);


#ifdef	__cplusplus
}
#endif

#endif	/* _SYS_CONSCONFIG_DACF_H */