X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fchar%2Frocket.c;h=0949dcef06976d8f78a250a0a725f99ce06f8f11;hb=d04ae27bae42bcce1b3fa70ca2edf25d92b1cf39;hp=928b850cc679839707c47e44d3e13ab4a06ac09e;hpb=849a8924a6740ecbf9711e015beca69425f0c429;p=powerpc.git diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 928b850cc6..0949dcef06 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -325,19 +325,16 @@ static void rp_do_receive(struct r_port *info, { unsigned int CharNStat; int ToRecv, wRecv, space = 0, count; - unsigned char *cbuf; - char *fbuf; + unsigned char *cbuf, *chead; + char *fbuf, *fhead; struct tty_ldisc *ld; ld = tty_ldisc_ref(tty); ToRecv = sGetRxCnt(cp); - if (ld) - space = ld->receive_room(tty); + space = tty->receive_room; if (space > 2 * TTY_FLIPBUF_SIZE) space = 2 * TTY_FLIPBUF_SIZE; - cbuf = tty->flip.char_buf; - fbuf = tty->flip.flag_buf; count = 0; #ifdef ROCKET_DEBUG_INTR printk(KERN_INFO "rp_do_receive(%d, %d)...", ToRecv, space); @@ -350,9 +347,13 @@ static void rp_do_receive(struct r_port *info, if (ToRecv > space) ToRecv = space; + ToRecv = tty_prepare_flip_string_flags(tty, &chead, &fhead, ToRecv); if (ToRecv <= 0) goto done; + cbuf = chead; + fbuf = fhead; + /* * if status indicates there are errored characters in the * FIFO, then enter status mode (a word in FIFO holds @@ -399,7 +400,7 @@ static void rp_do_receive(struct r_port *info, else if (CharNStat & STMRCVROVRH) *fbuf++ = TTY_OVERRUN; else - *fbuf++ = 0; + *fbuf++ = TTY_NORMAL; *cbuf++ = CharNStat & 0xff; count++; ToRecv--; @@ -426,13 +427,13 @@ static void rp_do_receive(struct r_port *info, sInStrW(sGetTxRxDataIO(cp), (unsigned short *) cbuf, wRecv); if (ToRecv & 1) cbuf[ToRecv - 1] = sInB(sGetTxRxDataIO(cp)); - memset(fbuf, 0, ToRecv); + memset(fbuf, TTY_NORMAL, ToRecv); cbuf += ToRecv; fbuf += ToRecv; count += ToRecv; } /* Push the data up to the tty layer */ - ld->receive_buf(tty, tty->flip.char_buf, tty->flip.flag_buf, count); + ld->receive_buf(tty, cbuf, fbuf, count); done: tty_ldisc_deref(ld); } @@ -2512,10 +2513,8 @@ static void rp_cleanup_module(void) "rocketport driver\n", -retval); put_tty_driver(rocket_driver); - for (i = 0; i < MAX_RP_PORTS; i++) { - if (rp_table[i]) - kfree(rp_table[i]); - } + for (i = 0; i < MAX_RP_PORTS; i++) + kfree(rp_table[i]); for (i = 0; i < NUM_BOARDS; i++) { if (rcktpt_io_addr[i] <= 0 || is_PCI[i])