Changeset e0cd9042 in mainline
- Timestamp:
- 2012-08-13T22:55:25Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 188c76c
- Parents:
- 58a369e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/ns8250/ns8250.c
r58a369e re0cd9042 82 82 /** Interrupt ID Register definition. */ 83 83 #define NS8250_IID_ACTIVE (1 << 0) 84 #define NS8250_IID_CAUSE_MASK 0x0e 85 #define NS8250_IID_CAUSE_RXSTATUS 0x06 84 86 85 87 /** FIFO Control Register definition. */ … … 466 468 { 467 469 /* Interrupt when data received. */ 468 pio_write_8(®s->ier, NS8250_IER_RXREADY );470 pio_write_8(®s->ier, NS8250_IER_RXREADY | NS8250_IER_RXSTATUS); 469 471 pio_write_8(®s->mcr, NS8250_MCR_DTR | NS8250_MCR_RTS 470 472 | NS8250_MCR_OUT2); … … 504 506 async_msg_1(exch, IRC_ENABLE_INTERRUPT, ns->irq); 505 507 async_exchange_end(exch); 508 509 /* Read LSR to clear possible previous LSR interrupt */ 510 pio_read_8(&ns->regs->lsr); 506 511 507 512 /* Enable interrupt on the serial port. */ … … 766 771 /** The interrupt handler. 767 772 * 768 * The serial port is initialized to interrupt when some data come, so the 769 * interrupt is handled by reading the incomming data. 773 * The serial port is initialized to interrupt when some data come or line 774 * status register changes, so the interrupt is handled by reading the incoming 775 * data and reading the line status register. 770 776 * 771 777 * @param dev The serial port device. … … 774 780 ipc_call_t *icall) 775 781 { 776 ns8250_read_from_device(NS8250_FROM_DEV(dev)); 782 ns8250_t *ns = NS8250_FROM_DEV(dev); 783 784 uint8_t iir = pio_read_8(&ns->regs->iid); 785 if ((iir & NS8250_IID_CAUSE_MASK) == NS8250_IID_CAUSE_RXSTATUS) { 786 uint8_t lsr = pio_read_8(&ns->regs->lsr); 787 if (lsr & NS8250_LSR_OE) { 788 ddf_msg(LVL_WARN, "Overrun error on %s", ns->dev->name); 789 } 790 } 791 792 ns8250_read_from_device(ns); 777 793 } 778 794
Note:
See TracChangeset
for help on using the changeset viewer.