From e1e5479836ad98ddd7eceb70fb086af82119f66d Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 29 Aug 2004 02:48:16 +0100 Subject: [PATCH] [SERIAL] 8250: tell transmit path the data transfer size. Some UARTs give us a transmit interrupt when the TX FIFO is less than half empty. This means we should not transfer a FIFO-full of data to the device. Introduce "tx_loadsz" to indicate the size of this transfer. --- drivers/serial/8250.c | 36 +++++++++++++++++++----------------- drivers/serial/8250.h | 1 + 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index a6b266aed5cfa..44ce7cb316786 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -130,6 +130,7 @@ struct uart_8250_port { struct timer_list timer; /* "no irq" timer */ struct list_head list; /* ports on this IRQ */ unsigned int capabilities; /* port capabilities */ + unsigned int tx_loadsz; /* transmit fifo load size */ unsigned short rev; unsigned char acr; unsigned char ier; @@ -157,22 +158,22 @@ static struct irq_info irq_lists[NR_IRQS]; * Here we define the default xmit fifo size used for each type of UART. */ static const struct serial8250_config uart_config[PORT_MAX_8250+1] = { - { "unknown", 1, 0 }, - { "8250", 1, 0 }, - { "16450", 1, 0 }, - { "16550", 1, 0 }, - { "16550A", 16, UART_CLEAR_FIFO | UART_USE_FIFO }, - { "Cirrus", 1, 0 }, - { "ST16650", 1, UART_CLEAR_FIFO | UART_STARTECH }, - { "ST16650V2", 32, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }, - { "TI16750", 64, UART_CLEAR_FIFO | UART_USE_FIFO }, - { "Startech", 1, 0 }, - { "16C950/954", 128, UART_CLEAR_FIFO | UART_USE_FIFO }, - { "ST16654", 64, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }, - { "XR16850", 128, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }, - { "RSA", 2048, UART_CLEAR_FIFO | UART_USE_FIFO }, - { "NS16550A", 16, UART_CLEAR_FIFO | UART_USE_FIFO | UART_NATSEMI }, - { "XScale", 32, UART_CLEAR_FIFO | UART_USE_FIFO }, + { "unknown", 1, 1, 0 }, + { "8250", 1, 1, 0 }, + { "16450", 1, 1, 0 }, + { "16550", 1, 1, 0 }, + { "16550A", 16, 16, UART_CLEAR_FIFO | UART_USE_FIFO }, + { "Cirrus", 1, 1, 0 }, + { "ST16650", 1, 1, UART_CLEAR_FIFO | UART_STARTECH }, + { "ST16650V2", 32, 16, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }, + { "TI16750", 64, 64, UART_CLEAR_FIFO | UART_USE_FIFO }, + { "Startech", 1, 1, 0 }, + { "16C950/954", 128, 128, UART_CLEAR_FIFO | UART_USE_FIFO }, + { "ST16654", 64, 32, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }, + { "XR16850", 128, 128, UART_CLEAR_FIFO | UART_USE_FIFO | UART_STARTECH }, + { "RSA", 2048, 2048, UART_CLEAR_FIFO | UART_USE_FIFO }, + { "NS16550A", 16, 16, UART_CLEAR_FIFO | UART_USE_FIFO | UART_NATSEMI }, + { "XScale", 32, 32, UART_CLEAR_FIFO | UART_USE_FIFO }, }; static _INLINE_ unsigned int serial_in(struct uart_8250_port *up, int offset) @@ -712,6 +713,7 @@ static void autoconfig(struct uart_8250_port *up, unsigned int probeflags) up->port.fifosize = uart_config[up->port.type].fifo_size; up->capabilities = uart_config[up->port.type].flags; + up->tx_loadsz = uart_config[up->port.type].tx_loadsz; if (up->port.type == PORT_UNKNOWN) goto out; @@ -933,7 +935,7 @@ static _INLINE_ void transmit_chars(struct uart_8250_port *up) return; } - count = up->port.fifosize; + count = up->tx_loadsz; do { serial_out(up, UART_TX, xmit->buf[xmit->tail]); xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h index 46bd2cd174053..0ccf4865a369c 100644 --- a/drivers/serial/8250.h +++ b/drivers/serial/8250.h @@ -39,6 +39,7 @@ struct old_serial_port { struct serial8250_config { const char *name; unsigned int fifo_size; + unsigned int tx_loadsz; unsigned int flags; }; -- 2.53.0