Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 489
b: refs/heads/master
c: 2a9604b
h: refs/heads/master
i:
  487: 327cfee
v: v3
  • Loading branch information
Russell King committed Apr 26, 2005
1 parent 2b9d103 commit 8c6ea80
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 80 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45849282bfd7543253761cbf7db96151b05e5ed1
refs/heads/master: 2a9604b863c854e5bee409157aabb35b6ce8ecd3
65 changes: 27 additions & 38 deletions trunk/drivers/serial/clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,54 +116,43 @@ static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id, struct pt_regs *re
* Note that the error handling code is
* out of the main execution path
*/
if (unlikely(ch & UART_ANY_ERR))
goto handle_error;
if (unlikely(ch & UART_ANY_ERR)) {
if (ch & UARTDR_PARERR)
port->icount.parity++;
else if (ch & UARTDR_FRMERR)
port->icount.frame++;
if (ch & UARTDR_OVERR)
port->icount.overrun++;

if (uart_handle_sysrq_char(port, ch, regs))
goto ignore_char;
ch &= port->read_status_mask;

error_return:
tty_insert_flip_char(tty, ch, flg);
ignore_char:
status = clps_readl(SYSFLG(port));
}
out:
tty_flip_buffer_push(tty);
return IRQ_HANDLED;
if (ch & UARTDR_PARERR)
flg = TTY_PARITY;
else if (ch & UARTDR_FRMERR)
flg = TTY_FRAME;

handle_error:
if (ch & UARTDR_PARERR)
port->icount.parity++;
else if (ch & UARTDR_FRMERR)
port->icount.frame++;
if (ch & UARTDR_OVERR)
port->icount.overrun++;

if (ch & port->ignore_status_mask) {
if (++ignored > 100)
goto out;
goto ignore_char;
}
ch &= port->read_status_mask;
#ifdef SUPPORT_SYSRQ
port->sysrq = 0;
#endif
}

if (ch & UARTDR_PARERR)
flg = TTY_PARITY;
else if (ch & UARTDR_FRMERR)
flg = TTY_FRAME;
if (uart_handle_sysrq_char(port, ch, regs))
goto ignore_char;

if (ch & UARTDR_OVERR) {
/*
* CHECK: does overrun affect the current character?
* ASSUMPTION: it does not.
*/
tty_insert_flip_char(tty, ch, flg);
ch = 0;
flg = TTY_OVERRUN;
if ((ch & port->ignore_status_mask & ~RXSTAT_OVERRUN) == 0)
tty_insert_flip_char(tty, ch, flg);
if ((ch & ~port->ignore_status_mask & RXSTAT_OVERRUN) == 0)
tty_insert_flip_char(tty, 0, TTY_OVERRUN);

ignore_char:
status = clps_readl(SYSFLG(port));
}
#ifdef SUPPORT_SYSRQ
port->sysrq = 0;
#endif
goto error_return;
tty_flip_buffer_push(tty);
return IRQ_HANDLED;
}

static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id, struct pt_regs *regs)
Expand Down
65 changes: 24 additions & 41 deletions trunk/drivers/serial/sa1100.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,56 +214,39 @@ sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs)
* note that the error handling code is
* out of the main execution path
*/
if (status & UTSR1_TO_SM(UTSR1_PRE | UTSR1_FRE | UTSR1_ROR))
goto handle_error;
if (status & UTSR1_TO_SM(UTSR1_PRE | UTSR1_FRE | UTSR1_ROR)) {
if (status & UTSR1_TO_SM(UTSR1_PRE))
sport->port.icount.parity++;
else if (status & UTSR1_TO_SM(UTSR1_FRE))
sport->port.icount.frame++;
if (status & UTSR1_TO_SM(UTSR1_ROR))
sport->port.icount.overrun++;

status &= sport->port.read_status_mask;

if (status & UTSR1_TO_SM(UTSR1_PRE))
flg = TTY_PARITY;
else if (status & UTSR1_TO_SM(UTSR1_FRE))
flg = TTY_FRAME;

#ifdef SUPPORT_SYSRQ
sport->port.sysrq = 0;
#endif
}

if (uart_handle_sysrq_char(&sport->port, ch, regs))
goto ignore_char;

error_return:
tty_insert_flip_char(tty, ch, flg);
if ((status & port->ignore_status_mask & ~UTSR1_TO_SM(UTSR1_ROR)) == 0)
tty_insert_flip_char(tty, ch, flg);
if (status & ~port->ignore_status_mask & UTSR1_TO_SM(UTSR1_ROR))
tty_insert_flip_char(tty, 0, TTY_OVERRUN);

ignore_char:
status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
UTSR0_TO_SM(UART_GET_UTSR0(sport));
}
out:
tty_flip_buffer_push(tty);
return;

handle_error:
if (status & UTSR1_TO_SM(UTSR1_PRE))
sport->port.icount.parity++;
else if (status & UTSR1_TO_SM(UTSR1_FRE))
sport->port.icount.frame++;
if (status & UTSR1_TO_SM(UTSR1_ROR))
sport->port.icount.overrun++;

if (status & sport->port.ignore_status_mask) {
if (++ignored > 100)
goto out;
goto ignore_char;
}

status &= sport->port.read_status_mask;

if (status & UTSR1_TO_SM(UTSR1_PRE))
flg = TTY_PARITY;
else if (status & UTSR1_TO_SM(UTSR1_FRE))
flg = TTY_FRAME;

if (status & UTSR1_TO_SM(UTSR1_ROR)) {
/*
* overrun does *not* affect the character
* we read from the FIFO
*/
tty_insert_flip_char(tty, ch, flg);
ch = 0;
flg = TTY_OVERRUN;
}
#ifdef SUPPORT_SYSRQ
sport->port.sysrq = 0;
#endif
goto error_return;
}

static void sa1100_tx_chars(struct sa1100_port *sport)
Expand Down

0 comments on commit 8c6ea80

Please sign in to comment.