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.
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.
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]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 * Console and mouse configuration
30 #include <sys/types.h>
31 #include <sys/param.h>
32 #include <sys/cmn_err.h>
35 #include <sys/vnode.h>
36 #include <sys/systm.h>
39 #include <sys/stropts.h>
40 #include <sys/stream.h>
41 #include <sys/strsubr.h>
43 #include <sys/consdev.h>
45 #include <sys/debug.h>
46 #include <sys/reboot.h>
47 #include <sys/termios.h>
50 #include <sys/sunddi.h>
51 #include <sys/modctl.h>
52 #include <sys/ddi_impldefs.h>
54 #include <sys/strsubr.h>
55 #include <sys/errno.h>
56 #include <sys/devops.h>
58 #include <sys/consplat.h>
61 * On supported configurations, the firmware defines the keyboard and mouse
62 * paths. However, during USB development, it is useful to be able to use
63 * the USB keyboard and mouse on machines without full USB firmware support.
64 * These variables may be set in /etc/system according to a machine's
65 * USB configuration. This module will override the firmware's values
68 static char *usb_kb_path
= NULL
;
69 static char *usb_ms_path
= NULL
;
72 * This is the loadable module wrapper.
74 extern struct mod_ops mod_miscops
;
77 * Module linkage information for the kernel.
79 static struct modlmisc modlmisc
= {
80 &mod_miscops
, "console configuration"
83 static struct modlinkage modlinkage
= {
84 MODREV_1
, (void *)&modlmisc
, NULL
90 return (mod_install(&modlinkage
));
96 return (mod_remove(&modlinkage
));
100 _info(struct modinfo
*modinfop
)
102 return (mod_info(&modlinkage
, modinfop
));
105 extern void dynamic_console_config(void);
106 extern boolean_t
consconfig_dacf_initialized(void);
109 * Configure keyboard and mouse. Main entry here.
114 dynamic_console_config();
118 consconfig_get_usb_kb_path(void) {
120 return (i_ddi_strdup(usb_kb_path
, KM_SLEEP
));
125 consconfig_get_usb_ms_path(void) {
127 return (i_ddi_strdup(usb_ms_path
, KM_SLEEP
));
132 consconfig_get_plat_fbpath(void) {
133 return (plat_fbpath());
137 consconfig_console_is_ready(void) {
138 return (consconfig_dacf_initialized());