Automatic merge of master.kernel.org:/home/rmk/linux-2.6-serial.git

+41 -110
+2 -12
drivers/serial/21285.c
··· 126 126 flag = TTY_FRAME; 127 127 } 128 128 129 - if ((rxs & port->ignore_status_mask) == 0) { 130 - tty_insert_flip_char(tty, ch, flag); 131 - } 132 - if ((rxs & RXSTAT_OVERRUN) && 133 - tty->flip.count < TTY_FLIPBUF_SIZE) { 134 - /* 135 - * Overrun is special, since it's reported 136 - * immediately, and doesn't affect the current 137 - * character. 138 - */ 139 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 140 - } 129 + uart_insert_char(port, rxs, RXSTAT_OVERRUN, ch, flag); 130 + 141 131 status = *CSR_UARTFLG; 142 132 } 143 133 tty_flip_buffer_push(tty);
+3 -12
drivers/serial/8250.c
··· 1122 1122 } 1123 1123 if (uart_handle_sysrq_char(&up->port, ch, regs)) 1124 1124 goto ignore_char; 1125 - if ((lsr & up->port.ignore_status_mask) == 0) { 1126 - tty_insert_flip_char(tty, ch, flag); 1127 - } 1128 - if ((lsr & UART_LSR_OE) && 1129 - tty->flip.count < TTY_FLIPBUF_SIZE) { 1130 - /* 1131 - * Overrun is special, since it's reported 1132 - * immediately, and doesn't affect the current 1133 - * character. 1134 - */ 1135 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 1136 - } 1125 + 1126 + uart_insert_char(&up->port, lsr, UART_LSR_OE, ch, flag); 1127 + 1137 1128 ignore_char: 1138 1129 lsr = serial_inp(up, UART_LSR); 1139 1130 } while ((lsr & UART_LSR_DR) && (max_count-- > 0));
+2 -12
drivers/serial/amba-pl010.c
··· 198 198 if (uart_handle_sysrq_char(port, ch, regs)) 199 199 goto ignore_char; 200 200 201 - if ((rsr & port->ignore_status_mask) == 0) { 202 - tty_insert_flip_char(tty, ch, flag); 203 - } 204 - if ((rsr & UART01x_RSR_OE) && 205 - tty->flip.count < TTY_FLIPBUF_SIZE) { 206 - /* 207 - * Overrun is special, since it's reported 208 - * immediately, and doesn't affect the current 209 - * character 210 - */ 211 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 212 - } 201 + uart_insert_char(port, rsr, UART01x_RSR_OE, ch, flag); 202 + 213 203 ignore_char: 214 204 status = UART_GET_FR(port); 215 205 }
+2 -12
drivers/serial/amba-pl011.c
··· 163 163 if (uart_handle_sysrq_char(&uap->port, ch, regs)) 164 164 goto ignore_char; 165 165 166 - if ((rsr & uap->port.ignore_status_mask) == 0) { 167 - tty_insert_flip_char(tty, ch, flag); 168 - } 169 - if ((rsr & UART01x_RSR_OE) && 170 - tty->flip.count < TTY_FLIPBUF_SIZE) { 171 - /* 172 - * Overrun is special, since it's reported 173 - * immediately, and doesn't affect the current 174 - * character 175 - */ 176 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 177 - } 166 + uart_insert_char(&uap->port, rsr, UART01x_RSR_OE, ch, flag); 167 + 178 168 ignore_char: 179 169 status = readw(uap->port.membase + UART01x_FR); 180 170 }
+1 -4
drivers/serial/clps711x.c
··· 143 143 * CHECK: does overrun affect the current character? 144 144 * ASSUMPTION: it does not. 145 145 */ 146 - if ((ch & port->ignore_status_mask & ~RXSTAT_OVERRUN) == 0) 147 - tty_insert_flip_char(tty, ch, flg); 148 - if ((ch & ~port->ignore_status_mask & RXSTAT_OVERRUN) == 0) 149 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 146 + uart_insert_char(port, ch, UARTDR_OVERR, ch, flg); 150 147 151 148 ignore_char: 152 149 status = clps_readl(SYSFLG(port));
+4 -12
drivers/serial/pxa.c
··· 161 161 else if (*status & UART_LSR_FE) 162 162 flag = TTY_FRAME; 163 163 } 164 + 164 165 if (uart_handle_sysrq_char(&up->port, ch, regs)) 165 166 goto ignore_char; 166 - if ((*status & up->port.ignore_status_mask) == 0) { 167 - tty_insert_flip_char(tty, ch, flag); 168 - } 169 - if ((*status & UART_LSR_OE) && 170 - tty->flip.count < TTY_FLIPBUF_SIZE) { 171 - /* 172 - * Overrun is special, since it's reported 173 - * immediately, and doesn't affect the current 174 - * character. 175 - */ 176 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 177 - } 167 + 168 + uart_insert_char(&up->port, *status, UART_LSR_OE, ch, flag); 169 + 178 170 ignore_char: 179 171 *status = serial_in(up, UART_LSR); 180 172 } while ((*status & UART_LSR_DR) && (max_count-- > 0));
+1 -14
drivers/serial/s3c2410.c
··· 394 394 if (uart_handle_sysrq_char(port, ch, regs)) 395 395 goto ignore_char; 396 396 397 - if ((uerstat & port->ignore_status_mask) == 0) { 398 - tty_insert_flip_char(tty, ch, flag); 399 - } 400 - 401 - if ((uerstat & S3C2410_UERSTAT_OVERRUN) && 402 - tty->flip.count < TTY_FLIPBUF_SIZE) { 403 - /* 404 - * Overrun is special, since it's reported 405 - * immediately, and doesn't affect the current 406 - * character. 407 - */ 408 - 409 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 410 - } 397 + uart_insert_char(port, uerstat, S3C2410_UERSTAT_OVERRUN, ch, flag); 411 398 412 399 ignore_char: 413 400 continue;
+1 -4
drivers/serial/sa1100.c
··· 237 237 if (uart_handle_sysrq_char(&sport->port, ch, regs)) 238 238 goto ignore_char; 239 239 240 - if ((status & port->ignore_status_mask & ~UTSR1_TO_SM(UTSR1_ROR)) == 0) 241 - tty_insert_flip_char(tty, ch, flg); 242 - if (status & ~port->ignore_status_mask & UTSR1_TO_SM(UTSR1_ROR)) 243 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 240 + uart_insert_char(&sport->port, status, UTSR1_TO_SM(UTSR1_ROR), ch, flg); 244 241 245 242 ignore_char: 246 243 status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
+1 -12
drivers/serial/serial_lh7a40x.c
··· 190 190 if (uart_handle_sysrq_char (port, (unsigned char) data, regs)) 191 191 continue; 192 192 193 - if ((data & port->ignore_status_mask) == 0) { 194 - tty_insert_flip_char(tty, data, flag); 195 - } 196 - if ((data & RxOverrunError) 197 - && tty->flip.count < TTY_FLIPBUF_SIZE) { 198 - /* 199 - * Overrun is special, since it's reported 200 - * immediately, and doesn't affect the current 201 - * character 202 - */ 203 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 204 - } 193 + uart_insert_char(port, data, RxOverrunError, data, flag); 205 194 } 206 195 tty_flip_buffer_push (tty); 207 196 return;
+3 -12
drivers/serial/serial_txx9.c
··· 350 350 } 351 351 if (uart_handle_sysrq_char(&up->port, ch, regs)) 352 352 goto ignore_char; 353 - if ((disr & up->port.ignore_status_mask) == 0) { 354 - tty_insert_flip_char(tty, ch, flag); 355 - } 356 - if ((disr & TXX9_SIDISR_UOER) && 357 - tty->flip.count < TTY_FLIPBUF_SIZE) { 358 - /* 359 - * Overrun is special, since it's reported 360 - * immediately, and doesn't affect the current 361 - * character. 362 - */ 363 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 364 - } 353 + 354 + uart_insert_char(&up->port, disr, TXX9_SIDISR_UOER, ch, flag); 355 + 365 356 ignore_char: 366 357 disr = sio_in(up, TXX9_SIDISR); 367 358 } while (!(disr & TXX9_SIDISR_UVALID) && (max_count-- > 0));
+2 -4
drivers/serial/vr41xx_siu.c
··· 412 412 413 413 if (uart_handle_sysrq_char(port, ch, regs)) 414 414 goto ignore_char; 415 - if ((lsr & port->ignore_status_mask) == 0) 416 - tty_insert_flip_char(tty, ch, flag); 417 - if ((lsr & UART_LSR_OE) && (tty->flip.count < TTY_FLIPBUF_SIZE)) 418 - tty_insert_flip_char(tty, 0, TTY_OVERRUN); 415 + 416 + uart_insert_char(port, lsr, UART_LSR_OE, ch, flag); 419 417 420 418 ignore_char: 421 419 lsr = siu_read(port, UART_LSR);
+19
include/linux/serial_core.h
··· 479 479 } 480 480 } 481 481 482 + #include <linux/tty_flip.h> 483 + 484 + static inline void 485 + uart_insert_char(struct uart_port *port, unsigned int status, 486 + unsigned int overrun, unsigned int ch, unsigned int flag) 487 + { 488 + struct tty_struct *tty = port->info->tty; 489 + 490 + if ((status & port->ignore_status_mask & ~overrun) == 0) 491 + tty_insert_flip_char(tty, ch, flag); 492 + 493 + /* 494 + * Overrun is special. Since it's reported immediately, 495 + * it doesn't affect the current character. 496 + */ 497 + if (status & ~port->ignore_status_mask & overrun) 498 + tty_insert_flip_char(tty, 0, TTY_OVERRUN); 499 + } 500 + 482 501 /* 483 502 * UART_ENABLE_MS - determine if port should enable modem status irqs 484 503 */