#define VIOTTY_MAGIC (0x0DCB)
#define VTTY_PORTS 10
-#define VIOTTY_SERIAL_START 65
#define VIOCONS_KERN_WARN KERN_WARNING "viocons: "
#define VIOCONS_KERN_INFO KERN_INFO "viocons: "
static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp);
static struct tty_driver *viotty_driver;
-static struct tty_driver *viottyS_driver;
void hvlog(char *fmt, ...)
{
* console device I/O methods
*/
static struct console viocons_early = {
- .name = "ttyS",
+ .name = "viocons",
.write = viocons_write_early,
.flags = CON_PRINTBUFFER,
.index = -1,
};
static struct console viocons = {
- .name = "ttyS",
+ .name = "viocons",
.write = viocons_write,
.device = viocons_device,
.flags = CON_PRINTBUFFER,
port = tty->index;
- if (port >= VIOTTY_SERIAL_START)
- port -= VIOTTY_SERIAL_START;
-
if ((port < 0) || (port >= VTTY_PORTS))
return -ENODEV;
internal_write(pi, &ch, 1, NULL);
}
-/*
- * TTY flush_chars method
- */
-static void viotty_flush_chars(struct tty_struct *tty)
-{
-}
-
/*
* TTY write_room method
*/
}
/*
- * TTY chars_in_buffer_room method
+ * TTY chars_in_buffer method
*/
static int viotty_chars_in_buffer(struct tty_struct *tty)
{
return 0;
}
-static void viotty_flush_buffer(struct tty_struct *tty)
-{
-}
-
static int viotty_ioctl(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg)
{
return n_tty_ioctl(tty, file, cmd, arg);
}
-static void viotty_throttle(struct tty_struct *tty)
-{
-}
-
-static void viotty_unthrottle(struct tty_struct *tty)
-{
-}
-
-static void viotty_set_termios(struct tty_struct *tty,
- struct termios *old_termios)
-{
-}
-
-static void viotty_stop(struct tty_struct *tty)
-{
-}
-
-static void viotty_start(struct tty_struct *tty)
-{
-}
-
-static void viotty_hangup(struct tty_struct *tty)
-{
-}
-
-static void viotty_break(struct tty_struct *tty, int break_state)
-{
-}
-
-static void viotty_send_xchar(struct tty_struct *tty, char ch)
-{
-}
-
-static void viotty_wait_until_sent(struct tty_struct *tty, int timeout)
-{
-}
-
/*
* Handle an open charLpEvent. Could be either interrupt or ack
*/
.close = viotty_close,
.write = viotty_write,
.put_char = viotty_put_char,
- .flush_chars = viotty_flush_chars,
.write_room = viotty_write_room,
.chars_in_buffer = viotty_chars_in_buffer,
- .flush_buffer = viotty_flush_buffer,
.ioctl = viotty_ioctl,
- .throttle = viotty_throttle,
- .unthrottle = viotty_unthrottle,
- .set_termios = viotty_set_termios,
- .stop = viotty_stop,
- .start = viotty_start,
- .hangup = viotty_hangup,
- .break_ctl = viotty_break,
- .send_xchar = viotty_send_xchar,
- .wait_until_sent = viotty_wait_until_sent,
};
static int __init viocons_init2(void)
viotty_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
tty_set_operations(viotty_driver, &serial_ops);
- viottyS_driver = alloc_tty_driver(VTTY_PORTS);
- viottyS_driver->owner = THIS_MODULE;
- viottyS_driver->driver_name = "vioconsole";
- viottyS_driver->devfs_name = "tts/";
- viottyS_driver->name = "ttyS";
- viottyS_driver->major = TTY_MAJOR;
- viottyS_driver->minor_start = VIOTTY_SERIAL_START;
- viottyS_driver->type = TTY_DRIVER_TYPE_SERIAL;
- viottyS_driver->subtype = 1;
- viottyS_driver->init_termios = tty_std_termios;
- viottyS_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
- tty_set_operations(viottyS_driver, &serial_ops);
-
if (tty_register_driver(viotty_driver)) {
printk(VIOCONS_KERN_WARN "couldn't register console driver\n");
put_tty_driver(viotty_driver);
viotty_driver = NULL;
}
- if (tty_register_driver(viottyS_driver)) {
- printk(VIOCONS_KERN_WARN "couldn't register console S driver\n");
- put_tty_driver(viottyS_driver);
- viottyS_driver = NULL;
- }
-
viocons_init_cfu_buffer();
unregister_console(&viocons_early);