summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_core.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-07-02 20:45:51 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-07-02 20:45:51 +0100
commit947deee8904b3c2edc7f59ab6e6242499e4dc434 (patch)
tree76f7c5b98508df4b6dea7b8dc01d973b9df43e60 /drivers/serial/serial_core.c
parent4faf4e0e7d4e1935fbfc5043d3ebd8d51a3d898d (diff)
downloadlinux-947deee8904b3c2edc7f59ab6e6242499e4dc434.tar.gz
linux-947deee8904b3c2edc7f59ab6e6242499e4dc434.tar.bz2
linux-947deee8904b3c2edc7f59ab6e6242499e4dc434.zip
[SERIAL] Convert fifosize to an unsigned int
Some UARTs have more than 255 bytes of FIFO, which can't be represented by an unsigned char. Change the kernel's internal structure to be an unsigned int, but still export an unsigned char via the TIOCGSERIAL ioctl. If the TIOCSSERIAL ioctl provides a fifo size of 0, assume this means "don't change" otherwise we'll corrupt the larger fifo sizes. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/serial_core.c')
-rw-r--r--drivers/serial/serial_core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 17839e753e4c..3805f467b2f5 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -691,7 +691,8 @@ static int uart_set_info(struct uart_state *state,
(new_serial.baud_base != port->uartclk / 16) ||
(close_delay != state->close_delay) ||
(closing_wait != state->closing_wait) ||
- (new_serial.xmit_fifo_size != port->fifosize) ||
+ (new_serial.xmit_fifo_size &&
+ new_serial.xmit_fifo_size != port->fifosize) ||
(((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0))
goto exit;
port->flags = ((port->flags & ~UPF_USR_MASK) |
@@ -796,7 +797,8 @@ static int uart_set_info(struct uart_state *state,
port->custom_divisor = new_serial.custom_divisor;
state->close_delay = close_delay;
state->closing_wait = closing_wait;
- port->fifosize = new_serial.xmit_fifo_size;
+ if (new_serial.xmit_fifo_size)
+ port->fifosize = new_serial.xmit_fifo_size;
if (state->info->tty)
state->info->tty->low_latency =
(port->flags & UPF_LOW_LATENCY) ? 1 : 0;