From: Samuel Thibault <Samuel.Thibault@ens-lyon.fr>

There is no way for a braille device driven by brltty (userland root-owned
daemon) to scrollback the virtual console, the only way is to use the pc
keyboard.  A very simple TIOCLINUX ioctl meets this need (tested).

Also add a command for bringing the last console to the top, as keyboard.c's
lastcons() does when pressing alt - down arrow.


 drivers/char/vt.c |   12 ++++++++++++
 1 files changed, 12 insertions(+)

diff -puN drivers/char/vt.c~console-scrollback drivers/char/vt.c
--- 25/drivers/char/vt.c~console-scrollback	2003-04-02 22:51:24.000000000 -0800
+++ 25-akpm/drivers/char/vt.c	2003-04-02 22:51:24.000000000 -0800
@@ -1313,6 +1313,9 @@ static void setterm_command(int currcons
 		case 14: /* set vesa powerdown interval */
 			vesa_off_interval = ((par[1] < 60) ? par[1] : 60) * 60 * HZ;
 			break;
+		case 15:	/* Activate the previous console */
+			set_console(last_console);
+			break;
 	}
 }
 
@@ -2210,6 +2213,7 @@ struct console vt_console_driver = {
 int tioclinux(struct tty_struct *tty, unsigned long arg)
 {
 	char type, data;
+	int lines;
 	int ret;
 
 	if (tty->driver.type != TTY_DRIVER_TYPE_CONSOLE)
@@ -2266,6 +2270,14 @@ int tioclinux(struct tty_struct *tty, un
 		case 12:	/* get fg_console */
 			ret = fg_console;
 			break;
+		case 13:	/* scroll console */
+			if (get_user(lines, (char *)arg+1)) {
+				ret = -EFAULT;
+			} else {
+				scrollfront(lines);
+				ret = 0;
+			}
+			break;
 		default:
 			ret = -EINVAL;
 			break;

_