From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Greg KH <gregkh@suse.de>,
Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>,
Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/9] VT binding: Make VT binding a Kconfig option
Date: Sun, 18 Jun 2006 23:24:22 +0800 [thread overview]
Message-ID: <44957026.2020405@gmail.com> (raw)
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>
---
drivers/char/Kconfig | 17 +++++++++++++++++
drivers/char/vt.c | 43 +++++++++++++++++++++++++++----------------
2 files changed, 44 insertions(+), 16 deletions(-)
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 29afe21..336aa31 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -62,6 +62,23 @@ config HW_CONSOLE
depends on VT && !S390 && !UML
default y
+config VT_HW_CONSOLE_BINDING
+ bool "Support for binding and unbinding console drivers"
+ depends on HW_CONSOLE
+ default n
+ ---help---
+ The virtual terminal is the device that interacts with the physical
+ terminal through console drivers. On these systems, at least one
+ console driver is loaded. In other configurations, additional console
+ drivers may be enabled, such as the framebuffer console. If more than
+ 1 console driver is enabled, setting this to 'y' will allow you to
+ select the console driver that will serve as the backend for the
+ virtual terminals.
+
+ See <file:Documentation/console/console.txt> for more
+ information. For framebuffer console users, please refer to
+ <file:Documentation/fb/fbcon.txt>.
+
config SERIAL_NONSTANDARD
bool "Non-standard serial port support"
---help---
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index d0cc421..1d98151 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2691,22 +2691,6 @@ #include <linux/device.h>
static struct class *vtconsole_class;
-static int con_is_graphics(const struct consw *csw, int first, int last)
-{
- int i, retval = 0;
-
- for (i = first; i <= last; i++) {
- struct vc_data *vc = vc_cons[i].d;
-
- if (vc && vc->vc_mode == KD_GRAPHICS) {
- retval = 1;
- break;
- }
- }
-
- return retval;
-}
-
static int bind_con_driver(const struct consw *csw, int first, int last,
int deflt)
{
@@ -2808,6 +2792,23 @@ err:
return retval;
};
+#ifdef CONFIG_VT_HW_CONSOLE_BINDING
+static int con_is_graphics(const struct consw *csw, int first, int last)
+{
+ int i, retval = 0;
+
+ for (i = first; i <= last; i++) {
+ struct vc_data *vc = vc_cons[i].d;
+
+ if (vc && vc->vc_mode == KD_GRAPHICS) {
+ retval = 1;
+ break;
+ }
+ }
+
+ return retval;
+}
+
static int unbind_con_driver(const struct consw *csw, int first, int last,
int deflt)
{
@@ -2977,6 +2978,16 @@ static int vt_unbind(struct con_driver *
err:
return 0;
}
+#else
+static inline int vt_bind(struct con_driver *con)
+{
+ return 0;
+}
+static inline int vt_unbind(struct con_driver *con)
+{
+ return 0;
+}
+#endif /* CONFIG_VT_HW_CONSOLE_BINDING */
static ssize_t store_bind(struct class_device *class_device,
const char *buf, size_t count)
WARNING: multiple messages have this Message-ID (diff)
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>,
Linux Kernel Development <linux-kernel@vger.kernel.org>,
Greg KH <gregkh@suse.de>
Subject: [PATCH 3/9] VT binding: Make VT binding a Kconfig option
Date: Sun, 18 Jun 2006 23:24:22 +0800 [thread overview]
Message-ID: <44957026.2020405@gmail.com> (raw)
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>
---
drivers/char/Kconfig | 17 +++++++++++++++++
drivers/char/vt.c | 43 +++++++++++++++++++++++++++----------------
2 files changed, 44 insertions(+), 16 deletions(-)
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 29afe21..336aa31 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -62,6 +62,23 @@ config HW_CONSOLE
depends on VT && !S390 && !UML
default y
+config VT_HW_CONSOLE_BINDING
+ bool "Support for binding and unbinding console drivers"
+ depends on HW_CONSOLE
+ default n
+ ---help---
+ The virtual terminal is the device that interacts with the physical
+ terminal through console drivers. On these systems, at least one
+ console driver is loaded. In other configurations, additional console
+ drivers may be enabled, such as the framebuffer console. If more than
+ 1 console driver is enabled, setting this to 'y' will allow you to
+ select the console driver that will serve as the backend for the
+ virtual terminals.
+
+ See <file:Documentation/console/console.txt> for more
+ information. For framebuffer console users, please refer to
+ <file:Documentation/fb/fbcon.txt>.
+
config SERIAL_NONSTANDARD
bool "Non-standard serial port support"
---help---
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index d0cc421..1d98151 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2691,22 +2691,6 @@ #include <linux/device.h>
static struct class *vtconsole_class;
-static int con_is_graphics(const struct consw *csw, int first, int last)
-{
- int i, retval = 0;
-
- for (i = first; i <= last; i++) {
- struct vc_data *vc = vc_cons[i].d;
-
- if (vc && vc->vc_mode == KD_GRAPHICS) {
- retval = 1;
- break;
- }
- }
-
- return retval;
-}
-
static int bind_con_driver(const struct consw *csw, int first, int last,
int deflt)
{
@@ -2808,6 +2792,23 @@ err:
return retval;
};
+#ifdef CONFIG_VT_HW_CONSOLE_BINDING
+static int con_is_graphics(const struct consw *csw, int first, int last)
+{
+ int i, retval = 0;
+
+ for (i = first; i <= last; i++) {
+ struct vc_data *vc = vc_cons[i].d;
+
+ if (vc && vc->vc_mode == KD_GRAPHICS) {
+ retval = 1;
+ break;
+ }
+ }
+
+ return retval;
+}
+
static int unbind_con_driver(const struct consw *csw, int first, int last,
int deflt)
{
@@ -2977,6 +2978,16 @@ static int vt_unbind(struct con_driver *
err:
return 0;
}
+#else
+static inline int vt_bind(struct con_driver *con)
+{
+ return 0;
+}
+static inline int vt_unbind(struct con_driver *con)
+{
+ return 0;
+}
+#endif /* CONFIG_VT_HW_CONSOLE_BINDING */
static ssize_t store_bind(struct class_device *class_device,
const char *buf, size_t count)
next reply other threads:[~2006-06-18 15:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-18 15:24 Antonino A. Daplas [this message]
2006-06-18 15:24 ` [PATCH 3/9] VT binding: Make VT binding a Kconfig option Antonino A. Daplas
2006-06-20 0:18 ` Jon Smirl
2006-06-20 1:09 ` Antonino A. Daplas
2006-06-20 2:16 ` Jon Smirl
2006-06-20 8:32 ` Antonino A. Daplas
2006-06-20 14:04 ` Jon Smirl
2006-06-20 14:31 ` Antonino A. Daplas
2006-06-20 14:49 ` Jon Smirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44957026.2020405@gmail.com \
--to=adaplas@gmail.com \
--cc=akpm@osdl.org \
--cc=gregkh@suse.de \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.