From: Aivils S. <ai...@us...> - 2004-02-09 07:34:22
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32333/ruby-2.6/drivers/char Modified Files: Kconfig Makefile keyboard.c sysrq.c tty_io.c vt.c vt_proc.c Log Message: sync to 2.6.2 Index: Kconfig =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Kconfig,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Kconfig 14 Nov 2003 17:44:22 -0000 1.4 +++ Kconfig 9 Feb 2004 07:31:07 -0000 1.5 @@ -595,8 +595,6 @@ bool "Support for console on line printer" depends on PC9800_OLDLP -source "drivers/i2c/Kconfig" - menu "Mice" Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 14 Nov 2003 17:44:22 -0000 1.5 +++ Makefile 9 Feb 2004 07:31:07 -0000 1.6 @@ -43,6 +43,7 @@ obj-$(CONFIG_HVC_CONSOLE) += hvc_console.o obj-$(CONFIG_RAW_DRIVER) += raw.o obj-$(CONFIG_SGI_L1_SERIAL) += sn_serial.o +obj-$(CONFIG_VIOCONS) += viocons.o obj-$(CONFIG_PRINTER) += lp.o obj-$(CONFIG_TIPAR) += tipar.o Index: keyboard.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/keyboard.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- keyboard.c 5 Feb 2004 11:53:56 -0000 1.11 +++ keyboard.c 9 Feb 2004 07:31:07 -0000 1.12 @@ -889,7 +889,7 @@ } } -#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) +#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SH_MPC1211) static unsigned short x86_keycodes[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -897,14 +897,14 @@ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 93, 86, 87, 88, 94, 95, 85,259,375,260, 90, - 284,285,309,311,312, 91,327,328,329,331,333,335,336,337,338,339, - 367,288,302,304,350, 89,334,326,116,377,109,111,126,347,348,349, - 360,261,262,263,298,376,100,101,321,316,373,286,289,102,351,355, + 80, 81, 82, 83, 84,118, 86, 87, 88,115,120,119,121,112,123, 92, + 284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339, + 367,288,302,304,350, 89,334,326,267,126,268,269,125,347,348,349, + 360,261,262,263,268,376,100,101,321,316,373,286,289,102,351,355, 103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361, 291,108,381,281,290,272,292,305,280, 99,112,257,258,359,113,114, - 264,117,271,374,379,115,125,273,121,123, 92,265,266,267,268,269, - 120,119,118,277,278,282,283,295,296,297,299,300,301,293,303,307, + 264,117,271,374,379,265,266, 93, 94, 95, 85,259,375,260, 90,116, + 377,109,111,277,278,282,283,295,296,297,299,300,301,293,303,307, 308,310,313,314,315,317,318,319,320,357,322,323,324,325,276,330, 332,340,365,342,343,344,345,346,356,270,341,368,369,370,371,372 }; @@ -934,10 +934,10 @@ put_queue(vc, 0x1d | up_flag); put_queue(vc, 0x45 | up_flag); return 0; - case KEY_LANG1: + case KEY_HANGUEL: if (!up_flag) put_queue(vc, 0xf1); return 0; - case KEY_LANG2: + case KEY_HANJA: if (!up_flag) put_queue(vc, 0xf2); return 0; } Index: sysrq.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/sysrq.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- sysrq.c 14 Nov 2003 17:44:22 -0000 1.3 +++ sysrq.c 9 Feb 2004 07:31:07 -0000 1.4 @@ -271,11 +271,11 @@ }; /* key2index calculation, -1 on invalid index */ -static __inline__ int sysrq_key_table_key2index(int key) { +static int sysrq_key_table_key2index(int key) { int retval; - if ((key >= '0') & (key <= '9')) { + if ((key >= '0') && (key <= '9')) { retval = key - '0'; - } else if ((key >= 'a') & (key <= 'z')) { + } else if ((key >= 'a') && (key <= 'z')) { retval = key + 10 - 'a'; } else { retval = -1; Index: tty_io.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/tty_io.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tty_io.c 14 Nov 2003 17:44:22 -0000 1.6 +++ tty_io.c 9 Feb 2004 07:31:07 -0000 1.7 @@ -1393,7 +1393,7 @@ /* * Need to reset f_op in case a hangup happened. */ - if (filp->f_op == &hung_up_tty_fops) + /*if (filp->f_op == &hung_up_tty_fops) FIXME brave ruby*/ filp->f_op = &tty_fops; goto retry_open; } @@ -2076,79 +2076,7 @@ tty->driver->write(tty, 0, &ch, 1); } -struct tty_dev { - struct list_head node; - dev_t dev; - struct class_device class_dev; -}; -#define to_tty_dev(d) container_of(d, struct tty_dev, class_dev) - -static void release_tty_dev(struct class_device *class_dev) -{ - struct tty_dev *tty_dev = to_tty_dev(class_dev); - kfree(tty_dev); -} - -static struct class tty_class = { - .name = "tty", - .release = &release_tty_dev, -}; - -static LIST_HEAD(tty_dev_list); -static spinlock_t tty_dev_list_lock = SPIN_LOCK_UNLOCKED; - -static ssize_t show_dev(struct class_device *class_dev, char *buf) -{ - struct tty_dev *tty_dev = to_tty_dev(class_dev); - return print_dev_t(buf, tty_dev->dev); -} -static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL); - -static void tty_add_class_device(char *name, dev_t dev, struct device *device) -{ - struct tty_dev *tty_dev = NULL; - int retval; - - tty_dev = kmalloc(sizeof(*tty_dev), GFP_KERNEL); - if (!tty_dev) - return; - memset(tty_dev, 0x00, sizeof(*tty_dev)); - - tty_dev->class_dev.dev = device; - tty_dev->class_dev.class = &tty_class; - snprintf(tty_dev->class_dev.class_id, BUS_ID_SIZE, "%s", name); - retval = class_device_register(&tty_dev->class_dev); - if (retval) - goto error; - class_device_create_file (&tty_dev->class_dev, &class_device_attr_dev); - tty_dev->dev = dev; - spin_lock(&tty_dev_list_lock); - list_add(&tty_dev->node, &tty_dev_list); - spin_unlock(&tty_dev_list_lock); - return; -error: - kfree(tty_dev); -} - -static void tty_remove_class_device(dev_t dev) -{ - struct tty_dev *tty_dev = NULL; - struct list_head *tmp; - int found = 0; - - spin_lock(&tty_dev_list_lock); - list_for_each (tmp, &tty_dev_list) { - tty_dev = list_entry(tmp, struct tty_dev, node); - if (tty_dev->dev == dev) { - list_del(&tty_dev->node); - found = 1; - break; - } - } - spin_unlock(&tty_dev_list_lock); - if (found) - class_device_unregister(&tty_dev->class_dev); -} +static struct class_simple *tty_class; /** * tty_register_device - register a tty device @@ -2181,7 +2109,7 @@ if (driver->type != TTY_DRIVER_TYPE_PTY) { char name[64]; tty_line_name(driver, index, name); - tty_add_class_device(name, dev, device); + class_simple_device_add(tty_class, dev, device, name); } } @@ -2196,7 +2124,7 @@ void tty_unregister_device(struct tty_driver *driver, unsigned index) { devfs_remove("%s%d", driver->devfs_name, index + driver->name_base); - tty_remove_class_device(MKDEV(driver->major, driver->minor_start) + index); + class_simple_device_remove(MKDEV(driver->major, driver->minor_start) + index); } EXPORT_SYMBOL(tty_register_device); @@ -2413,7 +2341,10 @@ static int __init tty_class_init(void) { - return class_register(&tty_class); + tty_class = class_simple_create(THIS_MODULE, "tty"); + if (IS_ERR(tty_class)) + return PTR_ERR(tty_class); + return 0; } postcore_initcall(tty_class_init); @@ -2438,7 +2369,7 @@ register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) panic("Couldn't register /dev/tty driver\n"); devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty"); - tty_add_class_device ("tty", MKDEV(TTYAUX_MAJOR, 0), NULL); + class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty"); strcpy(console_cdev.kobj.name, "dev.console"); cdev_init(&console_cdev, &console_fops); @@ -2446,7 +2377,7 @@ register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) panic("Couldn't register /dev/console driver\n"); devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console"); - tty_add_class_device ("console", MKDEV(TTYAUX_MAJOR, 1), NULL); + class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); tty_kobj.kset = tty_cdev.kobj.kset; kobject_register(&tty_kobj); @@ -2458,7 +2389,7 @@ register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) panic("Couldn't register /dev/ptmx driver\n"); devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx"); - tty_add_class_device ("ptmx", MKDEV(TTYAUX_MAJOR, 2), NULL); + class_simple_device_add(tty_class, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); #endif #ifdef CONFIG_VT @@ -2468,7 +2399,7 @@ register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) panic("Couldn't register /dev/tty0 driver\n"); devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0"); - tty_add_class_device ("tty0", MKDEV(TTY_MAJOR, 0), NULL); + class_simple_device_add(tty_class, MKDEV(TTY_MAJOR, 0), NULL, "tty0"); vty_init(); #endif Index: vt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- vt.c 23 Dec 2003 07:44:02 -0000 1.13 +++ vt.c 9 Feb 2004 07:31:07 -0000 1.14 @@ -206,17 +206,22 @@ sw->con_putc(vc, i, y, x); } -void hide_cursor(struct vc_data *vc) +static void hide_softcursor(struct vc_data *vc) { - if (cons_num == sel_cons) - clear_selection(); if (softcursor_original != -1) { scr_writew(softcursor_original,(u16 *) pos); if (DO_UPDATE) sw->con_putc(vc, softcursor_original, y, x); softcursor_original = -1; } +} + +void hide_cursor(struct vc_data *vc) +{ + if (cons_num == sel_cons) + clear_selection(); sw->con_cursor(vc, CM_ERASE); + hide_softcursor(vc); } void set_cursor(struct vc_data *vc) @@ -1380,7 +1385,7 @@ if (!vc) { vc = vc_allocate(index); if (!vc) - return index; + return -ENODEV; } tty->driver_data = vc; vc->vc_tty = tty; @@ -1401,10 +1406,11 @@ if (!tty || tty->count != 1) return; - vcs_remove_devfs(tty); vc = (struct vc_data *)tty->driver_data; - if (vc) + if (vc) { + vcs_remove_devfs(tty); vc->vc_tty = NULL; + } tty->driver_data = NULL; } @@ -1735,6 +1741,7 @@ /* Now to setup VT */ init_MUTEX(&vt->lock); vt->vt_num = current_vt; + vt->display_desc = (char *)display_desc; vt->first_vc = current_vc; vt->vc_count = vc_count; list_add_tail(&vt->node, &vt_list); @@ -1876,6 +1883,7 @@ return; } vt->vt_sw = csw; + vt->display_desc = (char *)desc; /* Set the VC states to the new default mode */ for (i = 0; i < vt->vc_count; i++) { Index: vt_proc.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt_proc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- vt_proc.c 23 Dec 2003 07:44:02 -0000 1.3 +++ vt_proc.c 9 Feb 2004 07:31:07 -0000 1.4 @@ -46,6 +46,19 @@ } static int +read_display_desc(char *page, char **start, off_t off, int count, int *eof, void *data) +{ + struct vt_struct *vt = (struct vt_struct*) data; + int len; + + if(!vt) return 0; + + len = sprintf(page, "%s\n", vt->display_desc ? vt->display_desc : ""); + + return generic_read(page, start, off, count, eof, len); +} + +static int read_kbd_phys(char *page, char **start, off_t off, int count, int *eof, void *data) { struct vt_struct *vt = (struct vt_struct*) data; @@ -89,11 +102,15 @@ vt->keyboard = handle; } handle->private = vt; + printk("keyboard: [%s] bound to [%s] vc:%d-%d\n", + handle->dev->name, vt->display_desc, vt->first_vc + 1, + vt->first_vc + vt->vc_count); } return count; } static vt_proc_entry vt_proc_list[] = { + {"display_desc", read_display_desc, 0, 0}, {"keyboard", read_kbd_phys, write_kbd_phys, 0}, {"", 0, 0, 0} }; |