17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5fea9cb91Slq150181  * Common Development and Distribution License (the "License").
6fea9cb91Slq150181  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21fea9cb91Slq150181 
227c478bd9Sstevel@tonic-gate /*
2340482326SVincent Wang  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_SYS_CONSCONFIG_DACF_H
287c478bd9Sstevel@tonic-gate #define	_SYS_CONSCONFIG_DACF_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
317c478bd9Sstevel@tonic-gate extern "C" {
327c478bd9Sstevel@tonic-gate #endif
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #define	CONS_MS		1
357c478bd9Sstevel@tonic-gate #define	CONS_KBD	2
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate /*
387c478bd9Sstevel@tonic-gate  * This structure contains information about keyboard
397c478bd9Sstevel@tonic-gate  * and mouse used for auto-configuration.
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate typedef struct cons_prop {
427c478bd9Sstevel@tonic-gate 	struct cons_prop	*cp_next;
437c478bd9Sstevel@tonic-gate 	int			cp_type;
447c478bd9Sstevel@tonic-gate 	dev_t			cp_dev;
457c478bd9Sstevel@tonic-gate 	int			cp_muxid;
467c478bd9Sstevel@tonic-gate 	char			*cp_pushmod;
477c478bd9Sstevel@tonic-gate } cons_prop_t;
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate /*
507c478bd9Sstevel@tonic-gate  * This structure contains information about the console
517c478bd9Sstevel@tonic-gate  */
527c478bd9Sstevel@tonic-gate typedef struct cons_state {
537c478bd9Sstevel@tonic-gate 	char	*cons_keyboard_path;	/* Keyboard path */
547c478bd9Sstevel@tonic-gate 	char	*cons_mouse_path;	/* Mouse path */
557c478bd9Sstevel@tonic-gate 	char	*cons_stdin_path;	/* Standard input path */
567c478bd9Sstevel@tonic-gate 	char	*cons_stdout_path;	/* Standard output path */
57*dbad7380SToomas Soome 	char	*cons_diag_path;	/* Diag device path */
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate 	char	*cons_fb_path;		/* Frame Buffer path */
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate 	int	cons_input_type;	/* Type of console input (See below) */
627c478bd9Sstevel@tonic-gate 	int	cons_keyboard_problem;	/* problem with console keyboard */
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate 	ldi_ident_t	cons_li;
657c478bd9Sstevel@tonic-gate 	vnode_t		*cons_wc_vp;
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate 	ldi_handle_t	conskbd_lh;
687c478bd9Sstevel@tonic-gate 	int		conskbd_muxid;
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate 	ldi_handle_t	consms_lh;
717c478bd9Sstevel@tonic-gate 	dev_t		consms_dev;
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate 	kmutex_t	cons_lock;
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate 	cons_prop_t	*cons_km_prop;
761b83305cSjm22469 	int		cons_tem_supported;
771b83305cSjm22469 	int		cons_stdin_is_kbd;
781b83305cSjm22469 	int		cons_stdout_is_fb;
7940482326SVincent Wang 	boolean_t	cons_initialized;
807c478bd9Sstevel@tonic-gate } cons_state_t;
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate /*
837c478bd9Sstevel@tonic-gate  * Types of console input
847c478bd9Sstevel@tonic-gate  */
857c478bd9Sstevel@tonic-gate #define	CONSOLE_LOCAL			0x1	/* keyboard */
867c478bd9Sstevel@tonic-gate #define	CONSOLE_TIP			0x2	/* serial line */
877c478bd9Sstevel@tonic-gate #define	CONSOLE_SERIAL_KEYBOARD		0x4	/* serial kbd */
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate /*
907c478bd9Sstevel@tonic-gate  * These macros indicate the state of the system while
917c478bd9Sstevel@tonic-gate  * the console configuration is running.
927c478bd9Sstevel@tonic-gate  * CONSCONFIG_BOOTING implies that the driver loading
937c478bd9Sstevel@tonic-gate  * is in process during boot.  CONSCONFIG_DRIVERS_LOADED
947c478bd9Sstevel@tonic-gate  * means that the driver loading during boot has completed.
957c478bd9Sstevel@tonic-gate  *
967c478bd9Sstevel@tonic-gate  * During driver loading while the boot is happening, the
977c478bd9Sstevel@tonic-gate  * keyboard and mouse minor nodes that are hooked into the console
987c478bd9Sstevel@tonic-gate  * stream must match those defined by the firmware.  After boot
997c478bd9Sstevel@tonic-gate  * minor nodes are hooked according to a first come first serve
1007c478bd9Sstevel@tonic-gate  * basis.
1017c478bd9Sstevel@tonic-gate  */
1027c478bd9Sstevel@tonic-gate #define	CONSCONFIG_BOOTING			1
1037c478bd9Sstevel@tonic-gate #define	CONSCONFIG_DRIVERS_LOADED		0
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate /*
1067c478bd9Sstevel@tonic-gate  * Debug information
1077c478bd9Sstevel@tonic-gate  * Severity levels for printing
1087c478bd9Sstevel@tonic-gate  */
1097c478bd9Sstevel@tonic-gate #define	DPRINT_L0	0	/* print every message */
1107c478bd9Sstevel@tonic-gate #define	DPRINT_L1	1	/* debug */
1117c478bd9Sstevel@tonic-gate #define	DPRINT_L2	2	/* minor errors */
1127c478bd9Sstevel@tonic-gate #define	DPRINT_L3	3	/* major errors */
1137c478bd9Sstevel@tonic-gate #define	DPRINT_L4	4	/* catastrophic errors */
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate #define	DPRINTF consconfig_dprintf
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate extern void	kadb_uses_kernel(void);
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1207c478bd9Sstevel@tonic-gate }
1217c478bd9Sstevel@tonic-gate #endif
1227c478bd9Sstevel@tonic-gate 
1237c478bd9Sstevel@tonic-gate #endif	/* _SYS_CONSCONFIG_DACF_H */
124