Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325248
b: refs/heads/master
c: ab0a71f
h: refs/heads/master
v: v3
  • Loading branch information
Samuel Iglesias Gonsalvez authored and Greg Kroah-Hartman committed Sep 12, 2012
1 parent 2806517 commit 0efe32b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 25 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: 9c1d784afc6fc37d328623d1adf503031b524788
refs/heads/master: ab0a71f06d44334154091c6cdc823f908398623e
60 changes: 36 additions & 24 deletions trunk/drivers/staging/ipack/devices/ipoctal.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,33 +134,45 @@ static int ipoctal_get_icount(struct tty_struct *tty,
static void ipoctal_irq_rx(struct ipoctal_channel *channel,
struct tty_struct *tty, u8 sr)
{
unsigned char value = ioread8(&channel->regs->r.rhr);
unsigned char value;
unsigned char flag = TTY_NORMAL;

/* Error: count statistics */
if (sr & SR_ERROR) {
iowrite8(CR_CMD_RESET_ERR_STATUS, &channel->regs->w.cr);

if (sr & SR_OVERRUN_ERROR) {
channel->stats.overrun_err++;
/* Overrun doesn't affect the current character*/
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
}
if (sr & SR_PARITY_ERROR) {
channel->stats.parity_err++;
flag = TTY_PARITY;
}
if (sr & SR_FRAMING_ERROR) {
channel->stats.framing_err++;
flag = TTY_FRAME;
u8 isr;

do {
value = ioread8(&channel->regs->r.rhr);
/* Error: count statistics */
if (sr & SR_ERROR) {
iowrite8(CR_CMD_RESET_ERR_STATUS, &channel->regs->w.cr);

if (sr & SR_OVERRUN_ERROR) {
channel->stats.overrun_err++;
/* Overrun doesn't affect the current character*/
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
}
if (sr & SR_PARITY_ERROR) {
channel->stats.parity_err++;
flag = TTY_PARITY;
}
if (sr & SR_FRAMING_ERROR) {
channel->stats.framing_err++;
flag = TTY_FRAME;
}
if (sr & SR_RECEIVED_BREAK) {
channel->stats.rcv_break++;
flag = TTY_BREAK;
}
}
if (sr & SR_RECEIVED_BREAK) {
channel->stats.rcv_break++;
flag = TTY_BREAK;
}
}
tty_insert_flip_char(tty, value, flag);

tty_insert_flip_char(tty, value, flag);
/* Check if there are more characters in RX FIFO
* If there are more, the isr register for this channel
* has enabled the RxRDY|FFULL bit.
*/
isr = ioread8(&channel->block_regs->r.isr);
sr = ioread8(&channel->regs->r.sr);
} while (isr & channel->isr_rx_rdy_mask);

tty_flip_buffer_push(tty);
}

static void ipoctal_irq_tx(struct ipoctal_channel *channel)
Expand Down

0 comments on commit 0efe32b

Please sign in to comment.