You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(135) |
Nov
(123) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(244) |
Feb
(72) |
Mar
(221) |
Apr
(91) |
May
(104) |
Jun
(93) |
Jul
(78) |
Aug
(1) |
Sep
(1) |
Oct
(29) |
Nov
(98) |
Dec
(20) |
2003 |
Jan
|
Feb
(21) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(18) |
Sep
(18) |
Oct
(23) |
Nov
(12) |
Dec
(6) |
2004 |
Jan
(2) |
Feb
(32) |
Mar
|
Apr
(12) |
May
(11) |
Jun
(11) |
Jul
|
Aug
(9) |
Sep
|
Oct
(15) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
(2) |
Mar
(11) |
Apr
(6) |
May
(1) |
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(2) |
Mar
|
Apr
(25) |
May
(2) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(13) |
Oct
|
Nov
(2) |
Dec
(2) |
2011 |
Jan
|
Feb
|
Mar
(10) |
Apr
(10) |
May
(1) |
Jun
(6) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
From: James S. <jsi...@us...> - 2001-12-26 17:28:13
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/i386 In directory usw-pr-cvs1:/tmp/cvs-serv5113/arch/i386 Modified Files: config.in Log Message: Synced to 2.5.0. Don't use. The default 2.5.0 has a nasty bug in it. Index: config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/i386/config.in,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- config.in 2001/11/13 19:38:21 1.29 +++ config.in 2001/12/26 17:28:10 1.30 @@ -234,8 +234,10 @@ if [ "$CONFIG_HOTPLUG" = "y" ] ; then source drivers/pcmcia/Config.in + source drivers/hotplug/Config.in else define_bool CONFIG_PCMCIA n + define_bool CONFIG_HOTPLUG_PCI n fi bool 'System V IPC' CONFIG_SYSVIPC @@ -254,6 +256,7 @@ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then dep_bool ' ACPI support' CONFIG_ACPI $CONFIG_PM + if [ "$CONFIG_ACPI" != "n" ]; then source drivers/acpi/Config.in fi @@ -274,10 +277,10 @@ source drivers/mtd/Config.in -source drivers/pnp/Config.in - source drivers/parport/Config.in +source drivers/pnp/Config.in + source drivers/serial/Config.in source drivers/block/Config.in @@ -358,7 +361,7 @@ # # input before char - char/joystick depends on it. -# +# source drivers/usb/Config.in source drivers/input/Config.in source drivers/char/Config.in |
From: James S. <jsi...@us...> - 2001-12-26 17:28:13
|
Update of /cvsroot/linuxconsole/ruby/linux/arch/alpha In directory usw-pr-cvs1:/tmp/cvs-serv5113/arch/alpha Modified Files: config.in Log Message: Synced to 2.5.0. Don't use. The default 2.5.0 has a nasty bug in it. Index: config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/arch/alpha/config.in,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- config.in 2001/11/13 19:38:21 1.21 +++ config.in 2001/12/26 17:28:10 1.22 @@ -296,6 +296,10 @@ fi endmenu +if [ "$CONFIG_PCI" = "y" ]; then + source drivers/message/fusion/Config.in +fi + if [ "$CONFIG_NET" = "y" ]; then mainmenu_option next_comment comment 'Network device support' @@ -357,14 +361,18 @@ mainmenu_option next_comment comment 'Kernel hacking' -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - tristate 'Kernel FP software completion' CONFIG_MATHEMU +bool 'Legacy kernel start address' CONFIG_ALPHA_LEGACY_START_ADDRESS + +bool 'Kernel debugging' CONFIG_DEBUG_KERNEL +if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then + tristate ' Kernel FP software completion' CONFIG_MATHEMU + bool ' Debug memory allocations' CONFIG_DEBUG_SLAB + bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ + bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK + bool ' Read-write spinlock debugging' CONFIG_DEBUG_RWLOCK + bool ' Semaphore debugging' CONFIG_DEBUG_SEMAPHORE else - define_tristate CONFIG_MATHEMU y + define_tristate CONFIG_MATHEMU y fi - -bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ - -bool 'Legacy kernel start address' CONFIG_ALPHA_LEGACY_START_ADDRESS endmenu |
From: James S. <jsi...@us...> - 2001-12-26 17:28:13
|
Update of /cvsroot/linuxconsole/ruby/linux In directory usw-pr-cvs1:/tmp/cvs-serv5113 Modified Files: Makefile Log Message: Synced to 2.5.0. Don't use. The default 2.5.0 has a nasty bug in it. Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/Makefile,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- Makefile 2001/11/23 04:10:15 1.41 +++ Makefile 2001/12/26 17:28:10 1.42 @@ -1,6 +1,6 @@ VERSION = 2 -PATCHLEVEL = 4 -SUBLEVEL = 14 +PATCHLEVEL = 5 +SUBLEVEL = 0 EXTRAVERSION = -ruby KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) @@ -186,6 +186,7 @@ DRIVERS-$(CONFIG_PHONE) += drivers/telephony/telephony.o DRIVERS-$(CONFIG_MD) += drivers/md/mddev.o DRIVERS-$(CONFIG_BLUEZ) += drivers/bluetooth/bluetooth.o +DRIVERS-$(CONFIG_HOTPLUG_PCI) += drivers/hotplug/vmlinux-obj.o DRIVERS := $(DRIVERS-y) |
From: Vojtech P. <vo...@us...> - 2001-12-25 10:52:11
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv13384 Modified Files: atkbd.c Log Message: Fix for keyboards that report unusual SET values. Index: atkbd.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/atkbd.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- atkbd.c 2001/12/23 20:36:22 1.27 +++ atkbd.c 2001/12/25 10:52:07 1.28 @@ -337,7 +337,7 @@ * itself. */ - return param; + return (param == atkbd_set) ? atkbd_set : 2; } /* |
From: James S. <jsi...@us...> - 2001-12-25 06:50:54
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv30082/drivers/serial Modified Files: ChangeLog serial_21285.c serial_8250.c serial_8250.h serial_8250_pci.c serial_8250_pnp.c serial_amba.c serial_anakin.c serial_clps711x.c serial_core.c serial_sa1100.c serial_uart00.c Log Message: Synced to RMK work. See ChangeLg for comments. Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/ChangeLog,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ChangeLog 2001/12/25 04:29:59 1.3 +++ ChangeLog 2001/12/25 06:50:51 1.4 @@ -9,3 +9,10 @@ 2001-12-24 James Simmons <jsi...@us...> * Removed ops field in uart_info. Instead use in in uart_port instead. +2001-12-24 James Simmons <jsi...@us...> + * Synced to RMK latest changes. He removed the awful table, termios + stuff from struct uart_driver. This makes life easier for us :-) + He also implemented a struct uart_xxx_port that wraps around the + default struct uart_port. From my experience with the fbdev layer + this is a bad idea and will lead to really bad code. This must + change. Index: serial_21285.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_21285.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- serial_21285.c 2001/12/25 04:29:59 1.8 +++ serial_21285.c 2001/12/25 06:50:51 1.9 @@ -54,9 +54,6 @@ #define H_UBRLCR_FIFO (1 << 4) static struct tty_driver normal, callout; -static struct tty_struct *serial21285_table[1]; -static struct termios *serial21285_termios[1]; -static struct termios *serial21285_termios_locked[1]; static const char serial21285_name[] = "Footbridge UART"; /* @@ -471,9 +468,6 @@ normal_driver: &normal, callout_major: SERIAL_21285_AUXMAJOR, callout_driver: &callout, - table: serial21285_table, - termios: serial21285_termios, - termios_locked: serial21285_termios_locked, minor: SERIAL_21285_MINOR, nr: 1, port: &serial21285_port, Index: serial_8250.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- serial_8250.c 2001/12/25 04:29:59 1.13 +++ serial_8250.c 2001/12/25 06:50:51 1.14 @@ -75,10 +75,7 @@ #define UART_NR ARRAY_SIZE(old_serial_port) static struct tty_driver normal, callout; -static struct tty_struct *serial8250_table[UART_NR]; -static struct termios *serial8250_termios[UART_NR], *serial8250_termios_locked[UART_NR]; #ifdef CONFIG_SERIAL_8250_CONSOLE -static struct console serial8250_console; static unsigned int lsr_break_flag; #endif static struct uart_info *IRQ_ports[NR_IRQS]; @@ -95,10 +92,13 @@ MODULE_PARM_DESC(force_rsa, "Force I/O ports for RSA"); #endif /* CONFIG_SERIAL_RSA */ -#define port_acr unused[0] /* 8bit */ -#define port_ier unused[1] /* 8bit */ -#define port_rev unused[2] /* 8bit */ -#define port_lcr unused[3] /* 8bit */ +struct uart_8250_port { + struct uart_port port; + u_char acr; + u_char ier; + u_char rev; + u_char lcr; +}; /* * Here we define the default xmit fifo size used for each type of UART. @@ -182,12 +182,13 @@ static unsigned int serial_icr_read(struct uart_port *port, int offset) { + struct uart_8250_port *up = (struct uart_8250_port *)port; unsigned int value; - serial_icr_write(port, UART_ACR, port->port_acr | UART_ACR_ICRRD); + serial_icr_write(port, UART_ACR, up->acr | UART_ACR_ICRRD); serial_out(port, UART_SCR, offset); value = serial_in(port, UART_ICR); - serial_icr_write(port, UART_ACR, port->port_acr); + serial_icr_write(port, UART_ACR, up->acr); return value; } @@ -284,6 +285,7 @@ static void autoconfig_startech_uarts(struct uart_port *port) { + struct uart_8250_port *up = (struct uart_8250_port *)port; unsigned char scratch, scratch2, scratch3, scratch4; /* @@ -301,7 +303,7 @@ * (Ex...@is...) claims that it's needed for 952 * dual UART's (which are not recommended for new designs). */ - port->port_acr = 0; + up->acr = 0; serial_out(port, UART_LCR, 0xBF); serial_out(port, UART_EFR, 0x10); serial_out(port, UART_LCR, 0x00); @@ -314,8 +316,8 @@ (scratch3 == 0x50 || scratch3 == 0x52 || scratch3 == 0x54)) { port->type = PORT_16C950; - port->port_rev = serial_icr_read(port, UART_REV) | - (scratch3 << 8); + up->rev = serial_icr_read(port, UART_REV) | + (scratch3 << 8); return; } } @@ -343,7 +345,7 @@ if (scratch == 0x10 || scratch == 0x12 || scratch == 0x14) { if (scratch == 0x10) - port->port_rev = scratch2; + up->rev = scratch2; port->type = PORT_16850; return; } @@ -624,42 +626,50 @@ static void serial8250_stop_tx(struct uart_port *port, u_int from_tty) { - if (port->port_ier & UART_IER_THRI) { - port->port_ier &= ~UART_IER_THRI; - serial_out(port, UART_IER, port->port_ier); + struct uart_8250_port *up = (struct uart_8250_port *)port; + + if (up->ier & UART_IER_THRI) { + up->ier &= ~UART_IER_THRI; + serial_out(port, UART_IER, up->ier); } if (port->type == PORT_16C950) { - port->port_acr |= UART_ACR_TXDIS; - serial_icr_write(port, UART_ACR, port->port_acr); + up->acr |= UART_ACR_TXDIS; + serial_icr_write(port, UART_ACR, up->acr); } } static void serial8250_start_tx(struct uart_port *port, u_int nonempty, u_int from_tty) { - if (nonempty && !(port->port_ier & UART_IER_THRI)) { - port->port_ier |= UART_IER_THRI; - serial_out(port, UART_IER, port->port_ier); + struct uart_8250_port *up = (struct uart_8250_port *)port; + + if (nonempty && !(up->ier & UART_IER_THRI)) { + up->ier |= UART_IER_THRI; + serial_out(port, UART_IER, up->ier); } /* * We only do this from uart_start */ if (from_tty && port->type == PORT_16C950) { - port->port_acr &= ~UART_ACR_TXDIS; - serial_icr_write(port, UART_ACR, port->port_acr); + up->acr &= ~UART_ACR_TXDIS; + serial_icr_write(port, UART_ACR, up->acr); } } static void serial8250_stop_rx(struct uart_port *port) { - port->port_ier &= ~UART_IER_RLSI; + struct uart_8250_port *up = (struct uart_8250_port *)port; + + up->ier &= ~UART_IER_RLSI; port->read_status_mask &= ~UART_LSR_DR; - serial_out(port, UART_IER, port->port_ier); + serial_out(port, UART_IER, up->ier); } static void serial8250_enable_ms(struct uart_port *port) { - port->port_ier |= UART_IER_MSI; - serial_out(port, UART_IER, port->port_ier); + struct uart_8250_port *up = (struct uart_8250_port *)port; + + up->ier |= UART_IER_MSI; + serial_out(port, UART_IER, up->ier); } static _INLINE_ void @@ -695,7 +705,7 @@ * may get masked by ignore_status_mask * or read_status_mask. */ - uart_handle_break(info, &serial8250_console); + uart_handle_break(info, port->cons); } else if (*status & UART_LSR_PE) port->icount.parity++; else if (*status & UART_LSR_FE) @@ -709,7 +719,7 @@ *status &= port->read_status_mask; #ifdef CONFIG_SERIAL_8250_CONSOLE - if (port->line == serial8250_console.index) { + if (port->line == port->cons->index) { /* Recover the break flag from console xmit */ *status |= lsr_break_flag; lsr_break_flag = 0; @@ -1085,21 +1095,24 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state) { + struct uart_8250_port *up = (struct uart_8250_port *)port; + if (break_state == -1) - port->port_lcr |= UART_LCR_SBC; + up->lcr |= UART_LCR_SBC; else - port->port_lcr &= ~UART_LCR_SBC; - serial_out(port, UART_LCR, port->port_lcr); + up->lcr &= ~UART_LCR_SBC; + serial_out(port, UART_LCR, up->lcr); } static int serial8250_startup(struct uart_port *port, struct uart_info *info) { + struct uart_8250_port *up = (struct uart_8250_port *)port; void (*handler)(int, void *, struct pt_regs *); int retval; if (port->type == PORT_16C950) { /* Wake up and initialize UART */ - port->port_acr = 0; + up->acr = 0; serial_outp(port, UART_LCR, 0xBF); serial_outp(port, UART_EFR, UART_EFR_ECB); serial_outp(port, UART_IER, 0); @@ -1197,8 +1210,8 @@ * are set via change_speed(), which will be occuring imminently * anyway, so we don't enable them here. */ - port->port_ier = UART_IER_RLSI | UART_IER_RDI; - serial_outp(port, UART_IER, port->port_ier); + up->ier = UART_IER_RLSI | UART_IER_RDI; + serial_outp(port, UART_IER, up->ier); #ifdef CONFIG_SERIAL_MANY_PORTS if (port->flags & ASYNC_FOURPORT) { @@ -1225,6 +1238,7 @@ static void serial8250_shutdown(struct uart_port *port, struct uart_info *info) { + struct uart_8250_port *up = (struct uart_8250_port *)port; struct uart_info **infop; int retval; @@ -1256,7 +1270,7 @@ /* * Disable all intrs */ - port->port_ier = 0; + up->ier = 0; serial_outp(port, UART_IER, 0); /* @@ -1286,6 +1300,7 @@ static void serial8250_change_speed(struct uart_port *port, u_int cflag, u_int iflag, u_int quot) { + struct uart_8250_port *up = (struct uart_8250_port *)port; unsigned char cval, fcr = 0; unsigned long flags; @@ -1314,7 +1329,7 @@ * when DLL is 0. */ if ((quot & 0xff) == 0 && port->type == PORT_16C950 && - port->port_rev == 0x5201) + up->rev == 0x5201) quot ++; if (uart_config[port->type].flags & UART_USE_FIFO) { @@ -1361,17 +1376,17 @@ /* * CTS flow control flag and modem status interrupts */ - port->port_ier &= ~UART_IER_MSI; + up->ier &= ~UART_IER_MSI; if (port->flags & ASYNC_HARDPPS_CD || cflag & CRTSCTS || !(cflag & CLOCAL)) - port->port_ier |= UART_IER_MSI; + up->ier |= UART_IER_MSI; /* * Ok, we're now changing the port state. Do it with * interrupts disabled. */ save_flags(flags); cli(); - serial_out(port, UART_IER, port->port_ier); + serial_out(port, UART_IER, up->ier); if (uart_config[port->type].flags & UART_STARTECH) { serial_outp(port, UART_LCR, 0xBF); @@ -1383,7 +1398,7 @@ if (port->type == PORT_16750) serial_outp(port, UART_FCR, fcr); /* set fcr */ serial_outp(port, UART_LCR, cval); /* reset DLAB */ - port->port_lcr = cval; /* Save LCR */ + up->lcr = cval; /* Save LCR */ if (port->type != PORT_16750) { if (fcr & UART_FCR_ENABLE_FIFO) { /* emulated UARTs (Lucent Venus 167x) need two steps */ @@ -1655,7 +1670,7 @@ verify_port: serial8250_verify_port, }; -static struct uart_port serial8250_ports[UART_NR]; +static struct uart_8250_port serial8250_ports[UART_NR]; static void __init serial8250_isa_init_ports(void) { @@ -1667,14 +1682,26 @@ first = 0; for (i = 0; i < ARRAY_SIZE(old_serial_port); i++) { - serial8250_ports[i].iobase = old_serial_port[i].port; - serial8250_ports[i].irq = irq_cannonicalize(old_serial_port[i].irq); - serial8250_ports[i].uartclk = old_serial_port[i].base_baud * 16; - serial8250_ports[i].flags = old_serial_port[i].flags; - serial8250_ports[i].ops = &serial8250_pops; + serial8250_ports[i].port.iobase = old_serial_port[i].port; + serial8250_ports[i].port.irq = irq_cannonicalize(old_serial_port[i].irq); + serial8250_ports[i].port.uartclk = old_serial_port[i].base_baud * 16; + serial8250_ports[i].port.flags = old_serial_port[i].flags; + serial8250_ports[i].port.ops = &serial8250_pops; } } +static void __init serial8250_register_ports(struct uart_driver *drv) +{ + int i; + + serial8250_isa_init_ports(); + + for (i = 0; i < UART_NR; i++) { + serial8250_ports[i].port.line = i; + uart_add_one_port(drv, &serial8250_ports[i].port); + } +} + #ifdef CONFIG_SERIAL_8250_CONSOLE #ifdef used_and_not_const_char_pointer static int serial8250_console_read(struct uart_port *port, char *s, u_int count) @@ -1717,7 +1744,7 @@ */ static void serial8250_console_write(struct console *co, const char *s, u_int count) { - struct uart_port *port = serial8250_ports + co->index; + struct uart_port *port = &serial8250_ports[co->index].port; unsigned int ier; int i; @@ -1759,7 +1786,7 @@ static int serial8250_console_wait_key(struct console *co) { - struct uart_port *port = serial8250_ports + co->index; + struct uart_port *port = &serial8250_ports[co->index].port; int ier, c; /* @@ -1794,11 +1821,15 @@ * if so, search for the first available port that does have * console support. */ +#if 0 port = uart_get_console(serial8250_ports, UART_NR, co); - +#else + if (co->index >= UART_NR) + co->index = 0; + port = &serial8250_ports[co->index].port; +#endif if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); - return uart_set_options(port, co, baud, parity, bits, flow); } @@ -1839,12 +1870,8 @@ callout_major: TTYAUX_MAJOR, normal_driver: &normal, callout_driver: &callout, - table: serial8250_table, - termios: serial8250_termios, - termios_locked: serial8250_termios_locked, minor: 64, - nr: ARRAY_SIZE(old_serial_port), - port: serial8250_ports, + nr: UART_NR, cons: SERIAL8250_CONSOLE, }; @@ -1883,6 +1910,7 @@ port->regshift = req->iomem_reg_shift; port->iotype = req->io_type; port->flags = req->flags | ASYNC_BOOT_AUTOCONF; + port->line = -1; if (HIGH_BITS_OFFSET) port->iobase |= req->port_high << HIGH_BITS_OFFSET; @@ -1910,14 +1938,37 @@ uart_unregister_port(&serial8250_reg, line); } +/* + * This is for ISAPNP only. + */ +void serial8250_get_irq_map(int *map) +{ + int i; + + for (i = 0; i < UART_NR; i++) { + if (serial8250_ports[i].port.type != PORT_UNKNOWN) + clear_bit(serial8250_ports[i].port.irq, map); + } +} + static int __init serial8250_init(void) { - serial8250_isa_init_ports(); - return uart_register_driver(&serial8250_reg); + int ret; + + ret = uart_register_driver(&serial8250_reg); + if (ret) + return ret; + + serial8250_register_ports(&serial8250_reg); + return 0; } static void __exit serial8250_exit(void) { + int i; + + for (i = 0; i < UART_NR; i++) + uart_remove_one_port(&serial8250_reg,&serial8250_ports[i].port); uart_unregister_driver(&serial8250_reg); } @@ -1926,7 +1977,7 @@ EXPORT_SYMBOL(register_serial); EXPORT_SYMBOL(unregister_serial); +EXPORT_SYMBOL(serial8250_get_irq_map); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 serial driver"); - Index: serial_8250.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serial_8250.h 2001/12/13 04:46:52 1.5 +++ serial_8250.h 2001/12/25 06:50:51 1.6 @@ -24,6 +24,7 @@ int serial8250_register_probe(struct serial8250_probe *probe); void serial8250_unregister_probe(struct serial8250_probe *probe); +void serial8250_get_irq_map(int *map); struct old_serial_port { unsigned int uart; @@ -46,7 +47,7 @@ #endif #endif -#if defined(CONFIG_ISAPNP)|| (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE)) +#ifdef __ISAPNP__ #ifndef ENABLE_SERIAL_PNP #define ENABLE_SERIAL_PNP #endif Index: serial_8250_pci.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pci.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- serial_8250_pci.c 2001/12/25 04:29:59 1.13 +++ serial_8250_pci.c 2001/12/25 06:50:51 1.14 @@ -1078,4 +1078,4 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module"); -//MODULE_GENERIC_TABLE(pci, serial_pci_tbl); +MODULE_DEVICE_TABLE(pci, serial_pci_tbl); Index: serial_8250_pnp.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pnp.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- serial_8250_pnp.c 2001/12/25 04:29:59 1.8 +++ serial_8250_pnp.c 2001/12/25 06:50:51 1.9 @@ -29,9 +29,6 @@ #include "serial_8250.h" -static struct serial_state rs_table[] = { }; -#define NR_PORTS 0 - struct pnpbios_device_id { char id[8]; @@ -312,16 +309,11 @@ static void inline avoid_irq_share(struct pci_dev *dev) { - int i, map = 0x1FF8; - struct serial_state *state = rs_table; struct isapnp_irq *irq; struct isapnp_resources *res = dev->sysdata; + int map = 0x1FF8; - for (i = 0; i < NR_PORTS; i++) { - if (state->type != PORT_UNKNOWN) - clear_bit(state->irq, &map); - state++; - } + serial8250_get_irq_map(&map); for ( ; res; res = res->alt) for(irq = res->irq; irq; irq = irq->next) @@ -549,5 +541,4 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 PNPBIOS serial probe module"); -//MODULE_GENERIC_TABLE(pnp, pnp_dev_table); - +MODULE_DEVICE_TABLE(pnpbios, pnp_dev_table); Index: serial_amba.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_amba.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- serial_amba.c 2001/12/25 04:29:59 1.11 +++ serial_amba.c 2001/12/25 06:50:51 1.12 @@ -78,11 +78,6 @@ #define CALLOUT_AMBA_NR UART_NR static struct tty_driver normal, callout; -static struct tty_struct *amba_table[UART_NR]; -static struct termios *amba_termios[UART_NR], *amba_termios_locked[UART_NR]; -#ifdef SUPPORT_SYSRQ -static struct console amba_console; -#endif #define AMBA_ISR_PASS_LIMIT 256 @@ -120,17 +115,18 @@ * We encode this bit information into port->driver_priv using the * following macros. */ -//#define PORT_CTRLS(dtrbit,rtsbit) ((1 << dtrbit) | (1 << (16 + rtsbit))) -#define PORT_CTRLS_DTR(port) (1 << (port)->unused[1]) -#define PORT_CTRLS_RTS(port) (1 << (port)->unused[0]) - #define SC_CTRLC (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLC_OFFSET) #define SC_CTRLS (IO_ADDRESS(INTEGRATOR_SC_BASE) + INTEGRATOR_SC_CTRLS_OFFSET) /* - * Our private driver data mappings. + * We wrap our port structure around the generic uart_port. */ -#define drv_old_status driver_priv +struct uart_amba_port { + struct uart_port port; + u_int dtr_mask; + u_int rts_mask; + u_int old_status; +}; static void ambauart_stop_tx(struct uart_port *port, u_int from_tty) { @@ -206,7 +202,7 @@ if (rsr & AMBA_UARTRSR_BE) { rsr &= ~(AMBA_UARTRSR_FE | AMBA_UARTRSR_PE); port->icount.brk++; - if (uart_handle_break(info, &amba_console)) + if (uart_handle_break(info, port->cons)) goto ignore_char; } else if (rsr & AMBA_UARTRSR_PE) port->icount.parity++; @@ -288,15 +284,16 @@ static void ambauart_modem_status(struct uart_info *info) { + struct uart_amba_port *uap = (struct uart_amba_port *)info->port; struct uart_port *port = info->port; unsigned int status, delta; - UART_PUT_ICR(port, 0); + UART_PUT_ICR(&uap->port, 0); - status = UART_GET_FR(port) & AMBA_UARTFR_MODEM_ANY; + status = UART_GET_FR(&uap->port) & AMBA_UARTFR_MODEM_ANY; - delta = status ^ info->drv_old_status; - info->drv_old_status = status; + delta = status ^ uap->old_status; + uap->old_status = status; if (!delta) return; @@ -362,17 +359,18 @@ static void ambauart_set_mctrl(struct uart_port *port, u_int mctrl) { + struct uart_amba_port *uap = (struct uart_amba_port *)port; u_int ctrls = 0, ctrlc = 0; if (mctrl & TIOCM_RTS) - ctrlc |= PORT_CTRLS_RTS(port); + ctrlc |= uap->rts_mask; else - ctrls |= PORT_CTRLS_RTS(port); + ctrls |= uap->rts_mask; if (mctrl & TIOCM_DTR) - ctrlc |= PORT_CTRLS_DTR(port); + ctrlc |= uap->dtr_mask; else - ctrls |= PORT_CTRLS_DTR(port); + ctrls |= uap->dtr_mask; __raw_writel(ctrls, SC_CTRLS); __raw_writel(ctrlc, SC_CTRLC); @@ -392,6 +390,7 @@ static int ambauart_startup(struct uart_port *port, struct uart_info *info) { + struct uart_amba_port *uap = (struct uart_amba_port *)port; int retval; /* @@ -404,7 +403,7 @@ /* * initialise the old status of the modem signals */ - info->drv_old_status = UART_GET_FR(port) & AMBA_UARTFR_MODEM_ANY; + uap->old_status = UART_GET_FR(port) & AMBA_UARTFR_MODEM_ANY; /* * Finally, enable interrupts @@ -578,28 +577,36 @@ verify_port: ambauart_verify_port, }; -static struct uart_port amba_ports[UART_NR] = { +static struct uart_amba_port amba_ports[UART_NR] = { { - membase: (void *)IO_ADDRESS(INTEGRATOR_UART0_BASE), - mapbase: INTEGRATOR_UART0_BASE, - iotype: SERIAL_IO_MEM, - irq: IRQ_UARTINT0, - uartclk: 14745600, - fifosize: 16, - unused: { 4, 5 }, /*driver_priv: PORT_CTRLS(5, 4), */ - ops: &amba_pops, - flags: ASYNC_BOOT_AUTOCONF, + port: { + membase: (void *)IO_ADDRESS(INTEGRATOR_UART0_BASE), + mapbase: INTEGRATOR_UART0_BASE, + iotype: SERIAL_IO_MEM, + irq: IRQ_UARTINT0, + uartclk: 14745600, + fifosize: 16, + unused: { 4, 5 }, /*driver_priv: PORT_CTRLS(5, 4), */ + ops: &amba_pops, + flags: ASYNC_BOOT_AUTOCONF, + }, + dtr_mask: 1 << 5, + rts_mask: 1 << 4, }, { - membase: (void *)IO_ADDRESS(INTEGRATOR_UART1_BASE), - mapbase: INTEGRATOR_UART1_BASE, - iotype: SERIAL_IO_MEM, - irq: IRQ_UARTINT1, - uartclk: 14745600, - fifosize: 16, - unused: { 6, 7 }, /*driver_priv: PORT_CTRLS(7, 6), */ - ops: &amba_pops, - flags: ASYNC_BOOT_AUTOCONF, + port: { + membase: (void *)IO_ADDRESS(INTEGRATOR_UART1_BASE), + mapbase: INTEGRATOR_UART1_BASE, + iotype: SERIAL_IO_MEM, + irq: IRQ_UARTINT1, + uartclk: 14745600, + fifosize: 16, + unused: { 6, 7 }, /*driver_priv: PORT_CTRLS(7, 6), */ + ops: &amba_pops, + flags: ASYNC_BOOT_AUTOCONF, + }, + dtr_mask: 1 << 7, + rts_mask: 1 << 6, } }; @@ -631,7 +638,7 @@ static void ambauart_console_write(struct console *co, const char *s, u_int count) { - struct uart_port *port = amba_ports + co->index; + struct uart_port *port = &amba_ports[co->index].port; unsigned int status, old_cr; int i; @@ -674,7 +681,7 @@ static int ambauart_console_wait_key(struct console *co) { - struct uart_port *port = amba_ports + co->index; + struct uart_port *port = &amba_ports[co->index].port; unsigned int status; do { @@ -721,8 +728,14 @@ * if so, search for the first available port that does have * console support. */ +#if 0 port = uart_get_console(amba_ports, UART_NR, co); - +#else + if (co->index >= UART_NR) + co->index = 0; + port = &amba_ports[co->index].port; +#endif + if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else @@ -767,22 +780,32 @@ normal_driver: &normal, callout_major: CALLOUT_AMBA_MAJOR, callout_driver: &callout, - table: amba_table, - termios: amba_termios, - termios_locked: amba_termios_locked, minor: SERIAL_AMBA_MINOR, nr: UART_NR, - port: amba_ports, cons: AMBA_CONSOLE, }; static int __init ambauart_init(void) { - return uart_register_driver(&amba_reg); + int ret; + + ret = uart_register_driver(&amba_reg); + if (ret == 0) { + int i; + + for (i = 0; i < UART_NR; i++) + uart_add_one_port(&amba_reg, &amba_ports[i].port); + } + return ret; } static void __exit ambauart_exit(void) { + int i; + + for (i = 0; i < UART_NR; i++) + uart_remove_one_port(&amba_reg, &amba_ports[i].port); + uart_unregister_driver(&amba_reg); } Index: serial_anakin.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_anakin.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serial_anakin.c 2001/12/25 04:29:59 1.4 +++ serial_anakin.c 2001/12/25 06:50:51 1.5 @@ -64,11 +64,13 @@ #define CALLOUT_ANAKIN_MINOR 32 static struct tty_driver normal, callout; -static struct tty_struct *anakin_table[UART_NR]; -static struct termios *anakin_termios[UART_NR], *anakin_termios_locked[UART_NR]; -static struct uart_state anakin_state[UART_NR]; static u_int txenable[NR_IRQS]; /* Software interrupt register */ +struct uart_anakin_port { + struct uart_port port; + struct uart_info *info; +}; + static inline unsigned int anakin_in(struct uart_port *port, u_int offset) { @@ -112,6 +114,7 @@ static void anakin_start_tx(struct uart_port *port, u_int nonempty, u_int from_tty) { + struct uart_anakin_port *up = (struct uart_anakin_port *)port; unsigned int flags; save_flags_cli(flags); @@ -121,7 +124,7 @@ txenable[port->irq] = TXENABLE; if ((anakin_in(port, 0x10) & TXEMPTY) && nonempty) { - anakin_transmit_buffer(port); + anakin_transmit_buffer(up->port); } } restore_flags(flags); @@ -273,8 +276,9 @@ static int anakin_startup(struct uart_port *port, struct uart_info *info) { - int retval; + struct uart_anakin_port *up = (struct uart_anakin_port *)port; unsigned int read,write; + int retval; /* * Allocate the IRQ @@ -300,8 +304,7 @@ /* Store the uart_info pointer so we can reference it in * anakin_start_tx() */ - port->unused = (u_int)info; - + up->info = info; return 0; } @@ -354,41 +357,51 @@ type: anakin_type, }; -static struct uart_port anakin_ports[UART_NR] = { +static struct uart_anakin_port anakin_ports[UART_NR] = { { - base: IO_BASE + UART0, - irq: IRQ_UART0, - uartclk: 3686400, - fifosize: 0, - ops: &anakin_pops, + port: { + base: IO_BASE + UART0, + irq: IRQ_UART0, + uartclk: 3686400, + fifosize: 0, + ops: &anakin_pops, + }, }, { - base: IO_BASE + UART1, - irq: IRQ_UART1, - uartclk: 3686400, - fifosize: 0, - ops: &anakin_pops, + port: { + base: IO_BASE + UART1, + irq: IRQ_UART1, + uartclk: 3686400, + fifosize: 0, + ops: &anakin_pops, + }, }, { - base: IO_BASE + UART2, - irq: IRQ_UART2, - uartclk: 3686400, - fifosize: 0, - ops: &anakin_pops, + port: { + base: IO_BASE + UART2, + irq: IRQ_UART2, + uartclk: 3686400, + fifosize: 0, + ops: &anakin_pops, + }, }, { - base: IO_BASE + UART3, - irq: IRQ_UART3, - uartclk: 3686400, - fifosize: 0, - ops: &anakin_pops, + port: { + base: IO_BASE + UART3, + irq: IRQ_UART3, + uartclk: 3686400, + fifosize: 0, + ops: &anakin_pops, + }, }, { - base: IO_BASE + UART4, - irq: IRQ_UART4, - uartclk: 3686400, - fifosize: 0, - ops: &anakin_pops, + port: { + base: IO_BASE + UART4, + irq: IRQ_UART4, + uartclk: 3686400, + fifosize: 0, + ops: &anakin_pops, + }, }, }; @@ -398,7 +411,7 @@ static void anakin_console_write(struct console *co, const char *s, u_int count) { - struct uart_port *port = anakin_ports + co->index; + struct uart_port *port = &anakin_ports[co->index].port; unsigned int flags, status, i; /* @@ -436,10 +449,11 @@ */ while (!(anakin_in(port, 0x10) & TXEMPTY)); - if (status & IRQENABLE) + if (status & IRQENABLE) { save_flags_cli(flags); anakin_out(port, 0x18, anakin_in(port, 0x18) | IRQENABLE); restore_flags(flags); + } } static kdev_t @@ -451,7 +465,7 @@ static int anakin_console_wait_key(struct console *co) { - struct uart_port *port = anakin_ports + co->index; + struct uart_port *port = &anakin_ports[co->index].port; unsigned int flags, status, ch; save_flags_cli(flags); @@ -501,7 +515,13 @@ * if so, search for the first available port that does have * console support. */ +#if 0 port = uart_get_console(anakin_ports, UART_NR, co); +#else + if (co->index >= UART_NR) + co->index = 0; + port = &anakin_ports[co->index].port; +#endif if (options) uart_parse_options(options, &baud, &parity, &bits); @@ -539,20 +559,24 @@ callout_major: CALLOUT_ANAKIN_MAJOR, callout_name: CALLOUT_ANAKIN_NAME, callout_driver: &callout, - table: anakin_table, - termios: anakin_termios, - termios_locked: anakin_termios_locked, minor: SERIAL_ANAKIN_MINOR, nr: UART_NR, - state: anakin_state, - port: anakin_ports, cons: ANAKIN_CONSOLE, }; static int __init anakin_init(void) { - return uart_register_port(&anakin_reg); + int ret; + + ret = uart_register_driver(&anakin_reg); + if (ret == 0) { + int i; + + for (i = 0; i < UART_NR; i++) + uart_add_one_port(&anakin_reg, &anakin_ports[i].port); + } + return ret; } __initcall(anakin_init); Index: serial_clps711x.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_clps711x.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- serial_clps711x.c 2001/12/25 04:29:59 1.11 +++ serial_clps711x.c 2001/12/25 06:50:51 1.12 @@ -59,19 +59,17 @@ #define UART_NR 2 -#define SERIAL_CLPS711X_NAME "ttyAM" +#define SERIAL_CLPS711X_NAME "ttyCL" #define SERIAL_CLPS711X_MAJOR 204 -#define SERIAL_CLPS711X_MINOR 16 +#define SERIAL_CLPS711X_MINOR 40 #define SERIAL_CLPS711X_NR UART_NR -#define CALLOUT_CLPS711X_NAME "cuaam" +#define CALLOUT_CLPS711X_NAME "cuacl" #define CALLOUT_CLPS711X_MAJOR 205 -#define CALLOUT_CLPS711X_MINOR 16 +#define CALLOUT_CLPS711X_MINOR 40 #define CALLOUT_CLPS711X_NR UART_NR static struct tty_driver normal, callout; -static struct tty_struct *clps711x_table[UART_NR]; -static struct termios *clps711x_termios[UART_NR], *clps711x_termios_locked[UART_NR]; /* * We use the relevant SYSCON register as a base address for these ports. @@ -661,10 +659,6 @@ normal_driver: &normal, callout_major: CALLOUT_CLPS711X_MAJOR, callout_driver: &callout, - - table: clps711x_table, - termios: clps711x_termios, - termios_locked: clps711x_termios_locked, minor: SERIAL_CLPS711X_MINOR, nr: UART_NR, Index: serial_core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_core.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- serial_core.c 2001/12/25 04:29:59 1.18 +++ serial_core.c 2001/12/25 06:50:51 1.19 @@ -831,7 +831,8 @@ * from incrementing, and hence any extra opens * of the port while we're auto-configging. */ - down(&info->state->count_sem); + if (down_interruptible(&info->state->count_sem)) + return -ERESTARTSYS; ret = -EBUSY; if (info->state->count == 1) { @@ -1348,38 +1349,38 @@ static struct uart_info *uart_get(struct uart_driver *drv, int line) { struct uart_state *state = drv->state + line; - struct uart_info *info; + struct uart_info *info = NULL; down(&state->count_sem); - state->count++; - if (state->info) + if (!state->port) goto out; - info = kmalloc(sizeof(struct uart_info), GFP_KERNEL); - if (info) { - memset(info, 0, sizeof(struct uart_info)); - init_waitqueue_head(&info->open_wait); - init_waitqueue_head(&info->close_wait); - init_waitqueue_head(&info->delta_msr_wait); - info->port = state->port; - info->flags = info->port->flags; - info->state = state; - tasklet_init(&info->tlet, uart_tasklet_action, - (unsigned long)info); + state->count++; + info = state->info; + + if (!info) { + info = kmalloc(sizeof(struct uart_info), GFP_KERNEL); + if (info) { + memset(info, 0, sizeof(struct uart_info)); + init_waitqueue_head(&info->open_wait); + init_waitqueue_head(&info->close_wait); + init_waitqueue_head(&info->delta_msr_wait); + info->port = state->port; + info->flags = info->port->flags; + info->state = state; + tasklet_init(&info->tlet, uart_tasklet_action, + (unsigned long)info); + state->info = info; + } else + state->count--; } - if (state->info) - kfree(info); - else - state->info = info; out: up(&state->count_sem); - return state->info; + return info; } /* - * Make sure we have the temporary buffer allocated. Note - * that we set retval appropriately above, and we rely on - * this. + * Make sure we have the temporary buffer allocated. */ static inline int uart_alloc_tmpbuf(void) { @@ -1411,23 +1412,44 @@ printk("uart_open(%d) called\n", line); #endif + /* + * tty->driver.num won't change, so we won't fail here with + * tty->driver_data set to something non-NULL (and therefore + * we won't get caught by uart_close()). + */ retval = -ENODEV; if (line >= tty->driver.num) goto fail; - if (!try_inc_mod_count(drv->owner)) + /* + * If we fail to increment the module use count, we can't have + * any other users of this tty (since this implies that the module + * is about to be unloaded). Therefore, it is safe to set + * tty->driver_data to be NULL, so uart_close() doesn't bite us. + */ + if (!try_inc_mod_count(drv->owner)) { + tty->driver_data = NULL; goto fail; + } + /* + * FIXME: This one isn't fun. We can't guarantee that the tty isn't + * already in open, nor can we guarantee the state of tty->driver_data + */ info = uart_get(drv, line); retval = -ENOMEM; - if (!info) - goto out; + if (!info) { + if (tty->driver_data) + goto out; + else + goto fail; + } /* - * Set the tty driver_data. If we fail from this point on, - * the generic tty layer will cause uart_close(), which will - * decrement the module use count. - */ + * Once we set tty->driver_data here, we are guaranteed that + * uart_close() will decrement the driver module use count. + * Any failures from here onwards should not touch the count. + */ tty->driver_data = info; info->tty = tty; info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; @@ -1485,7 +1507,7 @@ * Copy across the serial console cflag setting */ { - struct console *c = drv->cons; + struct console *c = info->port->cons; if (c && c->cflag && c->index == line) { tty->termios->c_cflag = c->cflag; c->cflag = 0; @@ -1767,7 +1789,7 @@ int running = state->info && state->info->flags & ASYNC_INITIALIZED; - if (port->type == PORT_UNKNOWN) + if (!port || port->type == PORT_UNKNOWN) return 0; //printk("pm: %08x: %d -> %d, %srunning\n", port->iobase, dev->state, pm_state, running ? "" : "not "); @@ -1785,8 +1807,8 @@ /* * Re-enable the console device after suspending. */ - if (state->cons && state->cons->index == port->line) - state->cons->flags |= CON_ENABLED; + if (port->cons && port->cons->index == port->line) + port->cons->flags |= CON_ENABLED; } else if (pm_state == 1) { if (ops->pm) ops->pm(port, pm_state, oldstate); @@ -1794,8 +1816,8 @@ /* * Disable the console device before suspending. */ - if (state->cons && state->cons->index == port->line) - state->cons->flags &= ~CON_ENABLED; + if (port->cons && port->cons->index == port->line) + port->cons->flags &= ~CON_ENABLED; if (running) { ops->stop_tx(port, 0); @@ -1860,24 +1882,15 @@ } static void -uart_setup_port(struct uart_driver *drv, struct uart_state *state) +__uart_register_port(struct uart_driver *drv, struct uart_state *state, + struct uart_port *port) { - struct uart_port *port = state->port; - int flags = UART_CONFIG_TYPE; - - init_MUTEX(&state->count_sem); - - state->close_delay = 5 * HZ / 10; - state->closing_wait = 30 * HZ; + u_int flags; + state->port = port; + port->type = PORT_UNKNOWN; - -#ifdef CONFIG_PM - state->cons = drv->cons; - state->pm = pm_register(PM_SYS_DEV, PM_SYS_COM, uart_pm); - if (state->pm) - state->pm->data = state; -#endif + port->cons = drv->cons; /* * If there isn't a port here, don't do anything further. @@ -1889,39 +1902,80 @@ * Now do the auto configuration stuff. Note that config_port * is expected to claim the resources and map the port for us. */ + flags = UART_CONFIG_TYPE; if (port->flags & ASYNC_AUTO_IRQ) flags |= UART_CONFIG_IRQ; if (port->flags & ASYNC_BOOT_AUTOCONF) port->ops->config_port(port, flags); /* - * Only register this port if it is detected. + * Register the port whether it's detected or not. This allows + * setserial to be used to alter this ports parameters. */ + tty_register_devfs(drv->normal_driver, 0, drv->minor + port->line); + tty_register_devfs(drv->callout_driver, 0, drv->minor + port->line); + if (port->type != PORT_UNKNOWN) { - tty_register_devfs(drv->normal_driver, 0, drv->minor + - state->port->line); - tty_register_devfs(drv->callout_driver, 0, drv->minor + - state->port->line); uart_report_port(drv, port); - } #ifdef CONFIG_PM + /* + * Power down all ports by default, except + * the console if we have one. + */ + if (state->pm && (!drv->cons || port->line != drv->cons->index)) + pm_send(state->pm, PM_SUSPEND, (void *)3); +#endif + } +} + +/* + * This reverses the affects of __uart_register_port. + */ +static void +__uart_unregister_port(struct uart_driver *drv, struct uart_state *state) +{ + struct uart_port *port = state->port; + /* - * Power down all ports by default, except the console if we have one. + * Hang up the line to kill all usage of this port. + */ + if (state->info && state->info->tty) + tty_hangup(state->info->tty); + + /* + * Remove the devices from devfs */ - if (state->pm && (!drv->cons || port->line != drv->cons->index)) - pm_send(state->pm, PM_SUSPEND, (void *)3); -#endif + tty_unregister_devfs(drv->normal_driver, drv->minor + port->line); + tty_unregister_devfs(drv->callout_driver, drv->minor + port->line); + + /* + * Free the ports resources, if any. + */ + if (port->type != PORT_UNKNOWN) + port->ops->release_port(port); + + /* + * Indicate that there isn't a port here anymore. + */ + port->type = PORT_UNKNOWN; + + /* + * Kill the tasklet, and free resources. + */ + if (state->info) { + tasklet_kill(&state->info->tlet); + kfree(state->info); + } } /* - * Register a set of ports with the core driver. Note that we don't - * printk any information about the ports; that is up to the low level - * driver to do if they so wish. + * Register a set of ports with the core driver. */ int uart_register_driver(struct uart_driver *drv) { struct tty_driver *normal, *callout; + struct termios **termios; int i, retval; if (drv->state) @@ -1941,6 +1995,11 @@ memset(drv->state, 0, sizeof(struct uart_state) * drv->nr + sizeof(int)); + termios = kmalloc(sizeof(struct termios *) * drv->nr * 2 + + sizeof(struct tty_struct *) * drv->nr, GFP_KERNEL); + if (!termios) + goto out; + normal = drv->normal_driver; callout = drv->callout_driver; @@ -1956,9 +2015,9 @@ normal->init_termios.c_cflag = B38400 | CS8 | CREAD | HUPCL | CLOCAL; normal->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS; normal->refcount = (int *)(drv->state + drv->nr); - normal->table = drv->table; - normal->termios = drv->termios; - normal->termios_locked = drv->termios_locked; + normal->termios = termios; + normal->termios_locked = termios + drv->nr; + normal->table = (struct tty_struct **)(termios + drv->nr * 2); normal->driver_state = drv; normal->open = uart_open; @@ -1992,27 +2051,53 @@ callout->major = drv->callout_major; callout->subtype = SERIAL_TYPE_CALLOUT; callout->read_proc = NULL; - callout->proc_entry = NULL; + /* + * Initialise the UART state(s). + */ for (i = 0; i < drv->nr; i++) { struct uart_state *state = drv->state + i; + init_MUTEX(&state->count_sem); state->callout_termios = callout->init_termios; state->normal_termios = normal->init_termios; - state->port = drv->port + i; - state->port->line = i; - - uart_setup_port(drv, state); - } + state->close_delay = 5 * HZ / 10; + state->closing_wait = 30 * HZ; +#ifdef CONFIG_PM + state->pm = pm_register(PM_SYS_DEV, PM_SYS_COM, uart_pm); + if (state->pm) + state->pm->data = state; +#endif + } retval = tty_register_driver(normal); - if (retval) + if (retval) goto out; retval = tty_register_driver(callout); - if (retval) + if (retval) { tty_unregister_driver(normal); + goto out; + } + /* + * And finally the port(s). This part will eventually + * become the responsibility of the low level drivers - + * and will allow the low level drivers to extend the + * uart_port structure in any way they see fit. + * + * Any drivers using this method should not set drv->port. + */ + if (drv->port) { + printk("serial_core: driver %s uses obsolete registration\n", + drv->normal_name); + for (i = 0; i < drv->nr; i++) { + struct uart_port *port = drv->port + i; + + port->line = i; + __uart_register_port(drv, drv->state + i, port); + } + } out: if (retval && drv->state) kfree(drv->state); @@ -2022,33 +2107,60 @@ void uart_unregister_driver(struct uart_driver *drv) { int i; - - for (i = 0; i < drv->nr; i++) { - struct uart_state *state = drv->state + i; - if (state->info && state->info->tty) - tty_hangup(state->info->tty); - - pm_unregister(state->pm); + /* + * First, remove all ports. We only do this if the driver + * isn't using the new API (and therefore registering its own + * port structures). + */ + if (drv->port) { + for (i = 0; i < drv->nr; i++) { + struct uart_state *state = drv->state + i; + + __uart_unregister_port(drv, state); + } + } - if (state->port->type != PORT_UNKNOWN) - state->port->ops->release_port(state->port); - if (state->info) { - tasklet_kill(&state->info->tlet); - kfree(state->info); - } - } + for (i = 0; i < drv->nr; i++) + pm_unregister(drv->state[i].pm); tty_unregister_driver(drv->normal_driver); tty_unregister_driver(drv->callout_driver); kfree(drv->state); + kfree(drv->normal_driver->termios); } +int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) +{ + struct uart_state *state = drv->state + port->line; + + down(&state->count_sem); + __uart_register_port(drv, state, port); + up(&state->count_sem); + + return 0; +} + +int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port) +{ + struct uart_state *state = drv->state + port->line; + + if (state->port != port) + printk(KERN_ALERT "Removing wrong port: %p != %p\n", + state->port, port); + + down(&state->count_sem); + __uart_unregister_port(drv, state); + up(&state->count_sem); + return 0; +} + static int uart_match_port(struct uart_port *port1, struct uart_port *port2) { if (port1->iotype != port2->iotype) return 0; + switch (port1->iotype) { case SERIAL_IO_PORT: return (port1->iobase == port2->iobase); case SERIAL_IO_MEM: return (port1->membase == port2->membase); @@ -2065,19 +2177,23 @@ * type of the port if ASYNC_BOOT_AUTOCONF is set, and detect the IRQ * if ASYNC_AUTO_IRQ is set. * + * We try to pick the same port for the same IO base address, so that + * when a modem is plugged in, unplugged and plugged back in, it gets + * allocated the same port. + * * Returns negative error, or positive line number. */ int uart_register_port(struct uart_driver *drv, struct uart_port *port) { struct uart_state *state = NULL; - int i, flags = UART_CONFIG_TYPE; + int i; + down(&port_sem); /* * First, find a port entry which matches. Note: if we do * find a matching entry, and it has a non-zero use count, * then we can't register the port. */ - down(&port_sem); for (i = 0; i < drv->nr; i++) { if (uart_match_port(drv->state[i].port, port)) { down(&drv->state[i].count_sem); @@ -2120,6 +2236,11 @@ } } + /* + * Ok, we've found a line that we can use. We have taken the + * per-port semaphore, so we can release the global port + * semaphore now. + */ up(&port_sem); if (!state) @@ -2149,34 +2270,9 @@ state->port->regshift = port->regshift; state->port->iotype = port->iotype; state->port->flags = port->flags; - -#if 0 //def CONFIG_PM - /* we have already registered the power management handlers */ - state->pm = pm_register(PM_SYS_DEV, PM_SYS_COM, uart_pm); - if (state->pm) { - state->pm->data = state; - - /* - * Power down all ports by default, except - * the console if we have one. - */ - if (!drv->cons || state->port->line != drv->cons->index) - pm_send(state->pm, PM_SUSPEND, (void *)3); - } -#endif - - if (state->port->flags & ASYNC_AUTO_IRQ) - flags |= UART_CONFIG_IRQ; - if (state->port->flags & ASYNC_BOOT_AUTOCONF) - state->port->ops->config_port(state->port, flags); - - tty_register_devfs(drv->normal_driver, 0, drv->minor + - state->port->line); - tty_register_devfs(drv->callout_driver, 0, drv->minor + - state->port->line); - - uart_report_port(drv, state->port); + state->port->line = drv->state - state; + __uart_register_port(drv, state, state->port); up(&state->count_sem); return i; } @@ -2197,36 +2293,7 @@ state = drv->state + line; down(&state->count_sem); - /* - * The port has already gone. We have to hang up the line - * to kill all usage of this port. - */ - if (state->info && state->info->tty) - tty_hangup(state->info->tty); - - /* - * Free the ports resources, if any. - */ - state->port->ops->release_port(state->port); - - /* - * Indicate that there isn't a port here anymore. - */ - state->port->type = PORT_UNKNOWN; - -#if 0 // not yet - /* - * No point in doing power management for hardware that - * isn't present. - */ - pm_unregister(state->pm); -#endif - - /* - * Remove the devices from devfs - */ - tty_unregister_devfs(drv->normal_driver, drv->minor + line); - tty_unregister_devfs(drv->callout_driver, drv->minor + line); + __uart_unregister_port(drv, state); up(&state->count_sem); } Index: serial_sa1100.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_sa1100.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- serial_sa1100.c 2001/12/25 04:29:59 1.16 +++ serial_sa1100.c 2001/12/25 06:50:51 1.17 @@ -98,13 +98,8 @@ #define UART_PORT_SIZE 0x24 static struct tty_driver normal, callout; -static struct tty_struct *sa1100_table[NR_PORTS]; -static struct termios *sa1100_termios[NR_PORTS], *sa1100_termios_locked[NR_PORTS]; static int (*sa1100_open)(struct uart_port *, struct uart_info *); static void (*sa1100_close)(struct uart_port *, struct uart_info *); -#ifdef SUPPORT_SYSRQ -static struct console sa1100_console; -#endif /* * interrupts disabled on entry @@ -289,7 +284,7 @@ if (status & UTSR0_REB) { #ifdef SUPPORT_SYSRQ - if (port->line == sa1100_console.index && + if (port->line == port->cons->index && !info->sysrq) { info->sysrq = jiffies + HZ*5; } @@ -787,9 +782,6 @@ normal_driver: &normal, callout_major: CALLOUT_SA1100_MAJOR, callout_driver: &callout, - table: sa1100_table, - termios: sa1100_termios, - termios_locked: sa1100_termios_locked, minor: MINOR_START, nr: NR_PORTS, port: sa1100_ports, Index: serial_uart00.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_uart00.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serial_uart00.c 2001/12/25 04:29:59 1.4 +++ serial_uart00.c 2001/12/25 06:50:51 1.5 @@ -81,13 +81,8 @@ #define CALLOUT_UART00_MINOR 16 /* Temporary - will change in future */ #define CALLOUT_UART00_NR UART_NR - - static struct tty_driver normal, callout; -static struct tty_struct *uart00_table[UART_NR]; -static struct termios *uart00_termios[UART_NR], *uart00_termios_locked[UART_NR]; //static struct uart_state uart00_state[UART_NR]; -static struct console uart00_console; #define UART00_ISR_PASS_LIMIT 256 @@ -187,7 +182,7 @@ port->icount.brk++; #ifdef SUPPORT_SYSRQ - if (uart_handle_break(info, &uart00_console)) + if (uart_handle_break(info, port->cons)) goto ignore_char; #endif } else if (rds & UART_RDS_PE_MSK) @@ -782,9 +777,6 @@ callout_major: CALLOUT_UART00_MAJOR, callout_name: CALLOUT_UART00_NAME, callout_driver: &callout, - table: uart00_table, - termios: uart00_termios, - termios_locked: uart00_termios_locked, minor: SERIAL_UART00_MINOR, nr: UART_NR, state: NULL, |
From: James S. <jsi...@us...> - 2001-12-25 06:50:54
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv30082/include/linux Modified Files: serial_core.h Log Message: Synced to RMK work. See ChangeLg for comments. Index: serial_core.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/serial_core.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serial_core.h 2001/12/13 04:46:52 1.10 +++ serial_core.h 2001/12/25 06:50:51 1.11 @@ -126,16 +126,18 @@ u_char x_char; u_char regshift; /* reg offset shift */ u_char iotype; /* io access style */ - u_char hub6; - u_char unused[7]; u_int read_status_mask; u_int ignore_status_mask; u_int flags; u_int type; /* port type */ struct uart_ops *ops; struct uart_icount icount; + struct circ_buf xmit; + struct console *cons; /* need this to handle cons */ u_int line; u_long mapbase; /* for ioremap */ + u_char hub6; /* this should be in the 8250 driver */ + u_char unused[3]; }; /* @@ -157,7 +159,6 @@ struct semaphore count_sem; /* this protects 'count' */ #ifdef CONFIG_PM struct pm_dev *pm; - struct console *cons; /* need this to handle cons */ #endif }; @@ -171,10 +172,8 @@ struct uart_info { spinlock_t lock; struct uart_port *port; - struct uart_ops *ops; struct uart_state *state; struct tty_struct *tty; - struct circ_buf xmit; u_int flags; u_int event; @@ -219,14 +218,15 @@ int callout_major; const char *callout_name; struct tty_driver *callout_driver; - struct tty_struct **table; - struct termios **termios; - struct termios **termios_locked; int minor; int nr; - struct uart_state *state; /* driver should pass NULL */ - struct uart_port *port; /* array of port information */ struct console *cons; + + /* This is obsolete */ + struct uart_port *port; /* array of port information */ + + /* These are private */ + struct uart_state *state; /* driver should pass NULL */ }; void uart_event(struct uart_info *info, int event); @@ -240,6 +240,8 @@ void uart_unregister_driver(struct uart_driver *uart); void uart_unregister_port(struct uart_driver *reg, int line); int uart_register_port(struct uart_driver *reg, struct uart_port *port); +int uart_add_one_port(struct uart_driver *reg, struct uart_port *port); +int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port); /* * The following are helper functions for the low level drivers. @@ -284,7 +286,7 @@ #define uart_handle_break(info,con) __uart_handle_break(info,con) #define uart_handle_sysrq_char(info,ch,regs) __uart_handle_sysrq_char(info,ch,regs) #else -#define uart_handle_break(info,con) __uart_handle_break(info,NULL) +#define uart_handle_break(info,con) __uart_handle_break(info,NULL) #define uart_handle_sysrq_char(info,ch,regs) (0) #endif @@ -334,13 +336,13 @@ if (info->tty->hw_stopped) { if (status) { info->tty->hw_stopped = 0; - info->ops->start_tx(port, 1, 0); + port->ops->start_tx(port, 1, 0); uart_event(info, EVT_WRITE_WAKEUP); } } else { if (!status) { info->tty->hw_stopped = 1; - info->ops->stop_tx(port, 0); + port->ops->stop_tx(port, 0); } } spin_unlock_irqrestore(&info->lock, flags); |
From: James S. <jsi...@us...> - 2001-12-25 04:30:02
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv12595 Modified Files: ChangeLog serial_21285.c serial_8250.c serial_8250_pci.c serial_8250_pnp.c serial_amba.c serial_anakin.c serial_clps711x.c serial_core.c serial_sa1100.c serial_uart00.c Log Message: See ChangeLog for changes. Begain the tty/serial seperation. Tested and it seems to work. Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ChangeLog 2001/11/23 01:44:32 1.2 +++ ChangeLog 2001/12/25 04:29:59 1.3 @@ -1,5 +1,11 @@ -2001-11-22 James Simmons <jsi...@tr...> +2001-12-22 James Simmons <jsi...@tr...> * Final port of Russell King's code. Today we are going to * start working on a better api for 2.5. + +2001-12-24 James Simmons <jsi...@us...> + * Moved xmit circular buffer from struct uart_info to struct uart_port + +2001-12-24 James Simmons <jsi...@us...> + * Removed ops field in uart_info. Instead use in in uart_port instead. Index: serial_21285.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_21285.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- serial_21285.c 2001/12/13 04:46:52 1.7 +++ serial_21285.c 2001/12/25 04:29:59 1.8 @@ -163,7 +163,7 @@ port->x_char = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { serial21285_stop_tx(port, 0); @@ -171,18 +171,18 @@ } do { - *CSR_UARTDR = info->xmit.buf[info->xmit.tail]; - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + *CSR_UARTDR = port->xmit.buf[port->xmit.tail]; + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0 && !(*CSR_UARTFLG & 0x20)); - if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < + if (CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) serial21285_stop_tx(port, 0); } Index: serial_8250.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serial_8250.c 2001/12/22 16:58:36 1.12 +++ serial_8250.c 2001/12/25 04:29:59 1.13 @@ -763,7 +763,7 @@ *intr_done = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { serial8250_stop_tx(port, 0); @@ -772,14 +772,14 @@ count = port->fifosize; do { - serial_out(port, UART_TX, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + serial_out(port, UART_TX, port->xmit.buf[port->xmit.tail]); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0); - if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < + if (CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); @@ -789,8 +789,8 @@ if (intr_done) *intr_done = 0; - if (info->xmit.head == info->xmit.tail) - serial8250_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + serial8250_stop_tx(port, 0); } static _INLINE_ void check_modem_status(struct uart_info *info) Index: serial_8250_pci.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pci.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serial_8250_pci.c 2001/12/13 04:46:52 1.12 +++ serial_8250_pci.c 2001/12/25 04:29:59 1.13 @@ -1078,4 +1078,4 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module"); -MODULE_GENERIC_TABLE(pci, serial_pci_tbl); +//MODULE_GENERIC_TABLE(pci, serial_pci_tbl); Index: serial_8250_pnp.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pnp.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- serial_8250_pnp.c 2001/12/13 04:46:52 1.7 +++ serial_8250_pnp.c 2001/12/25 04:29:59 1.8 @@ -549,5 +549,5 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 PNPBIOS serial probe module"); -MODULE_GENERIC_TABLE(pnp, pnp_dev_table); +//MODULE_GENERIC_TABLE(pnp, pnp_dev_table); Index: serial_amba.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_amba.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serial_amba.c 2001/12/13 04:46:52 1.10 +++ serial_amba.c 2001/12/25 04:29:59 1.11 @@ -262,7 +262,7 @@ port->x_char = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { ambauart_stop_tx(port, 0); @@ -271,19 +271,19 @@ count = port->fifosize >> 1; do { - UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + UART_PUT_CHAR(port, port->xmit.buf[port->xmit.tail]); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0); - if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < + if (CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) - ambauart_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + ambauart_stop_tx(port, 0); } static void ambauart_modem_status(struct uart_info *info) Index: serial_anakin.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_anakin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serial_anakin.c 2001/12/13 04:46:52 1.3 +++ serial_anakin.c 2001/12/25 04:29:59 1.4 @@ -88,29 +88,25 @@ } static inline void -anakin_transmit_buffer(struct uart_info *info) +anakin_transmit_buffer(struct uart_port *port) { - struct uart_port *port = info->port; - while (!(anakin_in(port, 0x10) & TXEMPTY)); - anakin_out(port, 0x14, info->xmit.buf[info->xmit.tail]); + anakin_out(port, 0x14, port->xmit.buf[port->xmit.tail]); anakin_out(port, 0x18, anakin_in(port, 0x18) | SENDREQUEST); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE-1); - info->state->icount.tx++; + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE-1); + port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) anakin_stop_tx(port, 0); } static inline void -anakin_transmit_x_char(struct uart_info *info) +anakin_transmit_x_char(struct uart_port *port) { - struct uart_port *port = info->port; - - anakin_out(port, 0x14, info->x_char); + anakin_out(port, 0x14, port->x_char); anakin_out(port, 0x18, anakin_in(port, 0x18) | SENDREQUEST); - info->state->icount.tx++; - info->x_char = 0; + port->icount.tx++; + port->x_char = 0; } static void @@ -125,10 +121,9 @@ txenable[port->irq] = TXENABLE; if ((anakin_in(port, 0x10) & TXEMPTY) && nonempty) { - anakin_transmit_buffer((struct uart_info*)port->unused); + anakin_transmit_buffer(port); } } - restore_flags(flags); } @@ -163,40 +158,42 @@ if (tty->flip.count < TTY_FLIPBUF_SIZE) { *tty->flip.char_buf_ptr++ = ch; *tty->flip.flag_buf_ptr++ = TTY_NORMAL; - info->state->icount.rx++; + info->port->icount.rx++; tty->flip.count++; } tty_flip_buffer_push(tty); } static inline void -anakin_overrun_chars(struct uart_info *info) +anakin_overrun_chars(struct uart_port *port) { unsigned int ch; - ch = anakin_in(info->port, 0x14); - info->state->icount.overrun++; + ch = anakin_in(port, 0x14); + port->icount.overrun++; } static inline void anakin_tx_chars(struct uart_info *info) { - if (info->x_char) { - anakin_transmit_x_char(info); + struct uart_port *port = info->port; + + if (port->x_char) { + anakin_transmit_x_char(port); return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { - anakin_stop_tx(info->port, 0); + anakin_stop_tx(port, 0); return; } - anakin_transmit_buffer(info); + anakin_transmit_buffer(port); - if (CIRC_CNT(info->xmit.head, - info->xmit.tail, + if (CIRC_CNT(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); } @@ -213,7 +210,7 @@ anakin_rx_chars(info); if (status & OVERRUN) - anakin_overrun_chars(info); + anakin_overrun_chars(info->port); if (txenable[info->port->irq] && (status & TX)) anakin_tx_chars(info); Index: serial_clps711x.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_clps711x.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serial_clps711x.c 2001/12/13 04:46:52 1.10 +++ serial_clps711x.c 2001/12/25 04:29:59 1.11 @@ -224,29 +224,29 @@ port->x_char = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { - clps711xuart_stop_tx(info->port, 0); + clps711xuart_stop_tx(port, 0); return; } count = port->fifosize >> 1; do { - clps_writel(info->xmit.buf[info->xmit.tail], UARTDR(port)); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + clps_writel(port->xmit.buf[port->xmit.tail], UARTDR(port)); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0); - if (CIRC_CNT(info->xmit.head, - info->xmit.tail, + if (CIRC_CNT(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) - clps711xuart_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + clps711xuart_stop_tx(port, 0); } static u_int clps711xuart_tx_empty(struct uart_port *port) Index: serial_core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_core.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- serial_core.c 2001/12/13 04:46:52 1.17 +++ serial_core.c 2001/12/25 04:29:59 1.18 @@ -100,16 +100,18 @@ unsigned long flags; spin_lock_irqsave(&info->lock, flags); - info->ops->stop_tx(info->port, 1); + info->port->ops->stop_tx(info->port, 1); spin_unlock_irqrestore(&info->lock, flags); } static void __uart_start(struct tty_struct *tty) { struct uart_info *info = tty->driver_data; - if (info->xmit.head != info->xmit.tail && info->xmit.buf && + struct uart_port *port = info->port; + + if (port->xmit.head != port->xmit.tail && port->xmit.buf && !tty->stopped && !tty->hw_stopped) - info->ops->start_tx(info->port, 1, 1); + info->port->ops->start_tx(port, 1, 1); } static void uart_start(struct tty_struct *tty) @@ -175,14 +177,14 @@ goto errout; } - if (info->xmit.buf) + if (info->port->xmit.buf) free_page(page); else - info->xmit.buf = (unsigned char *) page; + info->port->xmit.buf = (unsigned char *) page; info->mctrl = 0; - retval = info->ops->startup(info->port, info); + retval = info->port->ops->startup(info->port, info); if (retval) { if (capable(CAP_SYS_ADMIN)) { if (info->tty) @@ -194,7 +196,7 @@ if (info->tty) clear_bit(TTY_IO_ERROR, &info->tty->flags); - info->xmit.head = info->xmit.tail = 0; + info->port->xmit.head = info->port->xmit.tail = 0; /* * Set up the tty->alt_speed kludge @@ -213,7 +215,7 @@ */ if (info->tty->termios->c_cflag & CBAUD) info->mctrl = TIOCM_RTS | TIOCM_DTR; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); info->flags |= ASYNC_INITIALIZED; retval = 0; @@ -245,17 +247,17 @@ /* * Free the IRQ and disable the port */ - info->ops->shutdown(info->port, info); + info->port->ops->shutdown(info->port, info); - if (info->xmit.buf) { - unsigned long pg = (unsigned long) info->xmit.buf; - info->xmit.buf = NULL; + if (info->port->xmit.buf) { + unsigned long pg = (unsigned long) info->port->xmit.buf; + info->port->xmit.buf = NULL; free_page(pg); } if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) info->mctrl &= ~(TIOCM_DTR|TIOCM_RTS); - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); /* kill off our tasklet */ tasklet_kill(&info->tlet); @@ -358,21 +360,22 @@ pm_access(info->state->pm); - info->ops->change_speed(port, cflag, info->tty->termios->c_iflag, quot); + info->port->ops->change_speed(port, cflag, info->tty->termios->c_iflag, quot); } static void uart_put_char(struct tty_struct *tty, u_char ch) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; unsigned long flags; - if (!tty || !info->xmit.buf) + if (!tty || !port->xmit.buf) return; spin_lock_irqsave(&info->lock, flags); - if (CIRC_SPACE(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) != 0) { - info->xmit.buf[info->xmit.head] = ch; - info->xmit.head = (info->xmit.head + 1) & (UART_XMIT_SIZE - 1); + if (CIRC_SPACE(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) != 0) { + port->xmit.buf[port->xmit.head] = ch; + port->xmit.head = (port->xmit.head + 1) & (UART_XMIT_SIZE - 1); } spin_unlock_irqrestore(&info->lock, flags); } @@ -386,18 +389,19 @@ const u_char * buf, int count) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; unsigned long flags; int c, ret = 0; - if (!tty || !info->xmit.buf || !tmp_buf) + if (!tty || !port->xmit.buf || !tmp_buf) return 0; if (from_user) { down(&tmp_buf_sem); while (1) { int c1; - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, + c = CIRC_SPACE_TO_END(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE); if (count < c) c = count; @@ -411,13 +415,13 @@ break; } spin_lock_irqsave(&info->lock, flags); - c1 = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, + c1 = CIRC_SPACE_TO_END(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE); if (c1 < c) c = c1; - memcpy(info->xmit.buf + info->xmit.head, tmp_buf, c); - info->xmit.head = (info->xmit.head + c) & + memcpy(port->xmit.buf + port->xmit.head, tmp_buf, c); + port->xmit.head = (port->xmit.head + c) & (UART_XMIT_SIZE - 1); spin_unlock_irqrestore(&info->lock, flags); buf += c; @@ -428,15 +432,15 @@ } else { spin_lock_irqsave(&info->lock, flags); while (1) { - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, + c = CIRC_SPACE_TO_END(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE); if (count < c) c = count; if (c <= 0) break; - memcpy(info->xmit.buf + info->xmit.head, buf, c); - info->xmit.head = (info->xmit.head + c) & + memcpy(port->xmit.buf + port->xmit.head, buf, c); + port->xmit.head = (port->xmit.head + c) & (UART_XMIT_SIZE - 1); buf += c; count -= c; @@ -452,20 +456,23 @@ static int uart_write_room(struct tty_struct *tty) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; - return CIRC_SPACE(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE); + return CIRC_SPACE(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE); } static int uart_chars_in_buffer(struct tty_struct *tty) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; - return CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE); + return CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE); } static void uart_flush_buffer(struct tty_struct *tty) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; unsigned long flags; #ifdef DEBUG @@ -473,7 +480,7 @@ MINOR(tty->device) - tty->driver.minor_start); #endif spin_lock_irqsave(&info->lock, flags); - info->xmit.head = info->xmit.tail = 0; + port->xmit.head = port->xmit.tail = 0; spin_unlock_irqrestore(&info->lock, flags); wake_up_interruptible(&tty->write_wait); if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && @@ -491,7 +498,7 @@ info->port->x_char = ch; if (ch) - info->ops->start_tx(info->port, 1, 0); + info->port->ops->start_tx(info->port, 1, 0); } static void uart_throttle(struct tty_struct *tty) @@ -505,7 +512,7 @@ if (tty->termios->c_cflag & CRTSCTS) { spin_lock_irqsave(&info->lock, flags); info->mctrl &= ~TIOCM_RTS; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); spin_unlock_irqrestore(&info->lock, flags); } } @@ -525,7 +532,7 @@ if (tty->termios->c_cflag & CRTSCTS) { spin_lock_irqsave(&info->lock, flags); info->mctrl |= TIOCM_RTS; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); spin_unlock_irqrestore(&info->lock, flags); } } @@ -749,7 +756,7 @@ unsigned long flags; spin_lock_irqsave(&info->lock, flags); - result = info->ops->tx_empty(info->port); + result = info->port->ops->tx_empty(info->port); spin_unlock_irqrestore(&info->lock, flags); /* @@ -759,7 +766,7 @@ * interrupt happens). */ if (info->port->x_char || - ((CIRC_CNT(info->xmit.head, info->xmit.tail, + ((CIRC_CNT(info->port->xmit.head, info->port->xmit.tail, UART_XMIT_SIZE) > 0) && !info->tty->stopped && !info->tty->hw_stopped)) result &= ~TIOCSER_TEMT; @@ -771,7 +778,7 @@ { unsigned int result = info->mctrl; - result |= info->ops->get_mctrl(info->port); + result |= info->port->ops->get_mctrl(info->port); return put_user(result, value); } @@ -794,7 +801,7 @@ default: ret = -EINVAL; break; } if (old != info->mctrl) - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); spin_unlock_irq(&info->lock); return ret; } @@ -806,7 +813,7 @@ if (info->port->type != PORT_UNKNOWN) { spin_lock_irqsave(&info->lock, flags); - info->ops->break_ctl(info->port, break_state); + info->port->ops->break_ctl(info->port, break_state); spin_unlock_irqrestore(&info->lock, flags); } } @@ -910,7 +917,7 @@ /* note the counters on entry */ cprev = info->port->icount; /* Force modem status interrupts on */ - info->ops->enable_ms(info->port); + info->port->ops->enable_ms(info->port); spin_unlock_irq(&info->lock); while (1) { interruptible_sleep_on(&info->delta_msr_wait); @@ -971,8 +978,8 @@ break; default: - if (info->ops->ioctl) - ret = info->ops->ioctl(info->port, cmd, arg); + if (info->port->ops->ioctl) + ret = info->port->ops->ioctl(info->port, cmd, arg); break; } return ret; @@ -995,7 +1002,7 @@ /* Handle transition to B0 status */ if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) { info->mctrl &= ~(TIOCM_RTS | TIOCM_DTR); - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); } /* Handle transition away from B0 status */ @@ -1004,7 +1011,7 @@ if (!(cflag & CRTSCTS) || !test_bit(TTY_THROTTLED, &tty->flags)) info->mctrl |= TIOCM_RTS; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); } /* Handle turning off CRTSCTS */ @@ -1103,7 +1110,7 @@ * disable the receive line status interrupts. */ if (info->flags & ASYNC_INITIALIZED) { - info->ops->stop_rx(info->port); + info->port->ops->stop_rx(info->port); /* * Before we drop DTR, make sure the UART transmitter * has completely drained; this is especially @@ -1133,8 +1140,8 @@ */ pm_send(info->state->pm, PM_SUSPEND, (void *)3); #else - if (info->ops->pm) - info->ops->pm(info->port, 3, 0); + if (info->port->ops->pm) + info->port->ops->pm(info->port, 3, 0); #endif } @@ -1188,7 +1195,7 @@ MINOR(tty->device) - tty->driver.minor_start, jiffies, expire); #endif - while (!info->ops->tx_empty(info->port)) { + while (!info->port->ops->tx_empty(info->port)) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(char_time); if (signal_pending(current)) @@ -1302,7 +1309,7 @@ if (!(info->flags & ASYNC_CALLOUT_ACTIVE) && (tty->termios->c_cflag & CBAUD)) { info->mctrl = TIOCM_DTR | TIOCM_RTS; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); } spin_unlock_irqrestore(&info->lock, flags); set_current_state(TASK_INTERRUPTIBLE); @@ -1317,7 +1324,7 @@ if (!(info->flags & ASYNC_CALLOUT_ACTIVE) && !(info->flags & ASYNC_CLOSING) && (do_clocal || - (info->ops->get_mctrl(info->port) & TIOCM_CAR))) + (info->port->ops->get_mctrl(info->port) & TIOCM_CAR))) break; if (signal_pending(current)) { retval = -ERESTARTSYS; @@ -1356,7 +1363,6 @@ init_waitqueue_head(&info->delta_msr_wait); info->port = state->port; info->flags = info->port->flags; - info->ops = info->port->ops; info->state = state; tasklet_init(&info->tlet, uart_tasklet_action, (unsigned long)info); @@ -1448,8 +1454,8 @@ #ifdef CONFIG_PM pm_send(info->state->pm, PM_RESUME, (void *)0); #else - if (info->ops->pm) - info->ops->pm(info->port, 0, 3); + if (info->port->ops->pm) + info->port->ops->pm(info->port, 0, 3); #endif /* @@ -1847,7 +1853,7 @@ printk("I/O 0x%x offset 0x%x", port->iobase, port->hub6); break; case SERIAL_IO_MEM: - printk("MEM 0x%x", port->mapbase); + printk("MEM 0x%lx", port->mapbase); break; } printk(" (irq = %d) is a %s\n", port->irq, uart_type(port)); Index: serial_sa1100.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_sa1100.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- serial_sa1100.c 2001/12/13 04:46:52 1.15 +++ serial_sa1100.c 2001/12/25 04:29:59 1.16 @@ -237,10 +237,10 @@ port->x_char = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { - sa1100_stop_tx(info->port, 0); + sa1100_stop_tx(port, 0); return; } @@ -249,19 +249,19 @@ * still had the '4 bytes repeated' problem. */ while (UART_GET_UTSR1(port) & UTSR1_TNF) { - UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + UART_PUT_CHAR(port, port->xmit.buf[port->xmit.tail]); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } - if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < + if (CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) - sa1100_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + sa1100_stop_tx(port, 0); } static void sa1100_int(int irq, void *dev_id, struct pt_regs *regs) Index: serial_uart00.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_uart00.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serial_uart00.c 2001/12/13 04:46:52 1.3 +++ serial_uart00.c 2001/12/25 04:29:59 1.4 @@ -243,30 +243,30 @@ return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { - uart00_stop_tx(info->port, 0); + uart00_stop_tx(port, 0); return; } count = port->fifosize >> 1; do { while((UART_GET_TSR(port)& UART_TSR_TX_LEVEL_MSK)==15); - UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + UART_PUT_CHAR(port, port->xmit.buf[port->xmit.tail]); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0); - if (CIRC_CNT(info->xmit.head, - info->xmit.tail, + if (CIRC_CNT(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) - uart00_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + uart00_stop_tx(port, 0); } static void uart00_start_tx(struct uart_port *port, u_int nonempty, u_int from_tty) @@ -322,13 +322,13 @@ if (info->tty->hw_stopped) { if (status) { info->tty->hw_stopped = 0; - info->ops->start_tx(info->port, 1, 0); + info->port->ops->start_tx(info->port, 1, 0); uart_event(info, EVT_WRITE_WAKEUP); } } else { if (!status) { info->tty->hw_stopped = 1; - info->ops->stop_tx(info->port, 0); + info->port->ops->stop_tx(info->port, 0); } } } |
From: Vojtech P. <vo...@us...> - 2001-12-23 20:36:26
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv25693 Modified Files: atkbd.c Log Message: Re-added ATKBD_DEBUG ... Index: atkbd.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/atkbd.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- atkbd.c 2001/09/25 10:12:07 1.26 +++ atkbd.c 2001/12/23 20:36:22 1.27 @@ -206,6 +206,9 @@ int timeout = 1000; /* 10 msec */ atkbd->ack = 0; +#ifdef ATKBD_DEBUG + printk(KERN_DEBUG "atkbd.c: Sent: %02x\n", byte); +#endif serio_write(atkbd->serio, byte); while (!atkbd->ack && timeout--) udelay(10); |
From: James S. <jsi...@us...> - 2001-12-23 04:59:49
|
Update of /cvsroot/linuxconsole/ruby/linux/kernel In directory usw-pr-cvs1:/tmp/cvs-serv30847 Modified Files: printk.c Log Message: A much improved release_console_sem function. Now it can handle the 3 different cases for the TTY/console layer. Index: printk.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/kernel/printk.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- printk.c 2001/12/07 00:56:47 1.21 +++ printk.c 2001/12/23 04:59:46 1.22 @@ -490,8 +490,12 @@ /** * release_console_sem - unlock the console system * - * Releases the semaphore which the caller holds on the console system - * and the console driver list. + * Releases the semaphore which the caller holds that is shared between + * the TTY and console system. This function is the most complex. It can + * be called by a driver that only has a console i.e lp console and no + * tty, the tty system that has no console associated with it, or the final + * type which is hardware driven by both a console driver and tty driver. + * We have to handle all 3 cases. * * While the semaphore was held, console output may have been buffered * by printk(). If this is the case, release_console_sem() emits @@ -509,13 +513,16 @@ unsigned long flags; struct console *con; - spin_lock(&console_lock); - /* Look for new messages */ - for (con = console_drivers; con; con = con->next) { - if (con->device(con) == device) - break; + if (driver && driver->console) + con = driver->console; + else { + spin_lock(&console_lock); + for (con = console_drivers; con; con = con->next) { + if (con->device(con) == device) + break; + } + spin_unlock(&console_lock); } - spin_unlock(&console_lock); if (con) { for ( ; ; ) { @@ -533,13 +540,13 @@ if (must_wake_klogd && !oops_in_progress) wake_up_interruptible(&log_wait); up(&con->lock); + return; } -/* + if (driver) { driver->may_schedule = 0; - up(&driver->tty_lock); + up(driver->tty_lock); } -*/ } /** console_conditional_schedule - yield the CPU if required |
From: James S. <jsi...@us...> - 2001-12-23 00:04:21
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/video In directory usw-pr-cvs1:/tmp/cvs-serv17799/drivers/video Modified Files: fbcon.c mdacon.c nvvgacon.c vgacon.c Log Message: multihead support is back. Index: fbcon.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/fbcon.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- fbcon.c 2001/12/08 00:58:07 1.59 +++ fbcon.c 2001/12/23 00:04:18 1.60 @@ -736,7 +736,7 @@ vt->kmalloced = 1; vt->vt_sw = &fb_con; - display_desc = create_vt(vt, 0); + display_desc = vt_map_display(vt, 0); if (!display_desc) return -ENODEV; printk("Console: %s %s %dx%d\n", vt->default_mode->vc_can_do_color ? "colour" : "mono",display_desc, vt->default_mode->vc_cols, vt->default_mode->vc_rows); Index: mdacon.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/mdacon.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- mdacon.c 2001/12/08 00:58:07 1.40 +++ mdacon.c 2001/12/23 00:04:18 1.41 @@ -592,7 +592,7 @@ mda_vt.kmalloced = 0; #endif mda_vt.vt_sw = &mda_con; - display_desc = create_vt(&mda_vt, 1); + display_desc = vt_map_display(&mda_vt, 1); if (!display_desc) return -ENODEV; printk("Console: mono %s %dx%d\n", display_desc, mda_vt.default_mode->vc_cols, mda_vt.default_mode->vc_rows); Index: nvvgacon.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/nvvgacon.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- nvvgacon.c 2001/10/29 22:58:43 1.16 +++ nvvgacon.c 2001/12/23 00:04:18 1.17 @@ -844,9 +844,9 @@ vt->vt_sw = &nvvga_con; vt->vcs.vc_cons[0] = vc; #ifdef MODULE - display_desc = create_vt(vt, 1); + display_desc = vt_map_display(vt, 1); #else - display_desc = create_vt(vt, 0); + display_desc = vt_map_display(vt, 0); #endif q = (long) kmalloc(vc->vc_screenbuf_size, GFP_KERNEL); if (!display_desc || !q) { Index: vgacon.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/video/vgacon.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- vgacon.c 2001/12/08 00:58:07 1.59 +++ vgacon.c 2001/12/23 00:04:18 1.60 @@ -965,7 +965,7 @@ vga_vt.kmalloced = 0; #endif vga_vt.vt_sw = &vga_con; - display_desc = create_vt(&vga_vt, 1); + display_desc = vt_map_display(&vga_vt, 1); if (!display_desc) return -ENODEV; printk("Console: %s %s %dx%d\n", vga_vt.default_mode->vc_can_do_color ? "colour" : "mono", |
From: James S. <jsi...@us...> - 2001-12-23 00:04:21
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv17799/drivers/char Modified Files: keyboard.c vt.c Log Message: multihead support is back. Index: keyboard.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/keyboard.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- keyboard.c 2001/10/06 16:11:13 1.61 +++ keyboard.c 2001/12/23 00:04:18 1.62 @@ -1078,6 +1078,7 @@ if (!vt->keyboard) { vt->keyboard = handle; handle->private = vt; + vt_map_input(vt); break; } else vt = vt->next; Index: vt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/vt.c,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- vt.c 2001/12/09 01:43:35 1.115 +++ vt.c 2001/12/23 00:04:18 1.116 @@ -1497,9 +1497,9 @@ } /* - * Mapping and unmapping VT display + * Mapping and unmapping devices to a VT */ -const char *create_vt(struct vt_struct *vt, int init) +const char *vt_map_display(struct vt_struct *vt, int init) { const char *display_desc = vt->vt_sw->con_startup(vt, init); @@ -1543,6 +1543,50 @@ return display_desc; } +/* + * This is called when we have detected a keyboard and have a VT lacking one + */ +void vt_map_input(struct vt_struct *vt) +{ + struct tty_driver *vty_driver; + + vty_driver = kmalloc(sizeof(struct tty_driver), GFP_KERNEL); + memset(vty_driver, 0, sizeof(struct tty_driver)); + + vty_driver->refcount = kmalloc(sizeof(int), GFP_KERNEL); + vty_driver->table = kmalloc(sizeof(struct tty_struct) * MAX_NR_USER_CONSOLES, GFP_KERNEL); + vty_driver->termios = kmalloc(sizeof(struct termios) * MAX_NR_USER_CONSOLES, GFP_KERNEL); + vty_driver->termios_locked = kmalloc(sizeof(struct termios) * MAX_NR_USER_CONSOLES, GFP_KERNEL); + + vty_driver->magic = TTY_DRIVER_MAGIC; + vty_driver->name = "vc/%d"; + vty_driver->name_base = vt->first_vc; + vty_driver->major = TTY_MAJOR; + vty_driver->minor_start = vt->first_vc; + vty_driver->num = MAX_NR_USER_CONSOLES; + vty_driver->type = TTY_DRIVER_TYPE_CONSOLE; + vty_driver->init_termios = tty_std_termios; + vty_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS; +#ifdef CONFIG_VT_CONSOLE + if (admin_vt == vt) + vty_driver->console = &vt_console_driver; +#endif + vty_driver->open = vt_open; + vty_driver->close = vt_close; + vty_driver->write = vt_write; + vty_driver->write_room = vt_write_room; + vty_driver->put_char = vt_put_char; + vty_driver->flush_chars = vt_flush_chars; + vty_driver->chars_in_buffer = vt_chars_in_buffer; + vty_driver->ioctl = vt_ioctl; + vty_driver->stop = vt_stop; + vty_driver->start = vt_start; + vty_driver->throttle = vt_throttle; + vty_driver->unthrottle = vt_unthrottle; + if (tty_register_driver(vty_driver)) + printk("Couldn't register console driver\n"); +} + int release_vt(struct vt_struct *vt) { return 0; @@ -1565,8 +1609,6 @@ int __init vty_init(void) { - struct tty_driver *vty_driver; - #if defined (CONFIG_PROM_CONSOLE) prom_con_init(); #endif @@ -1575,41 +1617,6 @@ #endif kbd_init(); console_map_init(); - - vty_driver = kmalloc(sizeof(struct tty_driver), GFP_KERNEL); - memset(vty_driver, 0, sizeof(struct tty_driver)); - - vty_driver->refcount = kmalloc(sizeof(int), GFP_KERNEL); - vty_driver->table = kmalloc(sizeof(struct tty_struct) * MAX_NR_USER_CONSOLES, GFP_KERNEL); - vty_driver->termios = kmalloc(sizeof(struct termios) * MAX_NR_USER_CONSOLES, GFP_KERNEL); - vty_driver->termios_locked = kmalloc(sizeof(struct termios) * MAX_NR_USER_CONSOLES, GFP_KERNEL); - - vty_driver->magic = TTY_DRIVER_MAGIC; - vty_driver->name = "vc/%d"; - vty_driver->name_base = 0; //current_vc; - vty_driver->major = TTY_MAJOR; - vty_driver->minor_start = 0; //current_vc; - vty_driver->num = MAX_NR_USER_CONSOLES; - vty_driver->type = TTY_DRIVER_TYPE_CONSOLE; - vty_driver->init_termios = tty_std_termios; - vty_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS; -#ifdef CONFIG_VT_CONSOLE - vty_driver->console = &vt_console_driver; -#endif - vty_driver->open = vt_open; - vty_driver->close = vt_close; - vty_driver->write = vt_write; - vty_driver->write_room = vt_write_room; - vty_driver->put_char = vt_put_char; - vty_driver->flush_chars = vt_flush_chars; - vty_driver->chars_in_buffer = vt_chars_in_buffer; - vty_driver->ioctl = vt_ioctl; - vty_driver->stop = vt_stop; - vty_driver->start = vt_start; - vty_driver->throttle = vt_throttle; - vty_driver->unthrottle = vt_unthrottle; - if (tty_register_driver(vty_driver)) - printk("Couldn't register console driver\n"); vcs_init(); return 0; } @@ -1689,7 +1696,7 @@ EXPORT_SYMBOL(default_red); EXPORT_SYMBOL(default_grn); EXPORT_SYMBOL(default_blu); -EXPORT_SYMBOL(create_vt); +EXPORT_SYMBOL(vt_map_display); EXPORT_SYMBOL(release_vt); EXPORT_SYMBOL(vc_resize); EXPORT_SYMBOL(vc_init); |
From: James S. <jsi...@us...> - 2001-12-23 00:04:21
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv17799/include/linux Modified Files: vt_kern.h Log Message: multihead support is back. Index: vt_kern.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/vt_kern.h,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- vt_kern.h 2001/12/08 00:58:07 1.62 +++ vt_kern.h 2001/12/23 00:04:18 1.63 @@ -250,7 +250,8 @@ /* vt.c */ struct console_font_op; -const char* create_vt(struct vt_struct *vt, int init); +const char *vt_map_display(struct vt_struct *vt, int init); +void vt_map_input(struct vt_struct *vt); int release_vt(struct vt_struct *vt); struct vc_data* find_vc(int currcons); struct vc_data* vc_allocate(unsigned int console); |
From: James S. <jsi...@us...> - 2001-12-22 17:04:50
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv1083 Modified Files: Config.in Log Message: Not every serial driver has been converted over to new serial api. Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/Config.in,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- Config.in 2001/12/13 22:04:42 1.33 +++ Config.in 2001/12/22 17:04:47 1.34 @@ -31,48 +31,49 @@ bool ' Support special multiport boards' CONFIG_SERIAL_MULTIPORT bool ' Support the Bell Technologies HUB6 card' CONFIG_HUB6 fi - bool 'Non-standard serial port support' CONFIG_SERIAL_NONSTANDARD - if [ "$CONFIG_SERIAL_NONSTANDARD" = "y" ]; then - tristate ' Computone IntelliPort Plus serial support' CONFIG_COMPUTONE - tristate ' Comtrol Rocketport support' CONFIG_ROCKETPORT - tristate ' Cyclades async mux support' CONFIG_CYCLADES - if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_CYCLADES" != "n" ]; then - bool ' Cyclades-Z interrupt mode operation (EXPERIMENTAL)' CONFIG_CYZ_INTR - fi - tristate ' Digiboard Intelligent Async Support' CONFIG_DIGIEPCA - if [ "$CONFIG_DIGIEPCA" = "n" ]; then - tristate ' Digiboard PC/Xx Support' CONFIG_DIGI - fi - tristate ' Hayes ESP serial port support' CONFIG_ESPSERIAL - tristate ' Moxa Intellio support' CONFIG_MOXA_INTELLIO - tristate ' Moxa SmartIO support' CONFIG_MOXA_SMARTIO - if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate ' Multi-Tech multiport card support (EXPERIMENTAL)' CONFIG_ISI m - fi - tristate ' Microgate SyncLink card support' CONFIG_SYNCLINK - tristate ' HDLC line discipline support' CONFIG_N_HDLC - tristate ' SDL RISCom/8 card support' CONFIG_RISCOM8 - tristate ' Specialix IO8+ card support' CONFIG_SPECIALIX - if [ "$CONFIG_SPECIALIX" != "n" ]; then - bool ' Specialix DTR/RTS pin is RTS' CONFIG_SPECIALIX_RTSCTS - fi - tristate ' Specialix SX (and SI) card support' CONFIG_SX - tristate ' Specialix RIO system support' CONFIG_RIO - if [ "$CONFIG_RIO" != "n" ]; then - bool ' Support really old RIO/PCI cards' CONFIG_RIO_OLDPCI - fi - bool ' Stallion multiport serial support' CONFIG_STALDRV - if [ "$CONFIG_STALDRV" = "y" ]; then - tristate ' Stallion EasyIO or EC8/32 support' CONFIG_STALLION - tristate ' Stallion EC8/64, ONboard, Brumby support' CONFIG_ISTALLION - fi - if [ "$CONFIG_MIPS" = "y" ]; then - bool ' TMPTX3912/PR31700 serial port support' CONFIG_SERIAL_TX3912 - dep_bool ' Console on TMPTX3912/PR31700 serial port' CONFIG_SERIAL_TX3912_CONSOLE $CONFIG_SERIAL_TX3912 - bool ' Enable Au1000 UART Support' CONFIG_AU1000_UART - if [ "$CONFIG_AU1000_UART" = "y" ]; then - bool ' Enable Au1000 serial console' CONFIG_AU1000_SERIAL_CONSOLE - fi +fi + +bool 'Non-standard serial port support' CONFIG_SERIAL_NONSTANDARD +if [ "$CONFIG_SERIAL_NONSTANDARD" = "y" ]; then + tristate ' Computone IntelliPort Plus serial support' CONFIG_COMPUTONE + tristate ' Comtrol Rocketport support' CONFIG_ROCKETPORT + tristate ' Cyclades async mux support' CONFIG_CYCLADES + if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_CYCLADES" != "n" ]; then + bool ' Cyclades-Z interrupt mode operation (EXPERIMENTAL)' CONFIG_CYZ_INTR + fi + tristate ' Digiboard Intelligent Async Support' CONFIG_DIGIEPCA + if [ "$CONFIG_DIGIEPCA" = "n" ]; then + tristate ' Digiboard PC/Xx Support' CONFIG_DIGI + fi + tristate ' Hayes ESP serial port support' CONFIG_ESPSERIAL + tristate ' Moxa Intellio support' CONFIG_MOXA_INTELLIO + tristate ' Moxa SmartIO support' CONFIG_MOXA_SMARTIO + if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + dep_tristate ' Multi-Tech multiport card support (EXPERIMENTAL)' CONFIG_ISI m + fi + tristate ' Microgate SyncLink card support' CONFIG_SYNCLINK + tristate ' HDLC line discipline support' CONFIG_N_HDLC + tristate ' SDL RISCom/8 card support' CONFIG_RISCOM8 + tristate ' Specialix IO8+ card support' CONFIG_SPECIALIX + if [ "$CONFIG_SPECIALIX" != "n" ]; then + bool ' Specialix DTR/RTS pin is RTS' CONFIG_SPECIALIX_RTSCTS + fi + tristate ' Specialix SX (and SI) card support' CONFIG_SX + tristate ' Specialix RIO system support' CONFIG_RIO + if [ "$CONFIG_RIO" != "n" ]; then + bool ' Support really old RIO/PCI cards' CONFIG_RIO_OLDPCI + fi + bool ' Stallion multiport serial support' CONFIG_STALDRV + if [ "$CONFIG_STALDRV" = "y" ]; then + tristate ' Stallion EasyIO or EC8/32 support' CONFIG_STALLION + tristate ' Stallion EC8/64, ONboard, Brumby support' CONFIG_ISTALLION + fi + if [ "$CONFIG_MIPS" = "y" ]; then + bool ' TMPTX3912/PR31700 serial port support' CONFIG_SERIAL_TX3912 + dep_bool ' Console on TMPTX3912/PR31700 serial port' CONFIG_SERIAL_TX3912_CONSOLE $CONFIG_SERIAL_TX3912 + bool ' Enable Au1000 UART Support' CONFIG_AU1000_UART + if [ "$CONFIG_AU1000_UART" = "y" ]; then + bool ' Enable Au1000 serial console' CONFIG_AU1000_SERIAL_CONSOLE fi fi fi |
From: James S. <jsi...@us...> - 2001-12-22 16:58:39
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv32498 Modified Files: serial_8250.c Log Message: Dynamically allocate uart_port. Index: serial_8250.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- serial_8250.c 2001/12/13 04:46:52 1.11 +++ serial_8250.c 2001/12/22 16:58:36 1.12 @@ -21,6 +21,7 @@ #include <linux/tty.h> #include <linux/tty_flip.h> #include <linux/major.h> +#include <linux/slab.h> #include <linux/ptrace.h> #include <linux/ioport.h> #include <linux/init.h> @@ -1729,7 +1730,7 @@ /* * Now, do each character */ - for (i = 0; i < count; i++) { + for (i = 0; i < count; i++, s++) { wait_for_xmitr(port); /* @@ -1867,28 +1868,41 @@ */ int register_serial(struct serial_struct *req) { - struct uart_port port; + struct uart_port *port; + int ret; - port.iobase = req->port; - port.membase = req->iomem_base; - port.irq = req->irq; - port.uartclk = req->baud_base * 16; - port.fifosize = req->xmit_fifo_size; - port.regshift = req->iomem_reg_shift; - port.iotype = req->io_type; - port.flags = req->flags | ASYNC_BOOT_AUTOCONF; + port = kmalloc(sizeof (struct uart_port), GFP_KERNEL); + if (!port) + return -ENOMEM; + + port->iobase = req->port; + port->membase = req->iomem_base; + port->irq = req->irq; + port->uartclk = req->baud_base * 16; + port->fifosize = req->xmit_fifo_size; + port->regshift = req->iomem_reg_shift; + port->iotype = req->io_type; + port->flags = req->flags | ASYNC_BOOT_AUTOCONF; if (HIGH_BITS_OFFSET) - port.iobase |= req->port_high << HIGH_BITS_OFFSET; + port->iobase |= req->port_high << HIGH_BITS_OFFSET; /* * If a clock rate wasn't specified by the low level * driver, then default to the standard clock rate. */ - if (port.uartclk == 0) - port.uartclk = BASE_BAUD * 16; + if (port->uartclk == 0) + port->uartclk = BASE_BAUD * 16; - return uart_register_port(&serial8250_reg, &port); + ret = uart_register_port(&serial8250_reg, port); + + /* + * This will be removed once uart_register_port gobbles + * the port pointer. + */ + kfree(port); + + return ret; } void unregister_serial(int line) |
From: Brian S. J. <sk...@us...> - 2001-12-19 05:15:24
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv5107/include/linux Modified Files: input.h serio.h Log Message: Test CVS access; stake claim to a few IDs for upcoming HIL driver. Index: input.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/input.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- input.h 2001/11/13 19:18:31 1.55 +++ input.h 2001/12/19 05:15:21 1.56 @@ -482,6 +482,7 @@ #define BUS_PCI 0x01 #define BUS_ISAPNP 0x02 #define BUS_USB 0x03 +#define BUS_HIL 0x04 #define BUS_ISA 0x10 #define BUS_I8042 0x11 Index: serio.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/serio.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- serio.h 2001/09/25 10:49:40 1.20 +++ serio.h 2001/12/19 05:15:21 1.21 @@ -99,6 +99,7 @@ #define SERIO_XT 0x00000000UL #define SERIO_8042 0x01000000UL #define SERIO_RS232 0x02000000UL +#define SERIO_HIL_MLC 0x03000000UL #define SERIO_PROTO 0xFFUL #define SERIO_MSC 0x01 @@ -122,6 +123,7 @@ #define SERIO_PS2SER 0x22 #define SERIO_TWIDKBD 0x23 #define SERIO_TWIDJOY 0x24 +#define SERIO_HIL 0x25 #define SERIO_ID 0xff00UL #define SERIO_EXTRA 0xff0000UL |
From: James S. <jsi...@us...> - 2001-12-18 19:53:31
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv27629 Added Files: README Log Message: First docs on the new serial stuff I have been coming up with. Will discuss with Russell King about this. --- NEW FILE: README --- The new serial design After much toying with the various ideas and Russell King's code I have formed the start of what to do. The basic idea is simple. To create a serial core where we can register a device interface to a specific port. This gives use the power to do things like have a serial console without a tty on port 1, input interface on port 2, and a tty interface on port 3. Here are the ideas I have come up with to deal with this. 1) We need to break up what we setup. The primary this we want to do are: I. Register and setup hardware ports in a device independent way. The function to do this is int uart_register_port(struct uart_port *port); II. The next step is to register the various device interfaces i.e tty, input etc. This function sets up devfs, minor numbers etc. It has nothing to do with the hardware. int uart_register_driver(struct uart_driver *uart); III. The final step is when a device is detected that we map it to a specific port. For example if the bus detects a modem then it would only make sense to map the struct uart_driver that represents the tty interface to the port that the modem wants to use. int uart_register_device(struct uart_driver *reg,struct uart_port *port); 2) The structures to represent the hardware and device interfaces. Now with the data we want to have data structs that define the hardware state and be able to change that state. We also want to make those structs visible to the higher level device interface layers. The second set of data is the device layer structs. We don't want them visible to the lower layers. Only the specific device interface would have access to it. At present we have the following data structs: I. struct uart_port. This struct represents a serial port. All the data in it defines the current hardware state. Both low level and device level use this data. II. struct uart_ops. This structure describes all the operations that can be done on the physical hardware. It is apart of struct uart_port. III. struct uart_driver. The data here presents the device interface used to represent the hardware. This struct should be interface independent. A void field would be added to this struct which could be cast in the higher device level. That data field would depend on the device interface. |
From: Vojtech P. <vo...@us...> - 2001-12-18 07:53:10
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv22509 Modified Files: joydev.c Log Message: Fixed a bug in JSIOCSABSMAP and JSIOCSBTNMAP. Index: joydev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joydev.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- joydev.c 2001/12/10 17:01:44 1.35 +++ joydev.c 2001/12/18 07:53:07 1.36 @@ -364,9 +364,9 @@ return copy_to_user((struct js_corr *) arg, joydev->corr, sizeof(struct js_corr) * joydev->nabs) ? -EFAULT : 0; case JSIOCSAXMAP: - if (copy_from_user((__u8 *) arg, joydev->abspam, sizeof(__u8) * ABS_MAX)) + if (copy_from_user(joydev->abspam, (__u8 *) arg, sizeof(__u8) * ABS_MAX)) return -EFAULT; - for (i = 0; i < ABS_MAX; i++) { + for (i = 0; i < joydev->nabs; i++) { if (joydev->abspam[i] > ABS_MAX) return -EINVAL; joydev->absmap[joydev->abspam[i]] = i; } @@ -375,9 +375,9 @@ return copy_to_user((__u8 *) arg, joydev->abspam, sizeof(__u8) * ABS_MAX) ? -EFAULT : 0; case JSIOCSBTNMAP: - if (copy_from_user((__u16 *) arg, joydev->keypam, sizeof(__u16) * (KEY_MAX - BTN_MISC))) + if (copy_from_user(joydev->keypam, (__u16 *) arg, sizeof(__u16) * (KEY_MAX - BTN_MISC))) return -EFAULT; - for (i = 0; i < KEY_MAX - BTN_MISC; i++); { + for (i = 0; i < joydev->nkey; i++); { if (joydev->keypam[i] > KEY_MAX || joydev->keypam[i] < BTN_MISC) return -EINVAL; joydev->keymap[joydev->keypam[i] - BTN_MISC] = i; } |
From: James S. <jsi...@us...> - 2001-12-13 22:04:45
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv11435 Modified Files: Config.in Log Message: Removed what was causing the problem with menuconfig. Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/Config.in,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- Config.in 2001/12/09 01:43:35 1.32 +++ Config.in 2001/12/13 22:04:42 1.33 @@ -103,9 +103,9 @@ fi source drivers/i2c/Config.in -if [ "$CONFIG_ARM" = "y" ]; then - source drivers/l3/Config.in -fi +#if [ "$CONFIG_ARM" = "y" ]; then +# source drivers/l3/Config.in +#fi tristate 'QIC-02 tape support' CONFIG_QIC02_TAPE if [ "$CONFIG_QIC02_TAPE" != "n" ]; then |
From: Vojtech P. <vo...@us...> - 2001-12-13 16:30:20
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv3140 Modified Files: Config.in Makefile Added Files: fm801-gp.c Log Message: Support for the ForteMedia 801 gameport. --- NEW FILE: fm801-gp.c --- /* * FM801 gameport driver for Linux * * Copyright (c) by Takashi Iwai <ti...@su...> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include <asm/io.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/ioport.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/gameport.h> #define PCI_VENDOR_ID_FORTEMEDIA 0x1319 #define PCI_DEVICE_ID_FM801_GP 0x0802 #define HAVE_COOKED struct fm801_gp { struct gameport gameport; struct resource *res_port; }; #ifdef HAVE_COOKED static int fm801_gp_cooked_read(struct gameport *gameport, int *axes, int *buttons) { unsigned short w; w = inw(gameport->io + 2); *buttons = (~w >> 14) & 0x03; axes[0] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5); w = inw(gameport->io + 4); axes[1] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5); w = inw(gameport->io + 6); *buttons |= ((~w >> 14) & 0x03) << 2; axes[2] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5); w = inw(gameport->io + 8); axes[3] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5); outw(0xff, gameport->io); /* reset */ return 0; } #endif static int fm801_gp_open(struct gameport *gameport, int mode) { switch (mode) { #ifdef HAVE_COOKED case GAMEPORT_MODE_COOKED: return 0; #endif case GAMEPORT_MODE_RAW: return 0; default: return -1; } return 0; } static int __devinit fm801_gp_probe(struct pci_dev *pci, const struct pci_device_id *id) { struct fm801_gp *gp; if (! (gp = kmalloc(sizeof(*gp), GFP_KERNEL))) { printk("cannot malloc for fm801-gp\n"); return -1; } memset(gp, 0, sizeof(*gp)); gp->gameport.open = fm801_gp_open; #ifdef HAVE_COOKED gp->gameport.cooked_read = fm801_gp_cooked_read; #endif pci_enable_device(pci); gp->gameport.io = pci_resource_start(pci, 0); if ((gp->res_port = request_region(gp->gameport.io, 0x10, "FM801 GP")) == NULL) { printk("unable to grab region 0x%x-0x%x\n", gp->gameport.io, gp->gameport.io + 0x0f); return -1; } pci_set_drvdata(pci, gp); gameport_register_port(&gp->gameport); outb(0x60, gp->gameport.io + 0x0d); /* enable joystick 1 and 2 */ printk(KERN_INFO "gameport%d: %s at pci%02x:%02x.%x speed %d kHz\n", gp->gameport.number, pci->name, pci->bus->number, PCI_SLOT(pci->devfn), PCI_FUNC(pci->devfn), gp->gameport.speed); return 0; } static void __devexit fm801_gp_remove(struct pci_dev *pci) { struct fm801_gp *gp = pci_get_drvdata(pci); if (gp) { gameport_unregister_port(&gp->gameport); release_resource(gp->res_port); kfree(gp); } } static struct pci_device_id fm801_gp_id_table[] __devinitdata = { { PCI_VENDOR_ID_FORTEMEDIA, PCI_DEVICE_ID_FM801_GP, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0 } }; static struct pci_driver fm801_gp_driver = { name: "FM801 GP", id_table: fm801_gp_id_table, probe: fm801_gp_probe, remove: fm801_gp_remove, }; int __init fm801_gp_init(void) { return pci_module_init(&fm801_gp_driver); } void __exit fm801_gp_exit(void) { pci_unregister_driver(&fm801_gp_driver); } module_init(fm801_gp_init); module_exit(fm801_gp_exit); MODULE_DEVICE_TABLE(pci, fm801_gp_id_table); MODULE_AUTHOR("Takashi Iwai <ti...@su...>"); MODULE_LICENSE("GPL"); Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/Config.in,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- Config.in 2001/11/17 10:43:52 1.58 +++ Config.in 2001/12/13 16:30:17 1.59 @@ -58,6 +58,7 @@ tristate ' PDPI Lightning 4 gamecard' CONFIG_INPUT_LIGHTNING tristate ' Aureal Vortex and Trident 4DWave gameports' CONFIG_INPUT_PCIGAME tristate ' Crystal SoundFusion gameports' CONFIG_INPUT_CS461X + tristate ' ForteMedia 801 gameports' CONFIG_INPUT_FM801 tristate ' SoundBlaster Live gameports' CONFIG_INPUT_EMU10K1 fi comment 'Gameport devices' Index: Makefile =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/Makefile,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- Makefile 2001/11/02 17:27:32 1.44 +++ Makefile 2001/12/13 16:30:17 1.45 @@ -71,6 +71,7 @@ obj-$(CONFIG_INPUT_LIGHTNING) += lightning.o gameport.o obj-$(CONFIG_INPUT_PCIGAME) += pcigame.o gameport.o obj-$(CONFIG_INPUT_CS461X) += cs461x.o gameport.o +obj-$(CONFIG_INPUT_FM801) += fm801-gp.o gameport.o obj-$(CONFIG_INPUT_EMU10K1) += emu10k1-gp.o gameport.o obj-$(CONFIG_INPUT_ATKBD) += atkbd.o serio.o |
From: James S. <jsi...@us...> - 2001-12-13 04:46:55
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv2658/drivers/serial Modified Files: serial_21285.c serial_8250.c serial_8250.h serial_8250_pci.c serial_8250_pnp.c serial_amba.c serial_anakin.c serial_clps711x.c serial_core.c serial_sa1100.c serial_uart00.c Log Message: More serial driver updates. Index: serial_21285.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_21285.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- serial_21285.c 2001/11/01 21:38:35 1.6 +++ serial_21285.c 2001/12/13 04:46:52 1.7 @@ -23,6 +23,7 @@ #include <linux/slab.h> #include <linux/init.h> #include <linux/console.h> +#include <linux/serial_core.h> #include <asm/io.h> #include <asm/irq.h> @@ -39,378 +40,325 @@ #define SERIAL_21285_AUXNAME "cuafb" #define SERIAL_21285_AUXMAJOR 205 #define SERIAL_21285_AUXMINOR 4 - -#ifdef CONFIG_SERIAL_21285_OLD -#include <asm/mach-types.h> -/* - * Compatability with a mistake made a long time ago. - * Note - the use of "ttyI", "/dev/ttyS0" and major/minor 5,64 - * is HIGHLY DEPRECIATED, and will be removed in the 2.5 - * kernel series. - * -- rmk 15/04/2000 - */ -#define SERIAL_21285_OLD_NAME "ttyI" -#define SERIAL_21285_OLD_MAJOR TTY_MAJOR -#define SERIAL_21285_OLD_MINOR 64 -static struct tty_driver rs285_old_driver; -#endif +#define RXSTAT_DUMMY_READ 0x80000000 +#define RXSTAT_FRAME (1 << 0) +#define RXSTAT_PARITY (1 << 1) +#define RXSTAT_OVERRUN (1 << 2) +#define RXSTAT_ANYERR (RXSTAT_FRAME|RXSTAT_PARITY|RXSTAT_OVERRUN) -static struct tty_driver rs285_driver, callout_driver; -static int rs285_refcount; -static struct tty_struct *rs285_table[1]; +#define H_UBRLCR_BREAK (1 << 0) +#define H_UBRLCR_PARENB (1 << 1) +#define H_UBRLCR_PAREVN (1 << 2) +#define H_UBRLCR_STOPB (1 << 3) +#define H_UBRLCR_FIFO (1 << 4) -static struct termios *rs285_termios[1]; -static struct termios *rs285_termios_locked[1]; +static struct tty_driver normal, callout; +static struct tty_struct *serial21285_table[1]; +static struct termios *serial21285_termios[1]; +static struct termios *serial21285_termios_locked[1]; +static const char serial21285_name[] = "Footbridge UART"; -static char wbuf[1000], *putp = wbuf, *getp = wbuf, x_char; -static struct tty_struct *rs285_tty; -static int rs285_use_count; +/* + * The documented expression for selecting the divisor is: + * BAUD_BASE / baud - 1 + * However, typically BAUD_BASE is not divisible by baud, so + * we want to select the divisor that gives us the minimum + * error. Therefore, we want: + * int(BAUD_BASE / baud - 0.5) -> + * int(BAUD_BASE / baud - (baud >> 1) / baud) -> + * int((BAUD_BASE - (baud >> 1)) / baud) + */ -static int rs285_write_room(struct tty_struct *tty) +static void serial21285_stop_tx(struct uart_port *port, u_int from_tty) { - return putp >= getp ? (sizeof(wbuf) - (long) putp + (long) getp) : ((long) getp - (long) putp - 1); + disable_irq(IRQ_CONTX); } -static void rs285_rx_int(int irq, void *dev_id, struct pt_regs *regs) +static void serial21285_start_tx(struct uart_port *port, u_int nonempty, u_int from_tty) { - if (!rs285_tty) { - disable_irq(IRQ_CONRX); - return; - } - while (!(*CSR_UARTFLG & 0x10)) { - int ch, flag; - ch = *CSR_UARTDR; - flag = *CSR_RXSTAT; - if (flag & 4) - tty_insert_flip_char(rs285_tty, 0, TTY_OVERRUN); - if (flag & 2) - flag = TTY_PARITY; - else if (flag & 1) - flag = TTY_FRAME; - tty_insert_flip_char(rs285_tty, ch, flag); - } - tty_flip_buffer_push(rs285_tty); + if (nonempty) + enable_irq(IRQ_CONTX); } -static void rs285_send_xchar(struct tty_struct *tty, char ch) +static void serial21285_stop_rx(struct uart_port *port) { - x_char = ch; - enable_irq(IRQ_CONTX); + disable_irq(IRQ_CONRX); } -static void rs285_throttle(struct tty_struct *tty) +static void serial21285_enable_ms(struct uart_port *port) { - if (I_IXOFF(tty)) - rs285_send_xchar(tty, STOP_CHAR(tty)); } -static void rs285_unthrottle(struct tty_struct *tty) +static void serial21285_rx_chars(int irq, void *dev_id, struct pt_regs *regs) { - if (I_IXOFF(tty)) { - if (x_char) - x_char = 0; - else - rs285_send_xchar(tty, START_CHAR(tty)); - } -} + struct uart_info *info = dev_id; + struct uart_port *port = info->port; + struct tty_struct *tty = info->tty; + unsigned int status, ch, rxs, max_count = 256; -static void rs285_tx_int(int irq, void *dev_id, struct pt_regs *regs) -{ - while (!(*CSR_UARTFLG & 0x20)) { - if (x_char) { - *CSR_UARTDR = x_char; - x_char = 0; - continue; + status = *CSR_UARTFLG; + while (status & 0x10 && max_count--) { + if (tty->flip.count >= TTY_FLIPBUF_SIZE) { + tty->flip.tqueue.routine((void *)tty); + if (tty->flip.count >= TTY_FLIPBUF_SIZE) { + printk(KERN_WARNING "TTY_DONT_FLIP set\n"); + return; + } } - if (putp == getp) { - disable_irq(IRQ_CONTX); - break; + + ch = *CSR_UARTDR; + + *tty->flip.char_buf_ptr = ch; + *tty->flip.flag_buf_ptr = TTY_NORMAL; + port->icount.rx++; + + rxs = *CSR_RXSTAT | RXSTAT_DUMMY_READ; + if (rxs & RXSTAT_ANYERR) { + if (rxs & RXSTAT_PARITY) + port->icount.parity++; + else if (rxs & RXSTAT_FRAME) + port->icount.frame++; + if (rxs & RXSTAT_OVERRUN) + port->icount.overrun++; + + rxs &= port->read_status_mask; + + if (rxs & RXSTAT_PARITY) + *tty->flip.flag_buf_ptr = TTY_PARITY; + else if (rxs & RXSTAT_FRAME) + *tty->flip.flag_buf_ptr = TTY_FRAME; } - *CSR_UARTDR = *getp; - if (++getp >= wbuf + sizeof(wbuf)) - getp = wbuf; + + if ((rxs & port->ignore_status_mask) == 0) { + tty->flip.flag_buf_ptr++; + tty->flip.char_buf_ptr++; + tty->flip.count++; + } + if ((rxs & RXSTAT_OVERRUN) && + tty->flip.count < TTY_FLIPBUF_SIZE) { + /* + * Overrun is special, since it's reported + * immediately, and doesn't affect the current + * character. + */ + *tty->flip.char_buf_ptr++ = 0; + *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; + tty->flip.count++; + } + status = *CSR_UARTFLG; } - if (rs285_tty) - wake_up_interruptible(&rs285_tty->write_wait); + tty_flip_buffer_push(tty); } -static inline int rs285_xmit(int ch) +static void serial21285_tx_chars(int irq, void *dev_id, struct pt_regs *regs) { - if (putp + 1 == getp || (putp + 1 == wbuf + sizeof(wbuf) && getp == wbuf)) - return 0; - *putp = ch; - if (++putp >= wbuf + sizeof(wbuf)) - putp = wbuf; - enable_irq(IRQ_CONTX); - return 1; + struct uart_info *info = dev_id; + struct uart_port *port = info->port; + int count = 256; + + if (port->x_char) { + *CSR_UARTDR = port->x_char; + port->icount.tx++; + port->x_char = 0; + return; + } + if (info->xmit.head == info->xmit.tail + || info->tty->stopped + || info->tty->hw_stopped) { + serial21285_stop_tx(port, 0); + return; + } + + do { + *CSR_UARTDR = info->xmit.buf[info->xmit.tail]; + info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + port->icount.tx++; + if (info->xmit.head == info->xmit.tail) + break; + } while (--count > 0 && !(*CSR_UARTFLG & 0x20)); + + if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < + WAKEUP_CHARS) + uart_event(info, EVT_WRITE_WAKEUP); + + if (info->xmit.head == info->xmit.tail) + serial21285_stop_tx(port, 0); } -static int rs285_write(struct tty_struct *tty, int from_user, - const u_char * buf, int count) +static u_int serial21285_tx_empty(struct uart_port *port) { - int i; + return (*CSR_UARTFLG & 8) ? 0 : TIOCSER_TEMT; +} - if (from_user && verify_area(VERIFY_READ, buf, count)) - return -EINVAL; +/* no modem control lines */ +static u_int serial21285_get_mctrl(struct uart_port *port) +{ + return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS; +} - for (i = 0; i < count; i++) { - char ch; - if (from_user) - __get_user(ch, buf + i); - else - ch = buf[i]; - if (!rs285_xmit(ch)) - break; - } - return i; +static void serial21285_set_mctrl(struct uart_port *port, u_int mctrl) +{ } -static void rs285_put_char(struct tty_struct *tty, u_char ch) +static void serial21285_break_ctl(struct uart_port *port, int break_state) { - rs285_xmit(ch); + u_int h_lcr; + + h_lcr = *CSR_H_UBRLCR; + if (break_state) + h_lcr |= H_UBRLCR_BREAK; + else + h_lcr &= ~H_UBRLCR_BREAK; + *CSR_H_UBRLCR = h_lcr; } -static int rs285_chars_in_buffer(struct tty_struct *tty) +static int serial21285_startup(struct uart_port *port, struct uart_info *info) { - return sizeof(wbuf) - rs285_write_room(tty); + int ret; + + ret = request_irq(IRQ_CONRX, serial21285_rx_chars, 0, + serial21285_name, info); + if (ret == 0) { + ret = request_irq(IRQ_CONTX, serial21285_tx_chars, 0, + serial21285_name, info); + if (ret) + free_irq(IRQ_CONRX, info); + } + return ret; } -static void rs285_flush_buffer(struct tty_struct *tty) +static void serial21285_shutdown(struct uart_port *port, struct uart_info *info) { - disable_irq(IRQ_CONTX); - putp = getp = wbuf; - if (x_char) - enable_irq(IRQ_CONTX); + free_irq(IRQ_CONTX, info); + free_irq(IRQ_CONRX, info); } -static inline void rs285_set_cflag(int cflag) +static void +serial21285_change_speed(struct uart_port *port, u_int cflag, u_int iflag, u_int quot) { - int h_lcr, baud, quot; + u_int h_lcr; switch (cflag & CSIZE) { - case CS5: - h_lcr = 0x10; - break; - case CS6: - h_lcr = 0x30; - break; - case CS7: - h_lcr = 0x50; - break; - default: /* CS8 */ - h_lcr = 0x70; - break; - + case CS5: h_lcr = 0x00; break; + case CS6: h_lcr = 0x20; break; + case CS7: h_lcr = 0x40; break; + default: /* CS8 */ h_lcr = 0x60; break; } - if (cflag & CSTOPB) - h_lcr |= 0x08; - if (cflag & PARENB) - h_lcr |= 0x02; - if (!(cflag & PARODD)) - h_lcr |= 0x04; - switch (cflag & CBAUD) { - case B200: baud = 200; break; - case B300: baud = 300; break; - case B1200: baud = 1200; break; - case B1800: baud = 1800; break; - case B2400: baud = 2400; break; - case B4800: baud = 4800; break; - default: - case B9600: baud = 9600; break; - case B19200: baud = 19200; break; - case B38400: baud = 38400; break; - case B57600: baud = 57600; break; - case B115200: baud = 115200; break; + if (cflag & CSTOPB) + h_lcr |= H_UBRLCR_STOPB; + if (cflag & PARENB) { + h_lcr |= H_UBRLCR_PARENB; + if (!(cflag & PARODD)) + h_lcr |= H_UBRLCR_PAREVN; } + if (port->fifosize) + h_lcr |= H_UBRLCR_FIFO; + + port->read_status_mask = RXSTAT_OVERRUN; + if (iflag & INPCK) + port->read_status_mask |= RXSTAT_FRAME | RXSTAT_PARITY; + /* - * The documented expression for selecting the divisor is: - * BAUD_BASE / baud - 1 - * However, typically BAUD_BASE is not divisible by baud, so - * we want to select the divisor that gives us the minimum - * error. Therefore, we want: - * int(BAUD_BASE / baud - 0.5) -> - * int(BAUD_BASE / baud - (baud >> 1) / baud) -> - * int((BAUD_BASE - (baud >> 1)) / baud) + * Characters to ignore */ - quot = (BAUD_BASE - (baud >> 1)) / baud; + port->ignore_status_mask = 0; + if (iflag & IGNPAR) + port->ignore_status_mask |= RXSTAT_FRAME | RXSTAT_PARITY; + if (iflag & IGNBRK && iflag & IGNPAR) + port->ignore_status_mask |= RXSTAT_OVERRUN; + /* + * Ignore all characters if CREAD is not set. + */ + if ((cflag & CREAD) == 0) + port->ignore_status_mask |= RXSTAT_DUMMY_READ; + *CSR_UARTCON = 0; *CSR_L_UBRLCR = quot & 0xff; *CSR_M_UBRLCR = (quot >> 8) & 0x0f; *CSR_H_UBRLCR = h_lcr; *CSR_UARTCON = 1; } - -static void rs285_set_termios(struct tty_struct *tty, struct termios *old) -{ - if (old && tty->termios->c_cflag == old->c_cflag) - return; - rs285_set_cflag(tty->termios->c_cflag); -} - -static void rs285_stop(struct tty_struct *tty) +static const char *serial21285_type(struct uart_port *port) { - disable_irq(IRQ_CONTX); + return port->type == PORT_21285 ? "DC21285" : NULL; } -static void rs285_start(struct tty_struct *tty) +static void serial21285_release_port(struct uart_port *port) { - enable_irq(IRQ_CONTX); + release_mem_region(port->mapbase, 32); } -static void rs285_wait_until_sent(struct tty_struct *tty, int timeout) +static int serial21285_request_port(struct uart_port *port) { - int orig_jiffies = jiffies; - while (*CSR_UARTFLG & 8) { - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(1); - if (signal_pending(current)) - break; - if (timeout && time_after(jiffies, orig_jiffies + timeout)) - break; - } - set_current_state(TASK_RUNNING); + return request_mem_region(port->mapbase, 32, serial21285_name) + != NULL ? 0 : -EBUSY; } -static int rs285_open(struct tty_struct *tty, struct file *filp) +static void serial21285_config_port(struct uart_port *port, int flags) { - int line; - - MOD_INC_USE_COUNT; - line = MINOR(tty->device) - tty->driver.minor_start; - if (line) { - MOD_DEC_USE_COUNT; - return -ENODEV; - } - - tty->driver_data = NULL; - if (!rs285_tty) - rs285_tty = tty; - - enable_irq(IRQ_CONRX); - rs285_use_count++; - return 0; + if (flags & UART_CONFIG_TYPE && serial21285_request_port(port) == 0) + port->type = PORT_21285; } -static void rs285_close(struct tty_struct *tty, struct file *filp) +/* + * verify the new serial_struct (for TIOCSSERIAL). + */ +static int serial21285_verify_port(struct uart_port *port, struct serial_struct *ser) { - if (!--rs285_use_count) { - rs285_wait_until_sent(tty, 0); - disable_irq(IRQ_CONRX); - disable_irq(IRQ_CONTX); - rs285_tty = NULL; - } - MOD_DEC_USE_COUNT; + int ret = 0; + if (ser->type != PORT_UNKNOWN && ser->type != PORT_21285) + ret = -EINVAL; + if (ser->irq != NO_IRQ) + ret = -EINVAL; + if (ser->baud_base != port->uartclk / 16) + ret = -EINVAL; + return ret; } - -static int __init rs285_init(void) -{ - int baud = B9600; - if (machine_is_personal_server()) - baud = B57600; - - rs285_driver.magic = TTY_DRIVER_MAGIC; - rs285_driver.driver_name = "serial_21285"; - rs285_driver.name = SERIAL_21285_NAME; - rs285_driver.major = SERIAL_21285_MAJOR; - rs285_driver.minor_start = SERIAL_21285_MINOR; - rs285_driver.num = 1; - rs285_driver.type = TTY_DRIVER_TYPE_SERIAL; - rs285_driver.subtype = SERIAL_TYPE_NORMAL; - rs285_driver.init_termios = tty_std_termios; - rs285_driver.init_termios.c_cflag = baud | CS8 | CREAD | HUPCL | CLOCAL; - rs285_driver.flags = TTY_DRIVER_REAL_RAW; - rs285_driver.refcount = &rs285_refcount; - rs285_driver.table = rs285_table; - rs285_driver.termios = rs285_termios; - rs285_driver.termios_locked = rs285_termios_locked; - - rs285_driver.open = rs285_open; - rs285_driver.close = rs285_close; - rs285_driver.write = rs285_write; - rs285_driver.put_char = rs285_put_char; - rs285_driver.write_room = rs285_write_room; - rs285_driver.chars_in_buffer = rs285_chars_in_buffer; - rs285_driver.flush_buffer = rs285_flush_buffer; - rs285_driver.throttle = rs285_throttle; - rs285_driver.unthrottle = rs285_unthrottle; - rs285_driver.send_xchar = rs285_send_xchar; - rs285_driver.set_termios = rs285_set_termios; - rs285_driver.stop = rs285_stop; - rs285_driver.start = rs285_start; - rs285_driver.wait_until_sent = rs285_wait_until_sent; - - callout_driver = rs285_driver; - callout_driver.name = SERIAL_21285_AUXNAME; - callout_driver.major = SERIAL_21285_AUXMAJOR; - callout_driver.subtype = SERIAL_TYPE_CALLOUT; - - if (request_irq(IRQ_CONRX, rs285_rx_int, 0, "rs285", NULL)) - panic("Couldn't get rx irq for rs285"); - - if (request_irq(IRQ_CONTX, rs285_tx_int, 0, "rs285", NULL)) - panic("Couldn't get tx irq for rs285"); - -#ifdef CONFIG_SERIAL_21285_OLD - if (!machine_is_ebsa285() && !machine_is_netwinder()) { - rs285_old_driver = rs285_driver; - rs285_old_driver.name = SERIAL_21285_OLD_NAME; - rs285_old_driver.major = SERIAL_21285_OLD_MAJOR; - rs285_old_driver.minor_start = SERIAL_21285_OLD_MINOR; - - if (tty_register_driver(&rs285_old_driver)) - printk(KERN_ERR "Couldn't register old 21285 serial driver\n"); - } -#endif - - if (tty_register_driver(&rs285_driver)) - printk(KERN_ERR "Couldn't register 21285 serial driver\n"); - if (tty_register_driver(&callout_driver)) - printk(KERN_ERR "Couldn't register 21285 callout driver\n"); +static struct uart_ops serial21285_ops = { + tx_empty: serial21285_tx_empty, + get_mctrl: serial21285_get_mctrl, + set_mctrl: serial21285_set_mctrl, + stop_tx: serial21285_stop_tx, + start_tx: serial21285_start_tx, + stop_rx: serial21285_stop_rx, + enable_ms: serial21285_enable_ms, + break_ctl: serial21285_break_ctl, + startup: serial21285_startup, + shutdown: serial21285_shutdown, + change_speed: serial21285_change_speed, + type: serial21285_type, + release_port: serial21285_release_port, + request_port: serial21285_request_port, + config_port: serial21285_config_port, + verify_port: serial21285_verify_port, +}; - return 0; -} +static struct uart_port serial21285_port = { + membase: 0, + mapbase: 0x42000160, + iotype: SERIAL_IO_MEM, + irq: NO_IRQ, + uartclk: 0, + fifosize: 16, + ops: &serial21285_ops, + flags: ASYNC_BOOT_AUTOCONF, +}; -static void __exit rs285_fini(void) +static void serial21285_setup_ports(void) { - unsigned long flags; - int ret; - - save_flags(flags); - cli(); - ret = tty_unregister_driver(&callout_driver); - if (ret) - printk(KERN_ERR "Unable to unregister 21285 callout driver " - "(%d)\n", ret); - ret = tty_unregister_driver(&rs285_driver); - if (ret) - printk(KERN_ERR "Unable to unregister 21285 driver (%d)\n", - ret); -#ifdef CONFIG_SERIAL_21285_OLD - if (!machine_is_ebsa285() && !machine_is_netwinder()) { - ret = tty_unregister_driver(&rs285_old_driver); - if (ret) - printk(KERN_ERR "Unable to unregister old 21285 " - "driver (%d)\n", ret); - } -#endif - free_irq(IRQ_CONTX, NULL); - free_irq(IRQ_CONRX, NULL); - restore_flags(flags); + serial21285_port.uartclk = mem_fclk_21285 / 16; } -module_init(rs285_init); -module_exit(rs285_fini); - #ifdef CONFIG_SERIAL_21285_CONSOLE /************** console driver *****************/ -static void rs285_console_write(struct console *co, const char *s, u_int count) +static void serial21285_console_write(struct console *co, const char *s, u_int count) { int i; @@ -426,8 +374,13 @@ enable_irq(IRQ_CONTX); } -static int rs285_console_wait_key(struct console *co) +static kdev_t serial21285_console_device(struct console *c) { + return MKDEV(SERIAL_21285_MAJOR, SERIAL_21285_MINOR); +} + +static int serial21285_console_wait_key(struct console *co) +{ int c; disable_irq(IRQ_CONRX); @@ -437,104 +390,45 @@ return c; } -static kdev_t rs285_console_device(struct console *c) +static void __init +serial21285_get_options(struct uart_port *port, int *baud, int *parity, int *bits) { - return MKDEV(SERIAL_21285_MAJOR, SERIAL_21285_MINOR); } -static int __init rs285_console_setup(struct console *co, char *options) +static int __init serial21285_console_setup(struct console *co, char *options) { + struct uart_port *port = &serial21285_port; int baud = 9600; int bits = 8; int parity = 'n'; - int cflag = CREAD | HUPCL | CLOCAL; + int flow = 'n'; if (machine_is_personal_server()) baud = 57600; - if (options) { - char *s = options; - baud = simple_strtoul(options, NULL, 10); - while (*s >= '0' && *s <= '9') - s++; - if (*s) - parity = *s++; - if (*s) - bits = *s - '0'; - } - /* - * Now construct a cflag setting. + * Check whether an invalid uart number has been specified, and + * if so, search for the first available port that does have + * console support. */ - switch (baud) { - case 1200: - cflag |= B1200; - break; - case 2400: - cflag |= B2400; - break; - case 4800: - cflag |= B4800; - break; - case 9600: - cflag |= B9600; - break; - case 19200: - cflag |= B19200; - break; - case 38400: - cflag |= B38400; - break; - case 57600: - cflag |= B57600; - break; - case 115200: - cflag |= B115200; - break; - default: - cflag |= B9600; - break; - } - switch (bits) { - case 7: - cflag |= CS7; - break; - default: - cflag |= CS8; - break; - } - switch (parity) { - case 'o': - case 'O': - cflag |= PARODD; - break; - case 'e': - case 'E': - cflag |= PARENB; - break; - } - co->cflag = cflag; - rs285_set_cflag(cflag); - rs285_console_write(NULL, "\e[2J\e[Hboot ", 12); if (options) - rs285_console_write(NULL, options, strlen(options)); + uart_parse_options(options, &baud, &parity, &bits, &flow); else - rs285_console_write(NULL, "no options", 10); - rs285_console_write(NULL, "\n", 1); + serial21285_get_options(port, &baud, &parity, &bits); - return 0; + return uart_set_options(port, co, baud, parity, bits, flow); } #ifdef CONFIG_SERIAL_21285_OLD -static struct console rs285_old_cons = +static struct console serial21285_old_cons = { SERIAL_21285_OLD_NAME, - rs285_console_write, + serial21285_console_write, NULL, - rs285_console_device, - rs285_console_wait_key, + serial21285_console_device, + serial21285_console_wait_key, NULL, - rs285_console_setup, + serial21285_console_setup, CON_PRINTBUFFER, -1, 0, @@ -542,27 +436,63 @@ }; #endif -static struct console rs285_cons = +static struct console serial21285_console = { name: SERIAL_21285_NAME, - write: rs285_console_write, - device: rs285_console_device, - wait_key: rs285_console_wait_key, - setup: rs285_console_setup, + write: serial21285_console_write, + device: serial21285_console_device, + wait_key: serial21285_console_wait_key, + setup: serial21285_console_setup, flags: CON_PRINTBUFFER, index: -1, }; void __init rs285_console_init(void) { -#ifdef CONFIG_SERIAL_21285_OLD - if (!machine_is_ebsa285() && !machine_is_netwinder()) - register_console(&rs285_old_cons); + serial21285_setup_ports(); + register_console(&serial21285_console); +} + +#define SERIAL_21285_CONSOLE &serial21285_console +#else +#define SERIAL_21285_CONSOLE NULL #endif - register_console(&rs285_cons); + +static struct uart_driver serial21285_reg = { + owner: THIS_MODULE, + normal_major: SERIAL_21285_MAJOR, +#ifdef CONFIG_DEVFS_FS + normal_name: "ttyFB%d", + callout_name: "cuafb%d", +#else + normal_name: "ttyFB", + callout_name: "cuafb", +#endif + normal_driver: &normal, + callout_major: SERIAL_21285_AUXMAJOR, + callout_driver: &callout, + table: serial21285_table, + termios: serial21285_termios, + termios_locked: serial21285_termios_locked, + minor: SERIAL_21285_MINOR, + nr: 1, + port: &serial21285_port, + cons: SERIAL_21285_CONSOLE, +}; + +static int __init serial21285_init(void) +{ + serial21285_setup_ports(); + return uart_register_driver(&serial21285_reg); } -#endif /* CONFIG_SERIAL_21285_CONSOLE */ +static void __exit serial21285_exit(void) +{ + uart_unregister_driver(&serial21285_reg); +} + +module_init(serial21285_init); +module_exit(serial21285_exit); EXPORT_NO_SYMBOLS; Index: serial_8250.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serial_8250.c 2001/11/23 01:44:33 1.10 +++ serial_8250.c 2001/12/13 04:46:52 1.11 @@ -102,7 +102,7 @@ /* * Here we define the default xmit fifo size used for each type of UART. */ -static struct serial_uart_config uart_config[PORT_MAX_8250+1] = { +static const struct serial_uart_config uart_config[PORT_MAX_8250+1] = { { "unknown", 1, 0 }, { "8250", 1, 0 }, { "16450", 1, 0 }, @@ -857,6 +857,8 @@ #endif do { + spin_lock(&info->lock); + if (!info->tty || (serial_in(info->port, UART_IIR) & UART_IIR_NO_INT)) { if (!end_mark) @@ -871,6 +873,8 @@ serial8250_handle_port(info, regs); next: + spin_unlock(&info->lock); + info = info->next_info; if (info) continue; @@ -918,6 +922,8 @@ first_multi = inb(port_monitor); #endif + spin_lock(&info->lock); + do { serial8250_handle_port(info, regs); if (pass_counter++ > RS_ISR_PASS_LIMIT) { @@ -930,6 +936,9 @@ printk("IIR = %x...", serial_in(info->port, UART_IIR)); #endif } while (!(serial_in(info->port, UART_IIR) & UART_IIR_NO_INT)); + + spin_unlock(&info->lock); + #ifdef CONFIG_SERIAL_8250_MULTIPORT if (port_monitor) printk("rs port monitor (single) irq %d: 0x%x, 0x%x\n", @@ -968,6 +977,7 @@ first_multi = inb(multi->port_monitor); while (1) { + spin_lock(info->lock); if (!info->tty || (serial_in(info->port, UART_IIR) & UART_IIR_NO_INT)) goto next; @@ -975,6 +985,7 @@ serial8250_handle_port(info, regs); next: + spin_unlock(info->lock); info = info->next; if (info) continue; @@ -1613,6 +1624,16 @@ return 0; } +static const char * +serial8250_type(struct uart_port *port) +{ + int type = port->type; + + if (type >= PORT_MAX_8250) + type = 0; + return uart_config[type].name; +} + static struct uart_ops serial8250_pops = { tx_empty: serial8250_tx_empty, set_mctrl: serial8250_set_mctrl, @@ -1626,6 +1647,7 @@ shutdown: serial8250_shutdown, change_speed: serial8250_change_speed, pm: serial8250_pm, + type: serial8250_type, release_port: serial8250_release_port, request_port: serial8250_request_port, config_port: serial8250_config_port, Index: serial_8250.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Index: serial_8250_pci.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pci.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- serial_8250_pci.c 2001/12/02 07:03:59 1.11 +++ serial_8250_pci.c 2001/12/13 04:46:52 1.12 @@ -1078,4 +1078,4 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module"); -//MODULE_GENERIC_TABLE(pci, serial_pci_tbl); +MODULE_GENERIC_TABLE(pci, serial_pci_tbl); Index: serial_8250_pnp.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pnp.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- serial_8250_pnp.c 2001/12/02 07:03:59 1.6 +++ serial_8250_pnp.c 2001/12/13 04:46:52 1.7 @@ -549,5 +549,5 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 PNPBIOS serial probe module"); -//MODULE_GENERIC_TABLE(pnp, pnp_dev_table); +MODULE_GENERIC_TABLE(pnp, pnp_dev_table); Index: serial_amba.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_amba.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- serial_amba.c 2001/11/23 01:44:33 1.9 +++ serial_amba.c 2001/12/13 04:46:52 1.10 @@ -511,6 +511,11 @@ restore_flags(flags); } +static const char *ambauart_type(struct uart_port *port) +{ + return port->type == PORT_AMBA ? "AMBA" : NULL; +} + /* * Release the memory region(s) being used by 'port' */ @@ -566,6 +571,7 @@ startup: ambauart_startup, shutdown: ambauart_shutdown, change_speed: ambauart_change_speed, + type: ambauart_type, release_port: ambauart_release_port, request_port: ambauart_request_port, config_port: ambauart_config_port, Index: serial_anakin.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_anakin.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serial_anakin.c 2001/11/23 01:44:33 1.2 +++ serial_anakin.c 2001/12/13 04:46:52 1.3 @@ -337,6 +337,11 @@ restore_flags(flags); } +static const char *anakin_type(struct port *port) +{ + return port->type == PORT_ANAKIN ? "ANAKIN" : NULL; +} + static struct uart_ops anakin_pops = { tx_empty: anakin_tx_empty, set_mctrl: anakin_set_mctrl, @@ -349,6 +354,7 @@ startup: anakin_startup, shutdown: anakin_shutdown, change_speed: anakin_change_speed, + type: anakin_type, }; static struct uart_port anakin_ports[UART_NR] = { Index: serial_clps711x.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_clps711x.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- serial_clps711x.c 2001/11/23 01:44:33 1.9 +++ serial_clps711x.c 2001/12/13 04:46:52 1.10 @@ -406,6 +406,11 @@ restore_flags(flags); } +static const char *clps711xuart_type(struct uart_port *port) +{ + return port->type == PORT_CLPS711X ? "CLPS711x" : NULL; +} + /* * Configure/autoconfigure the port. */ @@ -436,6 +441,7 @@ startup: clps711xuart_startup, shutdown: clps711xuart_shutdown, change_speed: clps711xuart_change_speed, + type: clps711xuart_type, config_port: clps711xuart_config_port, release_port: clps711xuart_release_port, request_port: clps711xuart_request_port, Index: serial_core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_core.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- serial_core.c 2001/11/23 01:44:33 1.16 +++ serial_core.c 2001/12/13 04:46:52 1.17 @@ -1506,7 +1506,15 @@ static const char *uart_type(struct uart_port *port) { - return ""; + const char *str = NULL; + + if (port->ops->type) + str = port->ops->type(port); + + if (!str) + str = "unknown"; + + return str; } static int uart_line_info(char *buf, struct uart_driver *drv, int i) @@ -1705,6 +1713,7 @@ extern void rs285_console_init(void); extern void sa1100_rs_console_init(void); extern void serial8250_console_init(void); +extern void uart00_console_init(void); /* * Central "initialise all serial consoles" container. Needs to be killed. @@ -1745,60 +1754,105 @@ * We don't actually save any state; the serial driver has enough * state held internally to re-setup the port when we come out of D3. */ -static int uart_pm(struct pm_dev *dev, pm_request_t rqst, void *data) +static int uart_pm_set_state(struct uart_state *state, int pm_state, int oldstate) { - if (rqst == PM_SUSPEND || rqst == PM_RESUME) { - struct uart_state *state = dev->data; - struct uart_port *port = state->port; - struct uart_ops *ops = port->ops; - int pm_state = (int)data; - int running = state->info && - state->info->flags & ASYNC_INITIALIZED; + struct uart_port *port = state->port; + struct uart_ops *ops = port->ops; + int running = state->info && + state->info->flags & ASYNC_INITIALIZED; - if (port->type == PORT_UNKNOWN) - return 0; + if (port->type == PORT_UNKNOWN) + return 0; //printk("pm: %08x: %d -> %d, %srunning\n", port->iobase, dev->state, pm_state, running ? "" : "not "); - if (pm_state == 0) { - if (ops->pm) - ops->pm(port, pm_state, dev->state); - if (running) { - ops->set_mctrl(port, 0); - ops->startup(port, state->info); - uart_change_speed(state->info, NULL); - ops->set_mctrl(port, state->info->mctrl); - ops->start_tx(port, 1, 0); - } + if (pm_state == 0) { + if (ops->pm) + ops->pm(port, pm_state, oldstate); + if (running) { + ops->set_mctrl(port, 0); + ops->startup(port, state->info); + uart_change_speed(state->info, NULL); + ops->set_mctrl(port, state->info->mctrl); + ops->start_tx(port, 1, 0); + } - /* - * Re-enable the console device after suspending. - */ - if (state->cons && state->cons->index == port->line) - state->cons->flags |= CON_ENABLED; - } else if (pm_state == 1) { - if (ops->pm) - ops->pm(port, pm_state, dev->state); - } else { - /* - * Disable the console device before suspending. - */ - if (state->cons && state->cons->index == port->line) - state->cons->flags &= ~CON_ENABLED; + /* + * Re-enable the console device after suspending. + */ + if (state->cons && state->cons->index == port->line) + state->cons->flags |= CON_ENABLED; + } else if (pm_state == 1) { + if (ops->pm) + ops->pm(port, pm_state, oldstate); + } else { + /* + * Disable the console device before suspending. + */ + if (state->cons && state->cons->index == port->line) + state->cons->flags &= ~CON_ENABLED; - if (running) { - ops->stop_tx(port, 0); - ops->set_mctrl(port, 0); - ops->stop_rx(port); - ops->shutdown(port, state->info); - } - if (ops->pm) - ops->pm(port, pm_state, dev->state); + if (running) { + ops->stop_tx(port, 0); + ops->set_mctrl(port, 0); + ops->stop_rx(port); + ops->shutdown(port, state->info); } + if (ops->pm) + ops->pm(port, pm_state, oldstate); } return 0; } + +/* + * Wakeup support. + */ +static int uart_pm_set_wakeup(struct uart_state *state, int data) +{ + int err = 0; + + if (state->port->ops->set_wake) + err = state->port->ops->set_wake(state->port, data); + + return err; +} + +static int uart_pm(struct pm_dev *dev, pm_request_t rqst, void *data) +{ + struct uart_state *state = dev->data; + int err = 0; + + switch (rqst) { + case PM_SUSPEND: + case PM_RESUME: + err = uart_pm_set_state(state, (int)data, dev->state); + break; + + case PM_SET_WAKEUP: + err = uart_pm_set_wakeup(state, (int)data); + break; + } + return err; +} #endif +static inline void +uart_report_port(struct uart_driver *drv, struct uart_port *port) +{ + printk("%s%d at ", drv->normal_name, port->line); + switch (port->iotype) { + case SERIAL_IO_PORT: + printk("I/O 0x%x", port->iobase); + break; + case SERIAL_IO_HUB6: + printk("I/O 0x%x offset 0x%x", port->iobase, port->hub6); + break; + case SERIAL_IO_MEM: + printk("MEM 0x%x", port->mapbase); + break; + } + printk(" (irq = %d) is a %s\n", port->irq, uart_type(port)); +} + static void uart_setup_port(struct uart_driver *drv, struct uart_state *state) { @@ -1842,6 +1896,7 @@ state->port->line); tty_register_devfs(drv->callout_driver, 0, drv->minor + state->port->line); + uart_report_port(drv, port); } #ifdef CONFIG_PM @@ -2091,7 +2146,7 @@ #if 0 //def CONFIG_PM /* we have already registered the power management handlers */ - state->pm = pm_register(PM_SYS_DEV, PM_SYS_CON, uart_pm); + state->pm = pm_register(PM_SYS_DEV, PM_SYS_COM, uart_pm); if (state->pm) { state->pm->data = state; @@ -2113,6 +2168,9 @@ state->port->line); tty_register_devfs(drv->callout_driver, 0, drv->minor + state->port->line); + + uart_report_port(drv, state->port); + up(&state->count_sem); return i; } Index: serial_sa1100.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_sa1100.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- serial_sa1100.c 2001/11/23 01:44:33 1.14 +++ serial_sa1100.c 2001/12/13 04:46:52 1.15 @@ -271,6 +271,7 @@ unsigned int status, pass_counter = 0; status = UART_GET_UTSR0(port); + status &= (SM_TO_UTSR0(port->read_status_mask) | ~UTSR0_TFS); do { if (status & (UTSR0_RFS | UTSR0_RID)) { /* Clear the receiver idle bit, if set */ @@ -294,12 +295,12 @@ } #endif } - status &= SM_TO_UTSR0(port->read_status_mask); if (status & UTSR0_TFS) sa1100_tx_chars(info); if (pass_counter++ > SA1100_ISR_PASS_LIMIT) break; status = UART_GET_UTSR0(port); + status &= (SM_TO_UTSR0(port->read_status_mask) | ~UTSR0_TFS); } while (status & (UTSR0_TFS | UTSR0_RFS | UTSR0_RID)); } @@ -451,6 +452,11 @@ UART_PUT_UTCR3(port, old_utcr3); } +static const char *sa1100_type(struct uart_port *port) +{ + return port->type == PORT_SA1100 ? "SA1100" : NULL; +} + /* * Release the memory region(s) being used by 'port'. */ @@ -514,6 +520,7 @@ startup: sa1100_startup, shutdown: sa1100_shutdown, change_speed: sa1100_change_speed, + type: sa1100_type, release_port: sa1100_release_port, request_port: sa1100_request_port, config_port: sa1100_config_port, @@ -565,9 +572,10 @@ sa1100_pops.get_mctrl = fns->get_mctrl; if (fns->set_mctrl) sa1100_pops.set_mctrl = fns->set_mctrl; - sa1100_open = fns->open; - sa1100_close = fns->close; - sa1100_pops.pm = fns->pm; + sa1100_open = fns->open; + sa1100_close = fns->close; + sa1100_pops.pm = fns->pm; + sa1100_pops.set_wake = fns->set_wake; } void __init sa1100_register_uart(int idx, int port) Index: serial_uart00.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_uart00.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serial_uart00.c 2001/11/23 01:44:33 1.2 +++ serial_uart00.c 2001/12/13 04:46:52 1.3 @@ -530,6 +530,11 @@ UART_PUT_MCR(port, UART_GET_MCR(port) &~UART_MCR_BR_MSK); } +static const char *uart00_type(struct uart_port *port) +{ + return port->type == PORT_UART00 ? "UART00" : NULL; +} + /* * Release the memory region(s) being used by 'port' */ @@ -585,6 +590,7 @@ startup: uart00_startup, shutdown: uart00_shutdown, change_speed: uart00_change_speed, + type: uart00_type, release_port: uart00_release_port, request_port: uart00_request_port, config_port: uart00_config_port, |
From: James S. <jsi...@us...> - 2001-12-13 04:46:55
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv2658/include/linux Modified Files: serial_core.h Log Message: More serial driver updates. Index: serial_core.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/serial_core.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- serial_core.h 2001/11/23 01:46:07 1.9 +++ serial_core.h 2001/12/13 04:46:52 1.10 @@ -46,7 +46,8 @@ #define PORT_AMBA 32 #define PORT_CLPS711X 33 #define PORT_SA1100 34 -#define PORT_UART00 35 +#define PORT_UART00 35 +#define PORT_21285 37 #ifdef __KERNEL__ @@ -76,6 +77,12 @@ void (*shutdown)(struct uart_port *, struct uart_info *); void (*change_speed)(struct uart_port *, u_int cflag, u_int iflag, u_int quot); void (*pm)(struct uart_port *, u_int state, u_int oldstate); + int (*set_wake)(struct uart_port *, u_int state); + + /* + * Return a string describing the type of the port + */ + const char *(*type)(struct uart_port *); /* * Release IO and memory resources used by the port. |
From: Vojtech P. <vo...@us...> - 2001-12-10 17:01:47
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input In directory usw-pr-cvs1:/tmp/cvs-serv28578 Modified Files: analog.c guillemot.c hid-core.c joydev.c Log Message: Analog: use correct locking when accessing the pit timer Guillemot: longer timeouts, print failed reads Hid-core: fixes Joydev: fixes Index: analog.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/analog.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- analog.c 2001/10/18 20:52:48 1.66 +++ analog.c 2001/12/10 17:01:44 1.67 @@ -138,9 +138,23 @@ #ifdef __i386__ #define TSC_PRESENT (test_bit(X86_FEATURE_TSC, &boot_cpu_data.x86_capability)) -#define GET_TIME(x) do { if (TSC_PRESENT) rdtscl(x); else { outb(0, 0x43); x = inb(0x40); x |= inb(0x40) << 8; } } while (0) +#define GET_TIME(x) do { if (TSC_PRESENT) rdtscl(x); else x = get_time_pit(); } while (0) #define DELTA(x,y) (TSC_PRESENT?((y)-(x)):((x)-(y)+((x)<(y)?1193180L/HZ:0))) #define TIME_NAME (TSC_PRESENT?"TSC":"PIT") +static unsigned int get_time_pit(void) +{ + extern spinlock_t i8253_lock; + unsigned long flags; + unsigned int count; + + spin_lock_irqsave(&i8253_lock, flags); + outb_p(0x00, 0x43); + count = inb_p(0x40); + count |= inb_p(0x40) << 8; + spin_unlock_irqrestore(&i8253_lock, flags); + + return count; +} #elif __x86_64__ #define GET_TIME(x) rdtscl(x) #define DELTA(x,y) ((y)-(x)) @@ -501,7 +515,8 @@ printk(" [%s timer, %d %sHz clock, %d ns res]\n", TIME_NAME, port->speed > 10000 ? (port->speed + 800) / 1000 : port->speed, port->speed > 10000 ? "M" : "k", - port->speed > 10000 ? (port->loop * 1000) / (port->speed / 1000) : (port->loop * 1000000) / port->speed); + port->speed > 10000 ? (port->loop * 1000) / (port->speed / 1000) + : (port->loop * 1000000) / port->speed); } /* Index: guillemot.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/guillemot.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- guillemot.c 2001/09/25 10:12:07 1.8 +++ guillemot.c 2001/12/10 17:01:44 1.9 @@ -40,8 +40,8 @@ MODULE_DESCRIPTION("Guillemot Digital joystick driver"); MODULE_LICENSE("GPL"); -#define GUILLEMOT_MAX_START 400 /* 400 us */ -#define GUILLEMOT_MAX_STROBE 40 /* 40 us */ +#define GUILLEMOT_MAX_START 600 /* 600 us */ +#define GUILLEMOT_MAX_STROBE 60 /* 60 us */ #define GUILLEMOT_MAX_LENGTH 17 /* 17 bytes */ #define GUILLEMOT_REFRESH_TIME HZ/50 /* 20 ms */ @@ -259,6 +259,7 @@ static void guillemot_disconnect(struct gameport *gameport) { struct guillemot *guillemot = gameport->private; + printk(KERN_INFO "guillemot.c: Failed %d reads out of %d on %s\n", guillemot->reads, guillemot->bads, guillemot->phys); input_unregister_device(&guillemot->dev); gameport_close(gameport); kfree(guillemot); Index: hid-core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/hid-core.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- hid-core.c 2001/11/07 19:02:56 1.33 +++ hid-core.c 2001/12/10 17:01:44 1.34 @@ -204,6 +204,7 @@ return -1; } +#if 0 /* Old code, could be right in some way, but generates superfluous fields */ if (HID_MAIN_ITEM_VARIABLE & ~flags) { /* ARRAY */ if (parser->global.logical_maximum <= parser->global.logical_minimum) { dbg("logical range invalid %d %d", parser->global.logical_minimum, parser->global.logical_maximum); @@ -214,7 +215,16 @@ } else { /* VARIABLE */ usages = parser->global.report_count; } +#else + if (parser->global.logical_maximum <= parser->global.logical_minimum) { + dbg("logical range invalid %d %d", parser->global.logical_minimum, parser->global.logical_maximum); + return -1; + } + usages = parser->local.usage_index; + dbg("add_field: usage_index: %d, report_count: %d", parser->global.report_count, parser->local.usage_index); +#endif + offset = report->size; report->size += parser->global.report_size * parser->global.report_count; @@ -1062,7 +1072,9 @@ if (len > hid->urb.transfer_buffer_length) { hid->urb.transfer_buffer_length = len < 32 ? len : 32; } - usb_set_idle(hid->dev, hid->ifnum, 0, report->id); +#if 0 + usb_set_idle(hid->dev, hid->ifnum, 0, report->id); /*** FIXME mixing sync & async ***/ +#endif hid_submit_report(hid, report, USB_DIR_IN); list = list->next; } @@ -1229,6 +1241,12 @@ if (!hiddev_connect(hid)) hid->claimed |= HID_CLAIMED_HIDDEV; #endif + + if (!hid->claimed) { + hid_free_device(hid); + return NULL; + } + printk(KERN_INFO); if (hid->claimed & HID_CLAIMED_INPUT) @@ -1240,7 +1258,7 @@ c = "Device"; for (i = 0; i < hid->maxapplication; i++) - if (IS_INPUT_APPLICATION(hid->application[i])) { + if ((hid->application[i] & 0xffff) < ARRAY_SIZE(hid_types)) { c = hid_types[hid->application[i] & 0xffff]; break; } Index: joydev.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joydev.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- joydev.c 2001/10/17 10:38:13 1.34 +++ joydev.c 2001/12/10 17:01:44 1.35 @@ -412,7 +412,7 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id) { struct joydev *joydev; - int i, j, minor; + int i, j, t, minor; if (test_bit(BTN_TOUCH, dev->keybit)) return NULL; @@ -470,8 +470,10 @@ joydev->corr[i].prec = dev->absfuzz[j]; joydev->corr[i].coef[0] = (dev->absmax[j] + dev->absmin[j]) / 2 - dev->absflat[j]; joydev->corr[i].coef[1] = (dev->absmax[j] + dev->absmin[j]) / 2 + dev->absflat[j]; - joydev->corr[i].coef[2] = (1 << 29) / ((dev->absmax[j] - dev->absmin[j]) / 2 - 2 * dev->absflat[j]); - joydev->corr[i].coef[3] = (1 << 29) / ((dev->absmax[j] - dev->absmin[j]) / 2 - 2 * dev->absflat[j]); + if (!(t = ((dev->absmax[j] - dev->absmin[j]) / 2 - 2 * dev->absflat[j])) + continue; + joydev->corr[i].coef[2] = (1 << 29) / t; + joydev->corr[i].coef[3] = (1 << 29) / t; joydev->abs[i] = joydev_correct(dev->abs[j], joydev->corr + i); } |
From: James S. <jsi...@us...> - 2001-12-09 01:43:38
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv9503/drivers/char Modified Files: Config.in tty_io.c vt.c Log Message: Almost done with the new console lock. I need to do one more thing. Allow for multihead again. Index: Config.in =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/Config.in,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- Config.in 2001/11/23 04:10:15 1.31 +++ Config.in 2001/12/09 01:43:35 1.32 @@ -103,6 +103,9 @@ fi source drivers/i2c/Config.in +if [ "$CONFIG_ARM" = "y" ]; then + source drivers/l3/Config.in +fi tristate 'QIC-02 tape support' CONFIG_QIC02_TAPE if [ "$CONFIG_QIC02_TAPE" != "n" ]; then Index: tty_io.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/tty_io.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- tty_io.c 2001/12/08 00:54:01 1.41 +++ tty_io.c 2001/12/09 01:43:35 1.42 @@ -2078,9 +2078,12 @@ tty_drivers = driver; //if (!(driver->flags & TTY_DRIVER_CONSOLE)) - - driver->tty_lock = kmalloc(sizeof(struct semaphore), GFP_KERNEL); - init_MUTEX(driver->tty_lock); + + if (!driver->console) { + driver->tty_lock = kmalloc(sizeof(struct semaphore),GFP_KERNEL); + init_MUTEX(driver->tty_lock); + } else + driver->tty_lock = &driver->console->lock; if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) { for(i = 0; i < driver->num; i++) Index: vt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/char/vt.c,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- vt.c 2001/12/08 00:58:07 1.114 +++ vt.c 2001/12/09 01:43:35 1.115 @@ -1563,14 +1563,10 @@ #endif } -static struct tty_struct *vty_table[MAX_NR_USER_CONSOLES]; -static struct termios *vty_termios[MAX_NR_USER_CONSOLES]; -static struct termios *vty_termios_locked[MAX_NR_USER_CONSOLES]; -struct tty_driver vty_driver; -static int vty_refcount; - int __init vty_init(void) { + struct tty_driver *vty_driver; + #if defined (CONFIG_PROM_CONSOLE) prom_con_init(); #endif @@ -1580,35 +1576,39 @@ kbd_init(); console_map_init(); - memset(&vty_driver, 0, sizeof(struct tty_driver)); - - vty_driver.refcount = &vty_refcount; - vty_driver.table = vty_table; - vty_driver.termios = vty_termios; - vty_driver.termios_locked = vty_termios_locked; + vty_driver = kmalloc(sizeof(struct tty_driver), GFP_KERNEL); + memset(vty_driver, 0, sizeof(struct tty_driver)); + + vty_driver->refcount = kmalloc(sizeof(int), GFP_KERNEL); + vty_driver->table = kmalloc(sizeof(struct tty_struct) * MAX_NR_USER_CONSOLES, GFP_KERNEL); + vty_driver->termios = kmalloc(sizeof(struct termios) * MAX_NR_USER_CONSOLES, GFP_KERNEL); + vty_driver->termios_locked = kmalloc(sizeof(struct termios) * MAX_NR_USER_CONSOLES, GFP_KERNEL); - vty_driver.magic = TTY_DRIVER_MAGIC; - vty_driver.name = "vc/%d"; - vty_driver.name_base = 0; //current_vc; - vty_driver.major = TTY_MAJOR; - vty_driver.minor_start = 0; //current_vc; - vty_driver.num = MAX_NR_USER_CONSOLES; - vty_driver.type = TTY_DRIVER_TYPE_CONSOLE; - vty_driver.init_termios = tty_std_termios; - vty_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS; - vty_driver.open = vt_open; - vty_driver.close = vt_close; - vty_driver.write = vt_write; - vty_driver.write_room = vt_write_room; - vty_driver.put_char = vt_put_char; - vty_driver.flush_chars = vt_flush_chars; - vty_driver.chars_in_buffer = vt_chars_in_buffer; - vty_driver.ioctl = vt_ioctl; - vty_driver.stop = vt_stop; - vty_driver.start = vt_start; - vty_driver.throttle = vt_throttle; - vty_driver.unthrottle = vt_unthrottle; - if (tty_register_driver(&vty_driver)) + vty_driver->magic = TTY_DRIVER_MAGIC; + vty_driver->name = "vc/%d"; + vty_driver->name_base = 0; //current_vc; + vty_driver->major = TTY_MAJOR; + vty_driver->minor_start = 0; //current_vc; + vty_driver->num = MAX_NR_USER_CONSOLES; + vty_driver->type = TTY_DRIVER_TYPE_CONSOLE; + vty_driver->init_termios = tty_std_termios; + vty_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS; +#ifdef CONFIG_VT_CONSOLE + vty_driver->console = &vt_console_driver; +#endif + vty_driver->open = vt_open; + vty_driver->close = vt_close; + vty_driver->write = vt_write; + vty_driver->write_room = vt_write_room; + vty_driver->put_char = vt_put_char; + vty_driver->flush_chars = vt_flush_chars; + vty_driver->chars_in_buffer = vt_chars_in_buffer; + vty_driver->ioctl = vt_ioctl; + vty_driver->stop = vt_stop; + vty_driver->start = vt_start; + vty_driver->throttle = vt_throttle; + vty_driver->unthrottle = vt_unthrottle; + if (tty_register_driver(vty_driver)) printk("Couldn't register console driver\n"); vcs_init(); return 0; |
From: James S. <jsi...@us...> - 2001-12-09 01:43:38
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv9503/include/linux Modified Files: tty_driver.h Log Message: Almost done with the new console lock. I need to do one more thing. Allow for multihead again. Index: tty_driver.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/tty_driver.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- tty_driver.h 2001/12/08 00:54:01 1.4 +++ tty_driver.h 2001/12/09 01:43:35 1.5 @@ -132,6 +132,7 @@ int may_schedule; /* when we can schedule */ int *refcount; /* for loadable tty drivers */ struct semaphore *tty_lock;/* access control for printk and tty layer */ + struct console *console;/* console attached to this tty hardware */ struct proc_dir_entry *proc_entry; /* /proc fs entry */ struct tty_driver *other; /* only used for the PTY driver */ |
From: James S. <jsi...@us...> - 2001-12-08 00:58:10
|
Update of /cvsroot/linuxconsole/ruby/linux/include/linux In directory usw-pr-cvs1:/tmp/cvs-serv23944/include/linux Modified Files: vt_kern.h Log Message: Don't need to pass in struct tty_driver to create_vt anymore. Plus I removed the need for tty specific stuff in the console display drivers. Index: vt_kern.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/include/linux/vt_kern.h,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- vt_kern.h 2001/10/04 02:46:33 1.61 +++ vt_kern.h 2001/12/08 00:58:07 1.62 @@ -250,7 +250,7 @@ /* vt.c */ struct console_font_op; -const char* create_vt(struct tty_driver *drv, struct vt_struct *vt, int init); +const char* create_vt(struct vt_struct *vt, int init); int release_vt(struct vt_struct *vt); struct vc_data* find_vc(int currcons); struct vc_data* vc_allocate(unsigned int console); |