diff options
Diffstat (limited to 'drivers/char/rocket.c')
-rw-r--r-- | drivers/char/rocket.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index d3bc731fbb27..0949dcef0697 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -325,19 +325,16 @@ static void rp_do_receive(struct r_port *info, | |||
325 | { | 325 | { |
326 | unsigned int CharNStat; | 326 | unsigned int CharNStat; |
327 | int ToRecv, wRecv, space = 0, count; | 327 | int ToRecv, wRecv, space = 0, count; |
328 | unsigned char *cbuf; | 328 | unsigned char *cbuf, *chead; |
329 | char *fbuf; | 329 | char *fbuf, *fhead; |
330 | struct tty_ldisc *ld; | 330 | struct tty_ldisc *ld; |
331 | 331 | ||
332 | ld = tty_ldisc_ref(tty); | 332 | ld = tty_ldisc_ref(tty); |
333 | 333 | ||
334 | ToRecv = sGetRxCnt(cp); | 334 | ToRecv = sGetRxCnt(cp); |
335 | if (ld) | 335 | space = tty->receive_room; |
336 | space = ld->receive_room(tty); | ||
337 | if (space > 2 * TTY_FLIPBUF_SIZE) | 336 | if (space > 2 * TTY_FLIPBUF_SIZE) |
338 | space = 2 * TTY_FLIPBUF_SIZE; | 337 | space = 2 * TTY_FLIPBUF_SIZE; |
339 | cbuf = tty->flip.char_buf; | ||
340 | fbuf = tty->flip.flag_buf; | ||
341 | count = 0; | 338 | count = 0; |
342 | #ifdef ROCKET_DEBUG_INTR | 339 | #ifdef ROCKET_DEBUG_INTR |
343 | printk(KERN_INFO "rp_do_receive(%d, %d)...", ToRecv, space); | 340 | printk(KERN_INFO "rp_do_receive(%d, %d)...", ToRecv, space); |
@@ -350,9 +347,13 @@ static void rp_do_receive(struct r_port *info, | |||
350 | if (ToRecv > space) | 347 | if (ToRecv > space) |
351 | ToRecv = space; | 348 | ToRecv = space; |
352 | 349 | ||
350 | ToRecv = tty_prepare_flip_string_flags(tty, &chead, &fhead, ToRecv); | ||
353 | if (ToRecv <= 0) | 351 | if (ToRecv <= 0) |
354 | goto done; | 352 | goto done; |
355 | 353 | ||
354 | cbuf = chead; | ||
355 | fbuf = fhead; | ||
356 | |||
356 | /* | 357 | /* |
357 | * if status indicates there are errored characters in the | 358 | * if status indicates there are errored characters in the |
358 | * FIFO, then enter status mode (a word in FIFO holds | 359 | * FIFO, then enter status mode (a word in FIFO holds |
@@ -399,7 +400,7 @@ static void rp_do_receive(struct r_port *info, | |||
399 | else if (CharNStat & STMRCVROVRH) | 400 | else if (CharNStat & STMRCVROVRH) |
400 | *fbuf++ = TTY_OVERRUN; | 401 | *fbuf++ = TTY_OVERRUN; |
401 | else | 402 | else |
402 | *fbuf++ = 0; | 403 | *fbuf++ = TTY_NORMAL; |
403 | *cbuf++ = CharNStat & 0xff; | 404 | *cbuf++ = CharNStat & 0xff; |
404 | count++; | 405 | count++; |
405 | ToRecv--; | 406 | ToRecv--; |
@@ -426,13 +427,13 @@ static void rp_do_receive(struct r_port *info, | |||
426 | sInStrW(sGetTxRxDataIO(cp), (unsigned short *) cbuf, wRecv); | 427 | sInStrW(sGetTxRxDataIO(cp), (unsigned short *) cbuf, wRecv); |
427 | if (ToRecv & 1) | 428 | if (ToRecv & 1) |
428 | cbuf[ToRecv - 1] = sInB(sGetTxRxDataIO(cp)); | 429 | cbuf[ToRecv - 1] = sInB(sGetTxRxDataIO(cp)); |
429 | memset(fbuf, 0, ToRecv); | 430 | memset(fbuf, TTY_NORMAL, ToRecv); |
430 | cbuf += ToRecv; | 431 | cbuf += ToRecv; |
431 | fbuf += ToRecv; | 432 | fbuf += ToRecv; |
432 | count += ToRecv; | 433 | count += ToRecv; |
433 | } | 434 | } |
434 | /* Push the data up to the tty layer */ | 435 | /* Push the data up to the tty layer */ |
435 | ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); | 436 | ld->receive_buf(tty, cbuf, fbuf, count); |
436 | done: | 437 | done: |
437 | tty_ldisc_deref(ld); | 438 | tty_ldisc_deref(ld); |
438 | } | 439 | } |