diff options
| author | Marcel Moolenaar <marcel@FreeBSD.org> | 2007-04-03 01:21:10 +0000 |
|---|---|---|
| committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2007-04-03 01:21:10 +0000 |
| commit | 35777a2a79dec37cdacb86cac0e87e23465e2d7d (patch) | |
| tree | 2c12043ab23fa84e4fb5a75f863be90e1757d46f /sys/dev/uart | |
| parent | 7bd5b79de4aebc5016e2d23cd2bbe36bf85ca7a2 (diff) | |
Notes
Diffstat (limited to 'sys/dev/uart')
| -rw-r--r-- | sys/dev/uart/uart_dev_ns8250.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index 4e5141796d20..abe141b705ac 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -285,19 +285,16 @@ ns8250_term(struct uart_bas *bas) static void ns8250_putc(struct uart_bas *bas, int c) { - int delay, limit; - - /* 1/10th the time to transmit 1 character (estimate). */ - delay = ns8250_delay(bas); + int limit; - limit = 20; + limit = 250000; while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0 && --limit) - DELAY(delay); + DELAY(4); uart_setreg(bas, REG_DATA, c); uart_barrier(bas); - limit = 40; + limit = 250000; while ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0 && --limit) - DELAY(delay); + DELAY(4); } static int @@ -310,16 +307,13 @@ ns8250_rxready(struct uart_bas *bas) static int ns8250_getc(struct uart_bas *bas, struct mtx *hwmtx) { - int c, delay; + int c; uart_lock(hwmtx); - /* 1/10th the time to transmit 1 character (estimate). */ - delay = ns8250_delay(bas); - while ((uart_getreg(bas, REG_LSR) & LSR_RXRDY) == 0) { uart_unlock(hwmtx); - DELAY(delay); + DELAY(4); uart_lock(hwmtx); } |
