[PATCH 1/2] Allow hvc tty's to pose as vt's

From: Soren Hansen
Date: Fri May 14 2010 - 12:25:46 EST


Allow for hvc based tty's to take over the vt driver's major number
and namespace.

Signed-off-by: Soren Hansen <soren@xxxxxxxxxxx>
Tested-By: Major Hayden <major.hayden@xxxxxxxxxxxxx>

---
drivers/char/Kconfig | 9 ++++++++-
drivers/char/hvc_console.c | 9 +++++++++
2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 6aad99e..8610179 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -5,7 +5,7 @@
menu "Character devices"

config VT
- bool "Virtual terminal" if EMBEDDED
+ bool "Virtual terminal"
depends on !S390
select INPUT
default y
@@ -602,6 +602,13 @@ config PPDEV

If unsure, say N.

+config HVC_TTY_HACK
+ bool "Apply various hacks to make hvc[0-] pretend to be tty[1-]"
+ depends on !VT
+ help
+ Make unsuspecting guests work happily with the hvc concoles by
+ tricking them into thinking they're plain old ttys.
+
config HVC_DRIVER
bool
help
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a632f25..4c6b03d 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -43,7 +43,11 @@

#include "hvc_console.h"

+#ifdef CONFIG_HVC_TTY_HACK
+#define HVC_MAJOR 4
+#else /* CONFIG_HVC_TTY_HACK */
#define HVC_MAJOR 229
+#endif /* CONFIG_HVC_TTY_HACK */
#define HVC_MINOR 0

/*
@@ -848,7 +852,12 @@ static int hvc_init(void)

drv->owner = THIS_MODULE;
drv->driver_name = "hvc";
+#ifdef CONFIG_HVC_TTY_HACK
+ drv->name = "tty";
+ drv->name_base = 1;
+#else /* CONFIG_HVC_TTY_HACK */
drv->name = "hvc";
+#endif /* CONFIG_HVC_TTY_HACK */
drv->major = HVC_MAJOR;
drv->minor_start = HVC_MINOR;
drv->type = TTY_DRIVER_TYPE_SYSTEM;
--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/