|
From: James S. <jsi...@us...> - 2001-11-23 01:44:35
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial
In directory usw-pr-cvs1:/tmp/cvs-serv20909
Modified Files:
ChangeLog serial_8250.c serial_8250_pci.c serial_amba.c
serial_anakin.c serial_clps711x.c serial_core.c
serial_sa1100.c serial_uart00.c
Log Message:
Synced to Russell Kings latest work. Okay tonight I will work on it.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/ChangeLog,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ChangeLog 2001/11/13 20:30:44 1.1
+++ ChangeLog 2001/11/23 01:44:32 1.2
@@ -1,4 +1,4 @@
-2001-11-13 James Simmons <jsi...@tr...>
+2001-11-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.
Index: serial_8250.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- serial_8250.c 2001/11/01 21:38:35 1.9
+++ serial_8250.c 2001/11/23 01:44:33 1.10
@@ -320,11 +320,12 @@
}
/*
- * We check for a XR16C850 by setting DLL and DLM to 0, and
- * then reading back DLL and DLM. If DLM reads back 0x10,
- * then the UART is a XR16C850 and the DLL contains the chip
- * revision. If DLM reads back 0x14, then the UART is a
- * XR16C854.
+ * We check for a XR16C850 by setting DLL and DLM to 0, and then
+ * reading back DLL and DLM. The chip type depends on the DLM
+ * value read back:
+ * 0x10 - XR16C850 and the DLL contains the chip revision.
+ * 0x12 - XR16C2850.
+ * 0x14 - XR16C854.
*/
/* Save the DLL and DLM */
@@ -339,7 +340,7 @@
scratch = serial_inp(port, UART_DLM);
serial_outp(port, UART_LCR, 0);
- if (scratch == 0x10 || scratch == 0x14) {
+ if (scratch == 0x10 || scratch == 0x12 || scratch == 0x14) {
if (scratch == 0x10)
port->port_rev = scratch2;
port->type = PORT_16850;
@@ -1021,11 +1022,11 @@
return serial_in(port, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
}
-static int serial8250_get_mctrl(struct uart_port *port)
+static u_int serial8250_get_mctrl(struct uart_port *port)
{
unsigned long flags;
unsigned char status;
- int ret;
+ unsigned int ret;
save_flags(flags); cli();
status = serial_in(port, UART_MSR);
@@ -1420,10 +1421,16 @@
* For a XR16C850, we need to set the trigger levels
*/
if (port->type == PORT_16850) {
- serial_outp(port, UART_FCTR, UART_FCTR_TRGD |
+ unsigned char fctr;
+
+ fctr = serial_inp(port, UART_FCTR) &
+ ~(UART_FCTR_RX | UART_FCTR_TX);
+ serial_outp(port, UART_FCTR, fctr |
+ UART_FCTR_TRGD |
UART_FCTR_RX);
serial_outp(port, UART_TRG, UART_TRG_96);
- serial_outp(port, UART_FCTR, UART_FCTR_TRGD |
+ serial_outp(port, UART_FCTR, fctr |
+ UART_FCTR_TRGD |
UART_FCTR_TX);
serial_outp(port, UART_TRG, UART_TRG_96);
}
Index: serial_8250_pci.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pci.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- serial_8250_pci.c 2001/11/01 21:38:35 1.9
+++ serial_8250_pci.c 2001/11/23 01:44:33 1.10
@@ -1045,11 +1045,13 @@
pbn_dci_pccom8 },
#endif
- { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xffff00, },
- { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
- PCI_CLASS_COMMUNICATION_MODEM << 8, 0xffff00, },
- { 0, }
+ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+ PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xffff00, },
+ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+ PCI_CLASS_COMMUNICATION_MODEM << 8, 0xffff00, },
+ { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+ PCI_CLASS_COMMUNICATION_MULTISERIAL << 8, 0xffff00, },
+ { 0, }
};
static struct pci_driver serial_pci_driver = {
Index: serial_amba.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_amba.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- serial_amba.c 2001/11/01 21:38:35 1.8
+++ serial_amba.c 2001/11/23 01:44:33 1.9
@@ -344,7 +344,7 @@
return UART_GET_FR(port) & AMBA_UARTFR_BUSY ? 0 : TIOCSER_TEMT;
}
-static int ambauart_get_mctrl(struct uart_port *port)
+static u_int ambauart_get_mctrl(struct uart_port *port)
{
unsigned int result = 0;
unsigned int status;
Index: serial_anakin.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_anakin.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- serial_anakin.c 2001/11/01 21:38:58 1.1
+++ serial_anakin.c 2001/11/23 01:44:33 1.2
@@ -225,7 +225,7 @@
return anakin_in(port, 0x10) & TXEMPTY ? TIOCSER_TEMT : 0;
}
-static int
+static u_int
anakin_get_mctrl(struct uart_port *port)
{
unsigned int status = 0;
Index: serial_clps711x.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_clps711x.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- serial_clps711x.c 2001/11/01 21:38:35 1.8
+++ serial_clps711x.c 2001/11/23 01:44:33 1.9
@@ -255,7 +255,7 @@
return status & SYSFLG_UBUSY ? 0 : TIOCSER_TEMT;
}
-static int clps711xuart_get_mctrl(struct uart_port *port)
+static u_int clps711xuart_get_mctrl(struct uart_port *port)
{
unsigned int port_addr;
unsigned int result = 0;
Index: serial_core.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_core.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- serial_core.c 2001/11/06 21:56:04 1.15
+++ serial_core.c 2001/11/23 01:44:33 1.16
@@ -1393,6 +1393,7 @@
/*
* In 2.4.5, calls to uart_open are serialised by the BKL in
* linux/fs/devices.c:chrdev_open()
+ * Note that if this fails, then uart_close() _will_ be called.
*/
static int uart_open(struct tty_struct *tty, struct file *filp)
{
@@ -1416,12 +1417,17 @@
if (!info)
goto out;
+ /*
+ * 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.
+ */
tty->driver_data = info;
info->tty = tty;
info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
if (uart_alloc_tmpbuf())
- goto out;
+ goto fail;
/*
* If the port is in the middle of closing, bail out now.
@@ -1432,7 +1438,7 @@
interruptible_sleep_on(&info->close_wait);
retval = (info->flags & ASYNC_HUP_NOTIFY) ?
-EAGAIN : -ERESTARTSYS;
- goto out;
+ goto fail;
}
/*
@@ -1451,11 +1457,11 @@
*/
retval = uart_startup(info);
if (retval)
- goto out;
+ goto fail;
retval = uart_block_til_ready(tty, filp, info);
if (retval)
- goto out;
+ goto fail;
if (info->state->count == 1) {
int changed_termios = 0;
Index: serial_sa1100.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_sa1100.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- serial_sa1100.c 2001/11/01 21:38:35 1.13
+++ serial_sa1100.c 2001/11/23 01:44:33 1.14
@@ -311,7 +311,7 @@
return UART_GET_UTSR1(port) & UTSR1_TBY ? 0 : TIOCSER_TEMT;
}
-static int sa1100_get_mctrl(struct uart_port *port)
+static u_int sa1100_get_mctrl(struct uart_port *port)
{
return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
}
Index: serial_uart00.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_uart00.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- serial_uart00.c 2001/11/01 21:38:58 1.1
+++ serial_uart00.c 2001/11/23 01:44:33 1.2
@@ -363,7 +363,7 @@
return UART_GET_TSR(port) & UART_TSR_TX_LEVEL_MSK? 0 : TIOCSER_TEMT;
}
-static int uart00_get_mctrl(struct uart_port *port)
+static u_int uart00_get_mctrl(struct uart_port *port)
{
unsigned int result = 0;
unsigned int status;
|