diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2006-06-26 03:27:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:33 -0400 |
commit | 13ae66458971b4967350765a8bfaf2a636442e5f (patch) | |
tree | 37940517f06cbb500c77770da71986c5cced6772 /drivers/char | |
parent | 6db4063c5b72b46e9793b0f141a7a3984ac6facf (diff) |
[PATCH] VT binding: Make VT binding a Kconfig option
To enable this feature, CONFIG_VT_HW_CONSOLE_BINDING must be set to 'y'. This
feature will default to 'n' to minimize users accidentally corrupting their
virtual terminals.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/Kconfig | 17 | ||||
-rw-r--r-- | drivers/char/vt.c | 43 |
2 files changed, 44 insertions, 16 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index ed31638bd75c..3610c5729553 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -62,6 +62,23 @@ config HW_CONSOLE | |||
62 | depends on VT && !S390 && !UML | 62 | depends on VT && !S390 && !UML |
63 | default y | 63 | default y |
64 | 64 | ||
65 | config VT_HW_CONSOLE_BINDING | ||
66 | bool "Support for binding and unbinding console drivers" | ||
67 | depends on HW_CONSOLE | ||
68 | default n | ||
69 | ---help--- | ||
70 | The virtual terminal is the device that interacts with the physical | ||
71 | terminal through console drivers. On these systems, at least one | ||
72 | console driver is loaded. In other configurations, additional console | ||
73 | drivers may be enabled, such as the framebuffer console. If more than | ||
74 | 1 console driver is enabled, setting this to 'y' will allow you to | ||
75 | select the console driver that will serve as the backend for the | ||
76 | virtual terminals. | ||
77 | |||
78 | See <file:Documentation/console/console.txt> for more | ||
79 | information. For framebuffer console users, please refer to | ||
80 | <file:Documentation/fb/fbcon.txt>. | ||
81 | |||
65 | config SERIAL_NONSTANDARD | 82 | config SERIAL_NONSTANDARD |
66 | bool "Non-standard serial port support" | 83 | bool "Non-standard serial port support" |
67 | ---help--- | 84 | ---help--- |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 037d8a3f5882..714d95ff2f1e 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2691,22 +2691,6 @@ int __init vty_init(void) | |||
2691 | 2691 | ||
2692 | static struct class *vtconsole_class; | 2692 | static struct class *vtconsole_class; |
2693 | 2693 | ||
2694 | static int con_is_graphics(const struct consw *csw, int first, int last) | ||
2695 | { | ||
2696 | int i, retval = 0; | ||
2697 | |||
2698 | for (i = first; i <= last; i++) { | ||
2699 | struct vc_data *vc = vc_cons[i].d; | ||
2700 | |||
2701 | if (vc && vc->vc_mode == KD_GRAPHICS) { | ||
2702 | retval = 1; | ||
2703 | break; | ||
2704 | } | ||
2705 | } | ||
2706 | |||
2707 | return retval; | ||
2708 | } | ||
2709 | |||
2710 | static int bind_con_driver(const struct consw *csw, int first, int last, | 2694 | static int bind_con_driver(const struct consw *csw, int first, int last, |
2711 | int deflt) | 2695 | int deflt) |
2712 | { | 2696 | { |
@@ -2808,6 +2792,23 @@ err: | |||
2808 | return retval; | 2792 | return retval; |
2809 | }; | 2793 | }; |
2810 | 2794 | ||
2795 | #ifdef CONFIG_VT_HW_CONSOLE_BINDING | ||
2796 | static int con_is_graphics(const struct consw *csw, int first, int last) | ||
2797 | { | ||
2798 | int i, retval = 0; | ||
2799 | |||
2800 | for (i = first; i <= last; i++) { | ||
2801 | struct vc_data *vc = vc_cons[i].d; | ||
2802 | |||
2803 | if (vc && vc->vc_mode == KD_GRAPHICS) { | ||
2804 | retval = 1; | ||
2805 | break; | ||
2806 | } | ||
2807 | } | ||
2808 | |||
2809 | return retval; | ||
2810 | } | ||
2811 | |||
2811 | static int unbind_con_driver(const struct consw *csw, int first, int last, | 2812 | static int unbind_con_driver(const struct consw *csw, int first, int last, |
2812 | int deflt) | 2813 | int deflt) |
2813 | { | 2814 | { |
@@ -2984,6 +2985,16 @@ static int vt_unbind(struct con_driver *con) | |||
2984 | err: | 2985 | err: |
2985 | return 0; | 2986 | return 0; |
2986 | } | 2987 | } |
2988 | #else | ||
2989 | static inline int vt_bind(struct con_driver *con) | ||
2990 | { | ||
2991 | return 0; | ||
2992 | } | ||
2993 | static inline int vt_unbind(struct con_driver *con) | ||
2994 | { | ||
2995 | return 0; | ||
2996 | } | ||
2997 | #endif /* CONFIG_VT_HW_CONSOLE_BINDING */ | ||
2987 | 2998 | ||
2988 | static ssize_t store_bind(struct class_device *class_device, | 2999 | static ssize_t store_bind(struct class_device *class_device, |
2989 | const char *buf, size_t count) | 3000 | const char *buf, size_t count) |