# HG changeset patch # User Florian Pose # Date 1259702210 -3600 # Node ID 88167b8589efdc465308f62f7e51e1d79e2b300c # Parent 7a2a58107dd8ab9c70acedc2fc262a322fd252ea TTY open and close. diff -r 7a2a58107dd8 -r 88167b8589ef tty/module.c --- a/tty/module.c Tue Dec 01 22:03:50 2009 +0100 +++ b/tty/module.c Tue Dec 01 22:16:50 2009 +0100 @@ -187,14 +187,29 @@ static int ec_tty_open(struct tty_struct *tty, struct file *file) { - return -EBUSY; + ec_tty_t *t; + int line = tty->index; + + printk(KERN_INFO PFX "Opening line %i.\n", line); + + if (line < 0 || line >= EC_TTY_MAX_DEVICES) { + return -ENXIO; + } + + t = ttys[line]; + if (!t) { + return -ENXIO; + } + + tty->driver_data = t; + return 0; } /*****************************************************************************/ static void ec_tty_close(struct tty_struct *tty, struct file *file) { - return; + printk(KERN_INFO PFX "Closing line %i.\n", tty->index); } /*****************************************************************************/