From: Paul M. <le...@us...> - 2001-09-25 03:36:39
|
Update of /cvsroot/linux-mips/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv5739/drivers/char Modified Files: Config.in rtc.c serial.c tty_io.c vt.c Log Message: Sync with OSS 2.4.9. Index: Config.in =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/char/Config.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Config.in 2001/09/13 17:03:09 1.6 +++ Config.in 2001/09/25 03:36:35 1.7 @@ -185,7 +185,7 @@ tristate 'Siemens R3964 line discipline' CONFIG_R3964 tristate 'Applicom intelligent fieldbus card support' CONFIG_APPLICOM if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - tristate 'Sony Vaio Programmable I/O Control Device support' CONFIG_SONYPI $CONFIG_PCI + dep_tristate 'Sony Vaio Programmable I/O Control Device support' CONFIG_SONYPI $CONFIG_PCI fi mainmenu_option next_comment Index: rtc.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/char/rtc.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- rtc.c 2001/08/10 18:30:13 1.4 +++ rtc.c 2001/09/25 03:36:35 1.5 @@ -95,8 +95,6 @@ static struct timer_list rtc_irq_timer; -static loff_t rtc_llseek(struct file *file, loff_t offset, int origin); - static ssize_t rtc_read(struct file *file, char *buf, size_t count, loff_t *ppos); @@ -190,11 +188,6 @@ * Now all the various file operations that we export. */ -static loff_t rtc_llseek(struct file *file, loff_t offset, int origin) -{ - return -ESPIPE; -} - static ssize_t rtc_read(struct file *file, char *buf, size_t count, loff_t *ppos) { @@ -617,7 +610,7 @@ static struct file_operations rtc_fops = { owner: THIS_MODULE, - llseek: rtc_llseek, + llseek: no_llseek, read: rtc_read, #if RTC_IRQ poll: rtc_poll, @@ -730,16 +723,26 @@ if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) BCD_TO_BIN(year); /* This should never happen... */ - if (year >= 20 && year < 48) { + if (year < 20) { + epoch = 2000; + guess = "SRM (post-2000)"; + } else if (year >= 20 && year < 48) { epoch = 1980; guess = "ARC console"; } else if (year >= 48 && year < 72) { epoch = 1952; guess = "Digital UNIX"; +#if defined(__mips__) } else if (year >= 72 && year < 74) { epoch = 2000; guess = "Digital DECstation"; +#else + } else if (year >= 70) { + epoch = 1900; + guess = "Standard PC (1900)"; +#endif } + if (guess) printk(KERN_INFO "rtc: %s epoch (%lu) detected\n", guess, epoch); #endif Index: serial.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/char/serial.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serial.c 2001/08/25 06:24:45 1.4 +++ serial.c 2001/09/25 03:36:35 1.5 @@ -3912,6 +3912,22 @@ case 7: base_idx=idx-2; /* BAR 5*/ } + /* Some Titan cards are also a little weird */ + if (dev->vendor == PCI_VENDOR_ID_TITAN && + (dev->device == PCI_DEVICE_ID_TITAN_400L || + dev->device == PCI_DEVICE_ID_TITAN_800L)) { + switch (idx) { + case 0: base_idx = 1; + break; + case 1: base_idx = 2; + break; + default: + base_idx = 4; + offset = 8 * (idx - 2); + } + + } + port = pci_resource_start(dev, base_idx) + offset; if ((board->flags & SPCI_FL_BASE_TABLE) == 0) @@ -4681,6 +4697,19 @@ { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b0_4_921600 }, + { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_100L, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE1, 1, 921600 }, + { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_200L, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE1 | SPCI_FL_BASE_TABLE, 2, 921600 }, + /* The 400L and 800L have a custom hack in get_pci_port */ + { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_400L, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE_TABLE, 4, 921600 }, + { PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_800L, + PCI_ANY_ID, PCI_ANY_ID, + SPCI_FL_BASE_TABLE, 8, 921600 }, { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_1S_10x_550, PCI_ANY_ID, PCI_ANY_ID, 0, 0, Index: tty_io.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/char/tty_io.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tty_io.c 2001/08/25 02:19:27 1.5 +++ tty_io.c 2001/09/25 03:36:35 1.6 @@ -105,7 +105,6 @@ #ifdef CONFIG_VT extern void con_init_devfs (void); #endif -extern int rio_init(void); #define CONSOLE_DEV MKDEV(TTY_MAJOR,0) #define TTY_DEV MKDEV(TTYAUX_MAJOR,0) @@ -154,7 +153,7 @@ extern void con3215_init(void); extern void tty3215_init(void); extern void tub3270_con_init(void); -extern void tub3270_initfunc(void); +extern void tub3270_init(void); extern void rs285_console_init(void); extern void sa1100_rs_console_init(void); extern void sgi_serial_console_init(void); @@ -402,13 +401,8 @@ return cmd == TIOCSPGRP ? -ENOTTY : -EIO; } -static loff_t tty_lseek(struct file * file, loff_t offset, int orig) -{ - return -ESPIPE; -} - static struct file_operations tty_fops = { - llseek: tty_lseek, + llseek: no_llseek, read: tty_read, write: tty_write, poll: tty_poll, @@ -419,7 +413,7 @@ }; static struct file_operations hung_up_tty_fops = { - llseek: tty_lseek, + llseek: no_llseek, read: hung_up_tty_read, write: hung_up_tty_write, poll: hung_up_tty_poll, @@ -2200,6 +2194,8 @@ console_8xx_init(); #elif defined(CONFIG_MAC_SERIAL) mac_scc_console_init(); +#elif defined(CONFIG_PARISC) + pdc_console_init(); #elif defined(CONFIG_SERIAL) serial_console_init(); #endif /* CONFIG_8xx */ @@ -2216,15 +2212,18 @@ sci_console_init(); #endif #endif -#ifdef CONFIG_3215 - con3215_init(); -#endif -#ifdef CONFIG_3270_CONSOLE +#ifdef CONFIG_TN3270_CONSOLE tub3270_con_init(); #endif +#ifdef CONFIG_TN3215 + con3215_init(); +#endif #ifdef CONFIG_HWC hwc_console_init(); #endif +#ifdef CONFIG_STDIO_CONSOLE + stdio_console_init(); +#endif #ifdef CONFIG_SERIAL_21285_CONSOLE rs285_console_init(); #endif @@ -2320,6 +2319,7 @@ kbd_init(); #endif + #ifdef CONFIG_ESPSERIAL /* init ESP before rs, so rs doesn't see the port */ espserial_init(); #endif @@ -2356,9 +2356,6 @@ #ifdef CONFIG_SPECIALIX specialix_init(); #endif -#ifdef CONFIG_RIO - rio_init(); -#endif #if (defined(CONFIG_8xx) || defined(CONFIG_8260)) rs_8xx_init(); #endif /* CONFIG_8xx */ @@ -2372,10 +2369,10 @@ #ifdef CONFIG_VT vcs_init(); #endif -#ifdef CONFIG_3270 - tub3270_initfunc(); +#ifdef CONFIG_TN3270 + tub3270_init(); #endif -#ifdef CONFIG_3215 +#ifdef CONFIG_TN3215 tty3215_init(); #endif #ifdef CONFIG_HWC Index: vt.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/char/vt.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- vt.c 2001/06/22 02:29:32 1.1.1.1 +++ vt.c 2001/09/25 03:36:35 1.2 @@ -7,6 +7,7 @@ * Dynamic keymap and string allocation - ae...@cw... - May 1994 * Restrict VT switching via ioctl() - gr...@cs... - Dec 1995 * Some code moved for less code duplication - Andi Kleen - Mar 1997 + * Check put/get_user, cleanups - ac...@co... - Jun 2001 */ #include <linux/config.h> @@ -23,13 +24,11 @@ #include <linux/major.h> #include <linux/fs.h> #include <linux/console.h> +#include <linux/irq.h> #include <asm/io.h> #include <asm/uaccess.h> - -#if defined(__mc68000__) || defined(CONFIG_APUS) -#include <asm/machdep.h> -#endif +#include <asm/keyboard.h> #include <linux/kbd_kern.h> #include <linux/vt_kern.h> @@ -289,8 +288,10 @@ p = func_table[i]; if(p) for ( ; *p && sz; p++, sz--) - put_user(*p, q++); - put_user('\0', q); + if (put_user(*p, q++)) + return -EFAULT; + if (put_user('\0', q)) + return -EFAULT; return ((p && *p) ? -EOVERFLOW : 0); case KDSKBSENT: if (!perm) @@ -497,26 +498,26 @@ (cmd == KDENABIO)) ? -ENXIO : 0; #endif -#if defined(__mc68000__) || defined(CONFIG_APUS) - /* Linux/m68k interface for setting the keyboard delay/repeat rate */ + /* Linux m68k/i386 interface for setting the keyboard delay/repeat rate */ case KDKBDREP: { struct kbd_repeat kbrep; - if (!mach_kbdrate) return( -EINVAL ); - if (!suser()) return( -EPERM ); + if (!kbd_rate) return( -EINVAL ); + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; if (copy_from_user(&kbrep, (void *)arg, sizeof(struct kbd_repeat))) return -EFAULT; - if ((i = mach_kbdrate( &kbrep ))) return( i ); + if ((i = kbd_rate( &kbrep ))) + return i; if (copy_to_user((void *)arg, &kbrep, sizeof(struct kbd_repeat))) return -EFAULT; return 0; } -#endif case KDSETMODE: /* @@ -741,10 +742,8 @@ struct vt_stat *vtstat = (struct vt_stat *)arg; unsigned short state, mask; - i = verify_area(VERIFY_WRITE,(void *)vtstat, sizeof(struct vt_stat)); - if (i) - return i; - put_user(fg_console + 1, &vtstat->v_active); + if (put_user(fg_console + 1, &vtstat->v_active)) + return -EFAULT; state = 1; /* /dev/tty0 is always open */ for (i = 0, mask = 2; i < MAX_NR_CONSOLES && mask; ++i, mask <<= 1) if (VT_IS_IN_USE(i)) @@ -880,11 +879,9 @@ ushort ll,cc; if (!perm) return -EPERM; - i = verify_area(VERIFY_READ, (void *)vtsizes, sizeof(struct vt_sizes)); - if (i) - return i; - get_user(ll, &vtsizes->v_rows); - get_user(cc, &vtsizes->v_cols); + if (get_user(ll, &vtsizes->v_rows) || + get_user(cc, &vtsizes->v_cols)) + return -EFAULT; return vc_resize_all(ll, cc); } @@ -894,15 +891,15 @@ ushort ll,cc,vlin,clin,vcol,ccol; if (!perm) return -EPERM; - i = verify_area(VERIFY_READ, (void *)vtconsize, sizeof(struct vt_consize)); - if (i) - return i; - get_user(ll, &vtconsize->v_rows); - get_user(cc, &vtconsize->v_cols); - get_user(vlin, &vtconsize->v_vlin); - get_user(clin, &vtconsize->v_clin); - get_user(vcol, &vtconsize->v_vcol); - get_user(ccol, &vtconsize->v_ccol); + if (verify_area(VERIFY_READ, (void *)vtconsize, + sizeof(struct vt_consize))) + return -EFAULT; + __get_user(ll, &vtconsize->v_rows); + __get_user(cc, &vtconsize->v_cols); + __get_user(vlin, &vtconsize->v_vlin); + __get_user(clin, &vtconsize->v_clin); + __get_user(vcol, &vtconsize->v_vcol); + __get_user(ccol, &vtconsize->v_ccol); vlin = vlin ? vlin : video_scan_lines; if ( clin ) { @@ -1069,10 +1066,6 @@ if (!perm) return -EPERM; - i = verify_area(VERIFY_READ, (void *) arg, - sizeof(struct vc_mode)); - if (i) - return i; if (copy_from_user(&mode, (void *) arg, sizeof(mode))) return -EFAULT; return console_setmode(&mode, cmd == VC_SETMODE); @@ -1090,10 +1083,6 @@ was changed from 0x766a to 0x766c */ return console_powermode((int) arg); } - i = verify_area(VERIFY_READ, (void *) arg, - sizeof(int)); - if (i) - return i; if (get_user(cmap_size, (int *) arg)) return -EFAULT; if (cmap_size % 3) |