X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fser_a2232.c;h=75de5f66517aeb81bf3cec37db24baebaa03379a;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=f0b966876f35ac1b16d95f2f927f870f56d79cc2;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c index f0b966876..75de5f665 100644 --- a/drivers/char/ser_a2232.c +++ b/drivers/char/ser_a2232.c @@ -97,12 +97,13 @@ #include #include #include -#include +#include #include #include #include +#include #include "ser_a2232.h" #include "ser_a2232fw.h" @@ -110,7 +111,7 @@ /***************************** Prototypes ***************************/ /* The interrupt service routine */ -static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp); +static irqreturn_t a2232_vbl_inter(int irq, void *data); /* Initialize the port structures */ static void a2232_init_portstructs(void); /* Initialize and register TTY drivers. */ @@ -194,11 +195,6 @@ static inline void a2232_receive_char(struct a2232_port *port, int ch, int err) */ struct tty_struct *tty = port->gs.tty; - if (tty->flip.count >= TTY_FLIPBUF_SIZE) - return; - - tty->flip.count++; - #if 0 switch(err) { case TTY_BREAK: @@ -212,8 +208,7 @@ static inline void a2232_receive_char(struct a2232_port *port, int ch, int err) } #endif - *tty->flip.flag_buf_ptr++ = err; - *tty->flip.char_buf_ptr++ = ch; + tty_insert_flip_char(tty, ch, err); tty_flip_buffer_push(tty); } @@ -509,7 +504,7 @@ static int a2232_open(struct tty_struct * tty, struct file * filp) } /*** END OF FUNCTIONS EXPECTED BY TTY DRIVER STRUCTS ***/ -static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp) +static irqreturn_t a2232_vbl_inter(int irq, void *data) { #if A2232_IOBUFLEN != 256 #error "Re-Implement a2232_vbl_inter()!" @@ -599,10 +594,7 @@ int ch, err, n, p; /* WakeUp if output buffer runs low */ if ((port->gs.xmit_cnt <= port->gs.wakeup_chars) && port->gs.tty) { - if ((port->gs.tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && port->gs.tty->ldisc.write_wakeup){ - (port->gs.tty->ldisc.write_wakeup)(port->gs.tty); - } - wake_up_interruptible(&port->gs.tty->write_wait); + tty_wakeup(port->gs.tty); } } // if the port is used } // for every port on the board @@ -662,14 +654,14 @@ static void a2232_init_portstructs(void) port->gs.closing_wait = 30 * HZ; port->gs.rd = &a2232_real_driver; #ifdef NEW_WRITE_LOCKING - init_MUTEX(&(port->gs.port_write_sem)); + init_MUTEX(&(port->gs.port_write_mutex)); #endif init_waitqueue_head(&port->gs.open_wait); init_waitqueue_head(&port->gs.close_wait); } } -static struct tty_operations a2232_ops = { +static const struct tty_operations a2232_ops = { .open = a2232_open, .close = gs_close, .write = gs_write, @@ -703,6 +695,8 @@ static int a2232_init_drivers(void) a2232_driver->init_termios = tty_std_termios; a2232_driver->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; + a2232_driver->init_termios.c_ispeed = 9600; + a2232_driver->init_termios.c_ospeed = 9600; a2232_driver->flags = TTY_DRIVER_REAL_RAW; tty_set_operations(a2232_driver, &a2232_ops); if ((error = tty_register_driver(a2232_driver))) { @@ -793,7 +787,7 @@ static int __init a2232board_init(void) } - printk("Total: %d A2232 boards initialized.\n.", nr_a2232); /* Some status report if no card was found */ + printk("Total: %d A2232 boards initialized.\n", nr_a2232); /* Some status report if no card was found */ a2232_init_portstructs();