From: James S. <jsi...@us...> - 2001-12-25 04:30:02
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/serial In directory usw-pr-cvs1:/tmp/cvs-serv12595 Modified Files: ChangeLog serial_21285.c serial_8250.c serial_8250_pci.c serial_8250_pnp.c serial_amba.c serial_anakin.c serial_clps711x.c serial_core.c serial_sa1100.c serial_uart00.c Log Message: See ChangeLog for changes. Begain the tty/serial seperation. Tested and it seems to work. Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/ChangeLog,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ChangeLog 2001/11/23 01:44:32 1.2 +++ ChangeLog 2001/12/25 04:29:59 1.3 @@ -1,5 +1,11 @@ -2001-11-22 James Simmons <jsi...@tr...> +2001-12-22 James Simmons <jsi...@tr...> * Final port of Russell King's code. Today we are going to * start working on a better api for 2.5. + +2001-12-24 James Simmons <jsi...@us...> + * Moved xmit circular buffer from struct uart_info to struct uart_port + +2001-12-24 James Simmons <jsi...@us...> + * Removed ops field in uart_info. Instead use in in uart_port instead. Index: serial_21285.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_21285.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- serial_21285.c 2001/12/13 04:46:52 1.7 +++ serial_21285.c 2001/12/25 04:29:59 1.8 @@ -163,7 +163,7 @@ port->x_char = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { serial21285_stop_tx(port, 0); @@ -171,18 +171,18 @@ } do { - *CSR_UARTDR = info->xmit.buf[info->xmit.tail]; - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + *CSR_UARTDR = port->xmit.buf[port->xmit.tail]; + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0 && !(*CSR_UARTFLG & 0x20)); - if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < + if (CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) serial21285_stop_tx(port, 0); } Index: serial_8250.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serial_8250.c 2001/12/22 16:58:36 1.12 +++ serial_8250.c 2001/12/25 04:29:59 1.13 @@ -763,7 +763,7 @@ *intr_done = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { serial8250_stop_tx(port, 0); @@ -772,14 +772,14 @@ count = port->fifosize; do { - serial_out(port, UART_TX, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + serial_out(port, UART_TX, port->xmit.buf[port->xmit.tail]); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0); - if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < + if (CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); @@ -789,8 +789,8 @@ if (intr_done) *intr_done = 0; - if (info->xmit.head == info->xmit.tail) - serial8250_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + serial8250_stop_tx(port, 0); } static _INLINE_ void check_modem_status(struct uart_info *info) Index: serial_8250_pci.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pci.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serial_8250_pci.c 2001/12/13 04:46:52 1.12 +++ serial_8250_pci.c 2001/12/25 04:29:59 1.13 @@ -1078,4 +1078,4 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 PCI serial probe module"); -MODULE_GENERIC_TABLE(pci, serial_pci_tbl); +//MODULE_GENERIC_TABLE(pci, serial_pci_tbl); Index: serial_8250_pnp.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_8250_pnp.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- serial_8250_pnp.c 2001/12/13 04:46:52 1.7 +++ serial_8250_pnp.c 2001/12/25 04:29:59 1.8 @@ -549,5 +549,5 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic 8250/16x50 PNPBIOS serial probe module"); -MODULE_GENERIC_TABLE(pnp, pnp_dev_table); +//MODULE_GENERIC_TABLE(pnp, pnp_dev_table); Index: serial_amba.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_amba.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serial_amba.c 2001/12/13 04:46:52 1.10 +++ serial_amba.c 2001/12/25 04:29:59 1.11 @@ -262,7 +262,7 @@ port->x_char = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { ambauart_stop_tx(port, 0); @@ -271,19 +271,19 @@ count = port->fifosize >> 1; do { - UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + UART_PUT_CHAR(port, port->xmit.buf[port->xmit.tail]); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0); - if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < + if (CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) - ambauart_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + ambauart_stop_tx(port, 0); } static void ambauart_modem_status(struct uart_info *info) Index: serial_anakin.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_anakin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serial_anakin.c 2001/12/13 04:46:52 1.3 +++ serial_anakin.c 2001/12/25 04:29:59 1.4 @@ -88,29 +88,25 @@ } static inline void -anakin_transmit_buffer(struct uart_info *info) +anakin_transmit_buffer(struct uart_port *port) { - struct uart_port *port = info->port; - while (!(anakin_in(port, 0x10) & TXEMPTY)); - anakin_out(port, 0x14, info->xmit.buf[info->xmit.tail]); + anakin_out(port, 0x14, port->xmit.buf[port->xmit.tail]); anakin_out(port, 0x18, anakin_in(port, 0x18) | SENDREQUEST); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE-1); - info->state->icount.tx++; + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE-1); + port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) anakin_stop_tx(port, 0); } static inline void -anakin_transmit_x_char(struct uart_info *info) +anakin_transmit_x_char(struct uart_port *port) { - struct uart_port *port = info->port; - - anakin_out(port, 0x14, info->x_char); + anakin_out(port, 0x14, port->x_char); anakin_out(port, 0x18, anakin_in(port, 0x18) | SENDREQUEST); - info->state->icount.tx++; - info->x_char = 0; + port->icount.tx++; + port->x_char = 0; } static void @@ -125,10 +121,9 @@ txenable[port->irq] = TXENABLE; if ((anakin_in(port, 0x10) & TXEMPTY) && nonempty) { - anakin_transmit_buffer((struct uart_info*)port->unused); + anakin_transmit_buffer(port); } } - restore_flags(flags); } @@ -163,40 +158,42 @@ if (tty->flip.count < TTY_FLIPBUF_SIZE) { *tty->flip.char_buf_ptr++ = ch; *tty->flip.flag_buf_ptr++ = TTY_NORMAL; - info->state->icount.rx++; + info->port->icount.rx++; tty->flip.count++; } tty_flip_buffer_push(tty); } static inline void -anakin_overrun_chars(struct uart_info *info) +anakin_overrun_chars(struct uart_port *port) { unsigned int ch; - ch = anakin_in(info->port, 0x14); - info->state->icount.overrun++; + ch = anakin_in(port, 0x14); + port->icount.overrun++; } static inline void anakin_tx_chars(struct uart_info *info) { - if (info->x_char) { - anakin_transmit_x_char(info); + struct uart_port *port = info->port; + + if (port->x_char) { + anakin_transmit_x_char(port); return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { - anakin_stop_tx(info->port, 0); + anakin_stop_tx(port, 0); return; } - anakin_transmit_buffer(info); + anakin_transmit_buffer(port); - if (CIRC_CNT(info->xmit.head, - info->xmit.tail, + if (CIRC_CNT(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); } @@ -213,7 +210,7 @@ anakin_rx_chars(info); if (status & OVERRUN) - anakin_overrun_chars(info); + anakin_overrun_chars(info->port); if (txenable[info->port->irq] && (status & TX)) anakin_tx_chars(info); Index: serial_clps711x.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_clps711x.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serial_clps711x.c 2001/12/13 04:46:52 1.10 +++ serial_clps711x.c 2001/12/25 04:29:59 1.11 @@ -224,29 +224,29 @@ port->x_char = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { - clps711xuart_stop_tx(info->port, 0); + clps711xuart_stop_tx(port, 0); return; } count = port->fifosize >> 1; do { - clps_writel(info->xmit.buf[info->xmit.tail], UARTDR(port)); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + clps_writel(port->xmit.buf[port->xmit.tail], UARTDR(port)); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0); - if (CIRC_CNT(info->xmit.head, - info->xmit.tail, + if (CIRC_CNT(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) - clps711xuart_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + clps711xuart_stop_tx(port, 0); } static u_int clps711xuart_tx_empty(struct uart_port *port) Index: serial_core.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_core.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- serial_core.c 2001/12/13 04:46:52 1.17 +++ serial_core.c 2001/12/25 04:29:59 1.18 @@ -100,16 +100,18 @@ unsigned long flags; spin_lock_irqsave(&info->lock, flags); - info->ops->stop_tx(info->port, 1); + info->port->ops->stop_tx(info->port, 1); spin_unlock_irqrestore(&info->lock, flags); } static void __uart_start(struct tty_struct *tty) { struct uart_info *info = tty->driver_data; - if (info->xmit.head != info->xmit.tail && info->xmit.buf && + struct uart_port *port = info->port; + + if (port->xmit.head != port->xmit.tail && port->xmit.buf && !tty->stopped && !tty->hw_stopped) - info->ops->start_tx(info->port, 1, 1); + info->port->ops->start_tx(port, 1, 1); } static void uart_start(struct tty_struct *tty) @@ -175,14 +177,14 @@ goto errout; } - if (info->xmit.buf) + if (info->port->xmit.buf) free_page(page); else - info->xmit.buf = (unsigned char *) page; + info->port->xmit.buf = (unsigned char *) page; info->mctrl = 0; - retval = info->ops->startup(info->port, info); + retval = info->port->ops->startup(info->port, info); if (retval) { if (capable(CAP_SYS_ADMIN)) { if (info->tty) @@ -194,7 +196,7 @@ if (info->tty) clear_bit(TTY_IO_ERROR, &info->tty->flags); - info->xmit.head = info->xmit.tail = 0; + info->port->xmit.head = info->port->xmit.tail = 0; /* * Set up the tty->alt_speed kludge @@ -213,7 +215,7 @@ */ if (info->tty->termios->c_cflag & CBAUD) info->mctrl = TIOCM_RTS | TIOCM_DTR; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); info->flags |= ASYNC_INITIALIZED; retval = 0; @@ -245,17 +247,17 @@ /* * Free the IRQ and disable the port */ - info->ops->shutdown(info->port, info); + info->port->ops->shutdown(info->port, info); - if (info->xmit.buf) { - unsigned long pg = (unsigned long) info->xmit.buf; - info->xmit.buf = NULL; + if (info->port->xmit.buf) { + unsigned long pg = (unsigned long) info->port->xmit.buf; + info->port->xmit.buf = NULL; free_page(pg); } if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) info->mctrl &= ~(TIOCM_DTR|TIOCM_RTS); - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); /* kill off our tasklet */ tasklet_kill(&info->tlet); @@ -358,21 +360,22 @@ pm_access(info->state->pm); - info->ops->change_speed(port, cflag, info->tty->termios->c_iflag, quot); + info->port->ops->change_speed(port, cflag, info->tty->termios->c_iflag, quot); } static void uart_put_char(struct tty_struct *tty, u_char ch) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; unsigned long flags; - if (!tty || !info->xmit.buf) + if (!tty || !port->xmit.buf) return; spin_lock_irqsave(&info->lock, flags); - if (CIRC_SPACE(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) != 0) { - info->xmit.buf[info->xmit.head] = ch; - info->xmit.head = (info->xmit.head + 1) & (UART_XMIT_SIZE - 1); + if (CIRC_SPACE(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) != 0) { + port->xmit.buf[port->xmit.head] = ch; + port->xmit.head = (port->xmit.head + 1) & (UART_XMIT_SIZE - 1); } spin_unlock_irqrestore(&info->lock, flags); } @@ -386,18 +389,19 @@ const u_char * buf, int count) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; unsigned long flags; int c, ret = 0; - if (!tty || !info->xmit.buf || !tmp_buf) + if (!tty || !port->xmit.buf || !tmp_buf) return 0; if (from_user) { down(&tmp_buf_sem); while (1) { int c1; - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, + c = CIRC_SPACE_TO_END(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE); if (count < c) c = count; @@ -411,13 +415,13 @@ break; } spin_lock_irqsave(&info->lock, flags); - c1 = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, + c1 = CIRC_SPACE_TO_END(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE); if (c1 < c) c = c1; - memcpy(info->xmit.buf + info->xmit.head, tmp_buf, c); - info->xmit.head = (info->xmit.head + c) & + memcpy(port->xmit.buf + port->xmit.head, tmp_buf, c); + port->xmit.head = (port->xmit.head + c) & (UART_XMIT_SIZE - 1); spin_unlock_irqrestore(&info->lock, flags); buf += c; @@ -428,15 +432,15 @@ } else { spin_lock_irqsave(&info->lock, flags); while (1) { - c = CIRC_SPACE_TO_END(info->xmit.head, - info->xmit.tail, + c = CIRC_SPACE_TO_END(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE); if (count < c) c = count; if (c <= 0) break; - memcpy(info->xmit.buf + info->xmit.head, buf, c); - info->xmit.head = (info->xmit.head + c) & + memcpy(port->xmit.buf + port->xmit.head, buf, c); + port->xmit.head = (port->xmit.head + c) & (UART_XMIT_SIZE - 1); buf += c; count -= c; @@ -452,20 +456,23 @@ static int uart_write_room(struct tty_struct *tty) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; - return CIRC_SPACE(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE); + return CIRC_SPACE(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE); } static int uart_chars_in_buffer(struct tty_struct *tty) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; - return CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE); + return CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE); } static void uart_flush_buffer(struct tty_struct *tty) { struct uart_info *info = tty->driver_data; + struct uart_port *port = info->port; unsigned long flags; #ifdef DEBUG @@ -473,7 +480,7 @@ MINOR(tty->device) - tty->driver.minor_start); #endif spin_lock_irqsave(&info->lock, flags); - info->xmit.head = info->xmit.tail = 0; + port->xmit.head = port->xmit.tail = 0; spin_unlock_irqrestore(&info->lock, flags); wake_up_interruptible(&tty->write_wait); if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && @@ -491,7 +498,7 @@ info->port->x_char = ch; if (ch) - info->ops->start_tx(info->port, 1, 0); + info->port->ops->start_tx(info->port, 1, 0); } static void uart_throttle(struct tty_struct *tty) @@ -505,7 +512,7 @@ if (tty->termios->c_cflag & CRTSCTS) { spin_lock_irqsave(&info->lock, flags); info->mctrl &= ~TIOCM_RTS; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); spin_unlock_irqrestore(&info->lock, flags); } } @@ -525,7 +532,7 @@ if (tty->termios->c_cflag & CRTSCTS) { spin_lock_irqsave(&info->lock, flags); info->mctrl |= TIOCM_RTS; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); spin_unlock_irqrestore(&info->lock, flags); } } @@ -749,7 +756,7 @@ unsigned long flags; spin_lock_irqsave(&info->lock, flags); - result = info->ops->tx_empty(info->port); + result = info->port->ops->tx_empty(info->port); spin_unlock_irqrestore(&info->lock, flags); /* @@ -759,7 +766,7 @@ * interrupt happens). */ if (info->port->x_char || - ((CIRC_CNT(info->xmit.head, info->xmit.tail, + ((CIRC_CNT(info->port->xmit.head, info->port->xmit.tail, UART_XMIT_SIZE) > 0) && !info->tty->stopped && !info->tty->hw_stopped)) result &= ~TIOCSER_TEMT; @@ -771,7 +778,7 @@ { unsigned int result = info->mctrl; - result |= info->ops->get_mctrl(info->port); + result |= info->port->ops->get_mctrl(info->port); return put_user(result, value); } @@ -794,7 +801,7 @@ default: ret = -EINVAL; break; } if (old != info->mctrl) - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); spin_unlock_irq(&info->lock); return ret; } @@ -806,7 +813,7 @@ if (info->port->type != PORT_UNKNOWN) { spin_lock_irqsave(&info->lock, flags); - info->ops->break_ctl(info->port, break_state); + info->port->ops->break_ctl(info->port, break_state); spin_unlock_irqrestore(&info->lock, flags); } } @@ -910,7 +917,7 @@ /* note the counters on entry */ cprev = info->port->icount; /* Force modem status interrupts on */ - info->ops->enable_ms(info->port); + info->port->ops->enable_ms(info->port); spin_unlock_irq(&info->lock); while (1) { interruptible_sleep_on(&info->delta_msr_wait); @@ -971,8 +978,8 @@ break; default: - if (info->ops->ioctl) - ret = info->ops->ioctl(info->port, cmd, arg); + if (info->port->ops->ioctl) + ret = info->port->ops->ioctl(info->port, cmd, arg); break; } return ret; @@ -995,7 +1002,7 @@ /* Handle transition to B0 status */ if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) { info->mctrl &= ~(TIOCM_RTS | TIOCM_DTR); - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); } /* Handle transition away from B0 status */ @@ -1004,7 +1011,7 @@ if (!(cflag & CRTSCTS) || !test_bit(TTY_THROTTLED, &tty->flags)) info->mctrl |= TIOCM_RTS; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); } /* Handle turning off CRTSCTS */ @@ -1103,7 +1110,7 @@ * disable the receive line status interrupts. */ if (info->flags & ASYNC_INITIALIZED) { - info->ops->stop_rx(info->port); + info->port->ops->stop_rx(info->port); /* * Before we drop DTR, make sure the UART transmitter * has completely drained; this is especially @@ -1133,8 +1140,8 @@ */ pm_send(info->state->pm, PM_SUSPEND, (void *)3); #else - if (info->ops->pm) - info->ops->pm(info->port, 3, 0); + if (info->port->ops->pm) + info->port->ops->pm(info->port, 3, 0); #endif } @@ -1188,7 +1195,7 @@ MINOR(tty->device) - tty->driver.minor_start, jiffies, expire); #endif - while (!info->ops->tx_empty(info->port)) { + while (!info->port->ops->tx_empty(info->port)) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(char_time); if (signal_pending(current)) @@ -1302,7 +1309,7 @@ if (!(info->flags & ASYNC_CALLOUT_ACTIVE) && (tty->termios->c_cflag & CBAUD)) { info->mctrl = TIOCM_DTR | TIOCM_RTS; - info->ops->set_mctrl(info->port, info->mctrl); + info->port->ops->set_mctrl(info->port, info->mctrl); } spin_unlock_irqrestore(&info->lock, flags); set_current_state(TASK_INTERRUPTIBLE); @@ -1317,7 +1324,7 @@ if (!(info->flags & ASYNC_CALLOUT_ACTIVE) && !(info->flags & ASYNC_CLOSING) && (do_clocal || - (info->ops->get_mctrl(info->port) & TIOCM_CAR))) + (info->port->ops->get_mctrl(info->port) & TIOCM_CAR))) break; if (signal_pending(current)) { retval = -ERESTARTSYS; @@ -1356,7 +1363,6 @@ init_waitqueue_head(&info->delta_msr_wait); info->port = state->port; info->flags = info->port->flags; - info->ops = info->port->ops; info->state = state; tasklet_init(&info->tlet, uart_tasklet_action, (unsigned long)info); @@ -1448,8 +1454,8 @@ #ifdef CONFIG_PM pm_send(info->state->pm, PM_RESUME, (void *)0); #else - if (info->ops->pm) - info->ops->pm(info->port, 0, 3); + if (info->port->ops->pm) + info->port->ops->pm(info->port, 0, 3); #endif /* @@ -1847,7 +1853,7 @@ printk("I/O 0x%x offset 0x%x", port->iobase, port->hub6); break; case SERIAL_IO_MEM: - printk("MEM 0x%x", port->mapbase); + printk("MEM 0x%lx", port->mapbase); break; } printk(" (irq = %d) is a %s\n", port->irq, uart_type(port)); Index: serial_sa1100.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_sa1100.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- serial_sa1100.c 2001/12/13 04:46:52 1.15 +++ serial_sa1100.c 2001/12/25 04:29:59 1.16 @@ -237,10 +237,10 @@ port->x_char = 0; return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { - sa1100_stop_tx(info->port, 0); + sa1100_stop_tx(port, 0); return; } @@ -249,19 +249,19 @@ * still had the '4 bytes repeated' problem. */ while (UART_GET_UTSR1(port) & UTSR1_TNF) { - UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + UART_PUT_CHAR(port, port->xmit.buf[port->xmit.tail]); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } - if (CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE) < + if (CIRC_CNT(port->xmit.head, port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) - sa1100_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + sa1100_stop_tx(port, 0); } static void sa1100_int(int irq, void *dev_id, struct pt_regs *regs) Index: serial_uart00.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/serial/serial_uart00.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serial_uart00.c 2001/12/13 04:46:52 1.3 +++ serial_uart00.c 2001/12/25 04:29:59 1.4 @@ -243,30 +243,30 @@ return; } - if (info->xmit.head == info->xmit.tail + if (port->xmit.head == port->xmit.tail || info->tty->stopped || info->tty->hw_stopped) { - uart00_stop_tx(info->port, 0); + uart00_stop_tx(port, 0); return; } count = port->fifosize >> 1; do { while((UART_GET_TSR(port)& UART_TSR_TX_LEVEL_MSK)==15); - UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]); - info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1); + UART_PUT_CHAR(port, port->xmit.buf[port->xmit.tail]); + port->xmit.tail = (port->xmit.tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; - if (info->xmit.head == info->xmit.tail) + if (port->xmit.head == port->xmit.tail) break; } while (--count > 0); - if (CIRC_CNT(info->xmit.head, - info->xmit.tail, + if (CIRC_CNT(port->xmit.head, + port->xmit.tail, UART_XMIT_SIZE) < WAKEUP_CHARS) uart_event(info, EVT_WRITE_WAKEUP); - if (info->xmit.head == info->xmit.tail) - uart00_stop_tx(info->port, 0); + if (port->xmit.head == port->xmit.tail) + uart00_stop_tx(port, 0); } static void uart00_start_tx(struct uart_port *port, u_int nonempty, u_int from_tty) @@ -322,13 +322,13 @@ if (info->tty->hw_stopped) { if (status) { info->tty->hw_stopped = 0; - info->ops->start_tx(info->port, 1, 0); + info->port->ops->start_tx(info->port, 1, 0); uart_event(info, EVT_WRITE_WAKEUP); } } else { if (!status) { info->tty->hw_stopped = 1; - info->ops->stop_tx(info->port, 0); + info->port->ops->stop_tx(info->port, 0); } } } |