X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fchar%2Frocket.c;h=0949dcef06976d8f78a250a0a725f99ce06f8f11;hb=d04ae27bae42bcce1b3fa70ca2edf25d92b1cf39;hp=5b1d3680c8ab1e808e8a9c535bf23cbee1322bc8;hpb=8ed693d29b25bbd88471ec043cc01581419d0481;p=powerpc.git diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 5b1d3680c8..0949dcef06 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -256,7 +256,6 @@ static int sInitController(CONTROLLER_T * CtlP, int CtlNum, ByteIO_t MudbacIO, static int sReadAiopID(ByteIO_t io); static int sReadAiopNumChan(WordIO_t io); -#ifdef MODULE MODULE_AUTHOR("Theodore Ts'o"); MODULE_DESCRIPTION("Comtrol RocketPort driver"); module_param(board1, ulong, 0); @@ -288,17 +287,14 @@ MODULE_PARM_DESC(pc104_3, "set interface types for ISA(PC104) board #3 (e.g. pc1 module_param_array(pc104_4, ulong, NULL, 0); MODULE_PARM_DESC(pc104_4, "set interface types for ISA(PC104) board #4 (e.g. pc104_4=232,232,485,485,..."); -int rp_init(void); +static int rp_init(void); static void rp_cleanup_module(void); module_init(rp_init); module_exit(rp_cleanup_module); -#endif -#ifdef MODULE_LICENSE MODULE_LICENSE("Dual BSD/GPL"); -#endif /*************************************************************************/ /* Module code starts here */ @@ -329,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); @@ -354,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 @@ -403,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--; @@ -430,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); } @@ -2378,7 +2375,7 @@ static struct tty_operations rocket_ops = { /* * The module "startup" routine; it's run when the module is loaded. */ -int __init rp_init(void) +static int __init rp_init(void) { int retval, pci_boards_found, isa_boards_found, i; @@ -2502,7 +2499,6 @@ int __init rp_init(void) return 0; } -#ifdef MODULE static void rp_cleanup_module(void) { @@ -2517,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]) @@ -2530,7 +2524,6 @@ static void rp_cleanup_module(void) if (controller) release_region(controller, 4); } -#endif /*************************************************************************** Function: sInitController