patch-2.3.99-pre8 linux/drivers/s390/char/hwc_con.c
Next file: linux/drivers/s390/char/hwc_rw.c
Previous file: linux/drivers/s390/char/hwc.h
Back to the patch index
Back to the overall index
- Lines: 100
- Date:
Fri May 12 11:41:44 2000
- Orig file:
v2.3.99-pre7/linux/drivers/s390/char/hwc_con.c
- Orig date:
Wed Dec 31 16:00:00 1969
diff -u --recursive --new-file v2.3.99-pre7/linux/drivers/s390/char/hwc_con.c linux/drivers/s390/char/hwc_con.c
@@ -0,0 +1,99 @@
+/*
+ * drivers/s390/char/hwc_con.c
+ * HWC line mode console driver
+ *
+ * S390 version
+ * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Author(s): Martin Peschke <peschke@fh-brandenburg.de>
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/errno.h>
+#include <linux/kdev_t.h>
+#include <linux/string.h>
+#include <linux/console.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+
+#include "hwc_rw.h"
+
+extern void hwc_tty_init (void);
+
+#ifdef CONFIG_HWC_CONSOLE
+
+#define hwc_console_major 4
+#define hwc_console_minor 0
+#define hwc_console_name "console"
+
+void hwc_console_write (struct console *, const char *, unsigned int);
+kdev_t hwc_console_device (struct console *);
+
+#define HWC_CON_PRINT_HEADER "hwc console driver: "
+
+struct console hwc_console =
+{
+
+ hwc_console_name,
+ hwc_console_write,
+ NULL,
+ hwc_console_device,
+ NULL,
+ NULL,
+ NULL,
+ CON_PRINTBUFFER,
+ 0,
+ 0,
+ NULL
+};
+
+void
+hwc_console_write (
+ struct console *console,
+ const char *message,
+ unsigned int count)
+{
+
+ if (console->device (console) != hwc_console.device (&hwc_console)) {
+
+ hwc_printk (KERN_WARNING HWC_CON_PRINT_HEADER
+ "hwc_console_write() called with wrong "
+ "device number");
+ return;
+ }
+ hwc_write (0, message, count);
+}
+
+kdev_t
+hwc_console_device (struct console * c)
+{
+ return MKDEV (hwc_console_major, hwc_console_minor);
+}
+
+#endif
+
+void __init
+hwc_console_init (void)
+{
+
+#ifdef CONFIG_3215
+ if (MACHINE_IS_VM)
+ return;
+#endif
+ if (MACHINE_IS_P390)
+ return;
+
+ if (hwc_init () == 0) {
+
+#ifdef CONFIG_HWC_CONSOLE
+
+ register_console (&hwc_console);
+#endif
+
+ hwc_tty_init ();
+ } else
+ panic (HWC_CON_PRINT_HEADER "hwc initialisation failed !");
+
+ return;
+}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)