diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-24 16:22:33 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-24 16:22:33 -0400 |
commit | baea7b946f00a291b166ccae7fcfed6c01530cc6 (patch) | |
tree | 4aa275fbdbec9c7b9b4629e8bee2bbecd3c6a6af /drivers/serial | |
parent | ae19ffbadc1b2100285a5b5b3d0a4e0a11390904 (diff) | |
parent | 94e0fb086fc5663c38bbc0fe86d698be8314f82f (diff) |
Merge branch 'origin' into for-linus
Conflicts:
MAINTAINERS
Diffstat (limited to 'drivers/serial')
51 files changed, 757 insertions, 702 deletions
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index cb6d85d7ff43..1e3d19397a59 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c | |||
@@ -86,7 +86,7 @@ static void serial21285_enable_ms(struct uart_port *port) | |||
86 | static irqreturn_t serial21285_rx_chars(int irq, void *dev_id) | 86 | static irqreturn_t serial21285_rx_chars(int irq, void *dev_id) |
87 | { | 87 | { |
88 | struct uart_port *port = dev_id; | 88 | struct uart_port *port = dev_id; |
89 | struct tty_struct *tty = port->info->port.tty; | 89 | struct tty_struct *tty = port->state->port.tty; |
90 | unsigned int status, ch, flag, rxs, max_count = 256; | 90 | unsigned int status, ch, flag, rxs, max_count = 256; |
91 | 91 | ||
92 | status = *CSR_UARTFLG; | 92 | status = *CSR_UARTFLG; |
@@ -124,7 +124,7 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id) | |||
124 | static irqreturn_t serial21285_tx_chars(int irq, void *dev_id) | 124 | static irqreturn_t serial21285_tx_chars(int irq, void *dev_id) |
125 | { | 125 | { |
126 | struct uart_port *port = dev_id; | 126 | struct uart_port *port = dev_id; |
127 | struct circ_buf *xmit = &port->info->xmit; | 127 | struct circ_buf *xmit = &port->state->xmit; |
128 | int count = 256; | 128 | int count = 256; |
129 | 129 | ||
130 | if (port->x_char) { | 130 | if (port->x_char) { |
@@ -235,8 +235,8 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios, | |||
235 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); | 235 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); |
236 | quot = uart_get_divisor(port, baud); | 236 | quot = uart_get_divisor(port, baud); |
237 | 237 | ||
238 | if (port->info && port->info->port.tty) { | 238 | if (port->state && port->state->port.tty) { |
239 | struct tty_struct *tty = port->info->port.tty; | 239 | struct tty_struct *tty = port->state->port.tty; |
240 | unsigned int b = port->uartclk / (16 * quot); | 240 | unsigned int b = port->uartclk / (16 * quot); |
241 | tty_encode_baud_rate(tty, b, b); | 241 | tty_encode_baud_rate(tty, b, b); |
242 | } | 242 | } |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index fb867a9f55e9..2209620d2349 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -1382,7 +1382,7 @@ static void serial8250_enable_ms(struct uart_port *port) | |||
1382 | static void | 1382 | static void |
1383 | receive_chars(struct uart_8250_port *up, unsigned int *status) | 1383 | receive_chars(struct uart_8250_port *up, unsigned int *status) |
1384 | { | 1384 | { |
1385 | struct tty_struct *tty = up->port.info->port.tty; | 1385 | struct tty_struct *tty = up->port.state->port.tty; |
1386 | unsigned char ch, lsr = *status; | 1386 | unsigned char ch, lsr = *status; |
1387 | int max_count = 256; | 1387 | int max_count = 256; |
1388 | char flag; | 1388 | char flag; |
@@ -1457,7 +1457,7 @@ ignore_char: | |||
1457 | 1457 | ||
1458 | static void transmit_chars(struct uart_8250_port *up) | 1458 | static void transmit_chars(struct uart_8250_port *up) |
1459 | { | 1459 | { |
1460 | struct circ_buf *xmit = &up->port.info->xmit; | 1460 | struct circ_buf *xmit = &up->port.state->xmit; |
1461 | int count; | 1461 | int count; |
1462 | 1462 | ||
1463 | if (up->port.x_char) { | 1463 | if (up->port.x_char) { |
@@ -1500,7 +1500,7 @@ static unsigned int check_modem_status(struct uart_8250_port *up) | |||
1500 | status |= up->msr_saved_flags; | 1500 | status |= up->msr_saved_flags; |
1501 | up->msr_saved_flags = 0; | 1501 | up->msr_saved_flags = 0; |
1502 | if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI && | 1502 | if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI && |
1503 | up->port.info != NULL) { | 1503 | up->port.state != NULL) { |
1504 | if (status & UART_MSR_TERI) | 1504 | if (status & UART_MSR_TERI) |
1505 | up->port.icount.rng++; | 1505 | up->port.icount.rng++; |
1506 | if (status & UART_MSR_DDSR) | 1506 | if (status & UART_MSR_DDSR) |
@@ -1510,7 +1510,7 @@ static unsigned int check_modem_status(struct uart_8250_port *up) | |||
1510 | if (status & UART_MSR_DCTS) | 1510 | if (status & UART_MSR_DCTS) |
1511 | uart_handle_cts_change(&up->port, status & UART_MSR_CTS); | 1511 | uart_handle_cts_change(&up->port, status & UART_MSR_CTS); |
1512 | 1512 | ||
1513 | wake_up_interruptible(&up->port.info->delta_msr_wait); | 1513 | wake_up_interruptible(&up->port.state->port.delta_msr_wait); |
1514 | } | 1514 | } |
1515 | 1515 | ||
1516 | return status; | 1516 | return status; |
@@ -1677,7 +1677,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up) | |||
1677 | INIT_LIST_HEAD(&up->list); | 1677 | INIT_LIST_HEAD(&up->list); |
1678 | i->head = &up->list; | 1678 | i->head = &up->list; |
1679 | spin_unlock_irq(&i->lock); | 1679 | spin_unlock_irq(&i->lock); |
1680 | 1680 | irq_flags |= up->port.irqflags; | |
1681 | ret = request_irq(up->port.irq, serial8250_interrupt, | 1681 | ret = request_irq(up->port.irq, serial8250_interrupt, |
1682 | irq_flags, "serial", i); | 1682 | irq_flags, "serial", i); |
1683 | if (ret < 0) | 1683 | if (ret < 0) |
@@ -1764,7 +1764,7 @@ static void serial8250_backup_timeout(unsigned long data) | |||
1764 | up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; | 1764 | up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; |
1765 | spin_unlock_irqrestore(&up->port.lock, flags); | 1765 | spin_unlock_irqrestore(&up->port.lock, flags); |
1766 | if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) && | 1766 | if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) && |
1767 | (!uart_circ_empty(&up->port.info->xmit) || up->port.x_char) && | 1767 | (!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) && |
1768 | (lsr & UART_LSR_THRE)) { | 1768 | (lsr & UART_LSR_THRE)) { |
1769 | iir &= ~(UART_IIR_ID | UART_IIR_NO_INT); | 1769 | iir &= ~(UART_IIR_ID | UART_IIR_NO_INT); |
1770 | iir |= UART_IIR_THRI; | 1770 | iir |= UART_IIR_THRI; |
@@ -2026,7 +2026,7 @@ static int serial8250_startup(struct uart_port *port) | |||
2026 | * allow register changes to become visible. | 2026 | * allow register changes to become visible. |
2027 | */ | 2027 | */ |
2028 | spin_lock_irqsave(&up->port.lock, flags); | 2028 | spin_lock_irqsave(&up->port.lock, flags); |
2029 | if (up->port.flags & UPF_SHARE_IRQ) | 2029 | if (up->port.irqflags & IRQF_SHARED) |
2030 | disable_irq_nosync(up->port.irq); | 2030 | disable_irq_nosync(up->port.irq); |
2031 | 2031 | ||
2032 | wait_for_xmitr(up, UART_LSR_THRE); | 2032 | wait_for_xmitr(up, UART_LSR_THRE); |
@@ -2039,7 +2039,7 @@ static int serial8250_startup(struct uart_port *port) | |||
2039 | iir = serial_in(up, UART_IIR); | 2039 | iir = serial_in(up, UART_IIR); |
2040 | serial_out(up, UART_IER, 0); | 2040 | serial_out(up, UART_IER, 0); |
2041 | 2041 | ||
2042 | if (up->port.flags & UPF_SHARE_IRQ) | 2042 | if (up->port.irqflags & IRQF_SHARED) |
2043 | enable_irq(up->port.irq); | 2043 | enable_irq(up->port.irq); |
2044 | spin_unlock_irqrestore(&up->port.lock, flags); | 2044 | spin_unlock_irqrestore(&up->port.lock, flags); |
2045 | 2045 | ||
@@ -2272,7 +2272,9 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, | |||
2272 | /* | 2272 | /* |
2273 | * Ask the core to calculate the divisor for us. | 2273 | * Ask the core to calculate the divisor for us. |
2274 | */ | 2274 | */ |
2275 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); | 2275 | baud = uart_get_baud_rate(port, termios, old, |
2276 | port->uartclk / 16 / 0xffff, | ||
2277 | port->uartclk / 16); | ||
2276 | quot = serial8250_get_divisor(port, baud); | 2278 | quot = serial8250_get_divisor(port, baud); |
2277 | 2279 | ||
2278 | /* | 2280 | /* |
@@ -2671,6 +2673,7 @@ static void __init serial8250_isa_init_ports(void) | |||
2671 | i++, up++) { | 2673 | i++, up++) { |
2672 | up->port.iobase = old_serial_port[i].port; | 2674 | up->port.iobase = old_serial_port[i].port; |
2673 | up->port.irq = irq_canonicalize(old_serial_port[i].irq); | 2675 | up->port.irq = irq_canonicalize(old_serial_port[i].irq); |
2676 | up->port.irqflags = old_serial_port[i].irqflags; | ||
2674 | up->port.uartclk = old_serial_port[i].baud_base * 16; | 2677 | up->port.uartclk = old_serial_port[i].baud_base * 16; |
2675 | up->port.flags = old_serial_port[i].flags; | 2678 | up->port.flags = old_serial_port[i].flags; |
2676 | up->port.hub6 = old_serial_port[i].hub6; | 2679 | up->port.hub6 = old_serial_port[i].hub6; |
@@ -2679,7 +2682,7 @@ static void __init serial8250_isa_init_ports(void) | |||
2679 | up->port.regshift = old_serial_port[i].iomem_reg_shift; | 2682 | up->port.regshift = old_serial_port[i].iomem_reg_shift; |
2680 | set_io_from_upio(&up->port); | 2683 | set_io_from_upio(&up->port); |
2681 | if (share_irqs) | 2684 | if (share_irqs) |
2682 | up->port.flags |= UPF_SHARE_IRQ; | 2685 | up->port.irqflags |= IRQF_SHARED; |
2683 | } | 2686 | } |
2684 | } | 2687 | } |
2685 | 2688 | ||
@@ -2869,6 +2872,7 @@ int __init early_serial_setup(struct uart_port *port) | |||
2869 | p->iobase = port->iobase; | 2872 | p->iobase = port->iobase; |
2870 | p->membase = port->membase; | 2873 | p->membase = port->membase; |
2871 | p->irq = port->irq; | 2874 | p->irq = port->irq; |
2875 | p->irqflags = port->irqflags; | ||
2872 | p->uartclk = port->uartclk; | 2876 | p->uartclk = port->uartclk; |
2873 | p->fifosize = port->fifosize; | 2877 | p->fifosize = port->fifosize; |
2874 | p->regshift = port->regshift; | 2878 | p->regshift = port->regshift; |
@@ -2942,6 +2946,7 @@ static int __devinit serial8250_probe(struct platform_device *dev) | |||
2942 | port.iobase = p->iobase; | 2946 | port.iobase = p->iobase; |
2943 | port.membase = p->membase; | 2947 | port.membase = p->membase; |
2944 | port.irq = p->irq; | 2948 | port.irq = p->irq; |
2949 | port.irqflags = p->irqflags; | ||
2945 | port.uartclk = p->uartclk; | 2950 | port.uartclk = p->uartclk; |
2946 | port.regshift = p->regshift; | 2951 | port.regshift = p->regshift; |
2947 | port.iotype = p->iotype; | 2952 | port.iotype = p->iotype; |
@@ -2954,7 +2959,7 @@ static int __devinit serial8250_probe(struct platform_device *dev) | |||
2954 | port.serial_out = p->serial_out; | 2959 | port.serial_out = p->serial_out; |
2955 | port.dev = &dev->dev; | 2960 | port.dev = &dev->dev; |
2956 | if (share_irqs) | 2961 | if (share_irqs) |
2957 | port.flags |= UPF_SHARE_IRQ; | 2962 | port.irqflags |= IRQF_SHARED; |
2958 | ret = serial8250_register_port(&port); | 2963 | ret = serial8250_register_port(&port); |
2959 | if (ret < 0) { | 2964 | if (ret < 0) { |
2960 | dev_err(&dev->dev, "unable to register port at index %d " | 2965 | dev_err(&dev->dev, "unable to register port at index %d " |
@@ -3096,6 +3101,7 @@ int serial8250_register_port(struct uart_port *port) | |||
3096 | uart->port.iobase = port->iobase; | 3101 | uart->port.iobase = port->iobase; |
3097 | uart->port.membase = port->membase; | 3102 | uart->port.membase = port->membase; |
3098 | uart->port.irq = port->irq; | 3103 | uart->port.irq = port->irq; |
3104 | uart->port.irqflags = port->irqflags; | ||
3099 | uart->port.uartclk = port->uartclk; | 3105 | uart->port.uartclk = port->uartclk; |
3100 | uart->port.fifosize = port->fifosize; | 3106 | uart->port.fifosize = port->fifosize; |
3101 | uart->port.regshift = port->regshift; | 3107 | uart->port.regshift = port->regshift; |
diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h index 520260326f3d..6e19ea3e48d5 100644 --- a/drivers/serial/8250.h +++ b/drivers/serial/8250.h | |||
@@ -25,6 +25,7 @@ struct old_serial_port { | |||
25 | unsigned char io_type; | 25 | unsigned char io_type; |
26 | unsigned char *iomem_base; | 26 | unsigned char *iomem_base; |
27 | unsigned short iomem_reg_shift; | 27 | unsigned short iomem_reg_shift; |
28 | unsigned long irqflags; | ||
28 | }; | 29 | }; |
29 | 30 | ||
30 | /* | 31 | /* |
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 58a4879c7e48..429a8ae86933 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c | |||
@@ -117,7 +117,7 @@ static void pl010_enable_ms(struct uart_port *port) | |||
117 | 117 | ||
118 | static void pl010_rx_chars(struct uart_amba_port *uap) | 118 | static void pl010_rx_chars(struct uart_amba_port *uap) |
119 | { | 119 | { |
120 | struct tty_struct *tty = uap->port.info->port.tty; | 120 | struct tty_struct *tty = uap->port.state->port.tty; |
121 | unsigned int status, ch, flag, rsr, max_count = 256; | 121 | unsigned int status, ch, flag, rsr, max_count = 256; |
122 | 122 | ||
123 | status = readb(uap->port.membase + UART01x_FR); | 123 | status = readb(uap->port.membase + UART01x_FR); |
@@ -172,7 +172,7 @@ static void pl010_rx_chars(struct uart_amba_port *uap) | |||
172 | 172 | ||
173 | static void pl010_tx_chars(struct uart_amba_port *uap) | 173 | static void pl010_tx_chars(struct uart_amba_port *uap) |
174 | { | 174 | { |
175 | struct circ_buf *xmit = &uap->port.info->xmit; | 175 | struct circ_buf *xmit = &uap->port.state->xmit; |
176 | int count; | 176 | int count; |
177 | 177 | ||
178 | if (uap->port.x_char) { | 178 | if (uap->port.x_char) { |
@@ -225,7 +225,7 @@ static void pl010_modem_status(struct uart_amba_port *uap) | |||
225 | if (delta & UART01x_FR_CTS) | 225 | if (delta & UART01x_FR_CTS) |
226 | uart_handle_cts_change(&uap->port, status & UART01x_FR_CTS); | 226 | uart_handle_cts_change(&uap->port, status & UART01x_FR_CTS); |
227 | 227 | ||
228 | wake_up_interruptible(&uap->port.info->delta_msr_wait); | 228 | wake_up_interruptible(&uap->port.state->port.delta_msr_wait); |
229 | } | 229 | } |
230 | 230 | ||
231 | static irqreturn_t pl010_int(int irq, void *dev_id) | 231 | static irqreturn_t pl010_int(int irq, void *dev_id) |
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 72ba0c6d3551..ef7adc8135dd 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c | |||
@@ -124,7 +124,7 @@ static void pl011_enable_ms(struct uart_port *port) | |||
124 | 124 | ||
125 | static void pl011_rx_chars(struct uart_amba_port *uap) | 125 | static void pl011_rx_chars(struct uart_amba_port *uap) |
126 | { | 126 | { |
127 | struct tty_struct *tty = uap->port.info->port.tty; | 127 | struct tty_struct *tty = uap->port.state->port.tty; |
128 | unsigned int status, ch, flag, max_count = 256; | 128 | unsigned int status, ch, flag, max_count = 256; |
129 | 129 | ||
130 | status = readw(uap->port.membase + UART01x_FR); | 130 | status = readw(uap->port.membase + UART01x_FR); |
@@ -175,7 +175,7 @@ static void pl011_rx_chars(struct uart_amba_port *uap) | |||
175 | 175 | ||
176 | static void pl011_tx_chars(struct uart_amba_port *uap) | 176 | static void pl011_tx_chars(struct uart_amba_port *uap) |
177 | { | 177 | { |
178 | struct circ_buf *xmit = &uap->port.info->xmit; | 178 | struct circ_buf *xmit = &uap->port.state->xmit; |
179 | int count; | 179 | int count; |
180 | 180 | ||
181 | if (uap->port.x_char) { | 181 | if (uap->port.x_char) { |
@@ -226,7 +226,7 @@ static void pl011_modem_status(struct uart_amba_port *uap) | |||
226 | if (delta & UART01x_FR_CTS) | 226 | if (delta & UART01x_FR_CTS) |
227 | uart_handle_cts_change(&uap->port, status & UART01x_FR_CTS); | 227 | uart_handle_cts_change(&uap->port, status & UART01x_FR_CTS); |
228 | 228 | ||
229 | wake_up_interruptible(&uap->port.info->delta_msr_wait); | 229 | wake_up_interruptible(&uap->port.state->port.delta_msr_wait); |
230 | } | 230 | } |
231 | 231 | ||
232 | static irqreturn_t pl011_int(int irq, void *dev_id) | 232 | static irqreturn_t pl011_int(int irq, void *dev_id) |
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 607d43a31048..3551c5cb7094 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -427,7 +427,7 @@ static void atmel_rx_chars(struct uart_port *port) | |||
427 | */ | 427 | */ |
428 | static void atmel_tx_chars(struct uart_port *port) | 428 | static void atmel_tx_chars(struct uart_port *port) |
429 | { | 429 | { |
430 | struct circ_buf *xmit = &port->info->xmit; | 430 | struct circ_buf *xmit = &port->state->xmit; |
431 | 431 | ||
432 | if (port->x_char && UART_GET_CSR(port) & ATMEL_US_TXRDY) { | 432 | if (port->x_char && UART_GET_CSR(port) & ATMEL_US_TXRDY) { |
433 | UART_PUT_CHAR(port, port->x_char); | 433 | UART_PUT_CHAR(port, port->x_char); |
@@ -560,7 +560,7 @@ static irqreturn_t atmel_interrupt(int irq, void *dev_id) | |||
560 | static void atmel_tx_dma(struct uart_port *port) | 560 | static void atmel_tx_dma(struct uart_port *port) |
561 | { | 561 | { |
562 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | 562 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); |
563 | struct circ_buf *xmit = &port->info->xmit; | 563 | struct circ_buf *xmit = &port->state->xmit; |
564 | struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx; | 564 | struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx; |
565 | int count; | 565 | int count; |
566 | 566 | ||
@@ -663,14 +663,14 @@ static void atmel_rx_from_ring(struct uart_port *port) | |||
663 | * uart_start(), which takes the lock. | 663 | * uart_start(), which takes the lock. |
664 | */ | 664 | */ |
665 | spin_unlock(&port->lock); | 665 | spin_unlock(&port->lock); |
666 | tty_flip_buffer_push(port->info->port.tty); | 666 | tty_flip_buffer_push(port->state->port.tty); |
667 | spin_lock(&port->lock); | 667 | spin_lock(&port->lock); |
668 | } | 668 | } |
669 | 669 | ||
670 | static void atmel_rx_from_dma(struct uart_port *port) | 670 | static void atmel_rx_from_dma(struct uart_port *port) |
671 | { | 671 | { |
672 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | 672 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); |
673 | struct tty_struct *tty = port->info->port.tty; | 673 | struct tty_struct *tty = port->state->port.tty; |
674 | struct atmel_dma_buffer *pdc; | 674 | struct atmel_dma_buffer *pdc; |
675 | int rx_idx = atmel_port->pdc_rx_idx; | 675 | int rx_idx = atmel_port->pdc_rx_idx; |
676 | unsigned int head; | 676 | unsigned int head; |
@@ -776,7 +776,7 @@ static void atmel_tasklet_func(unsigned long data) | |||
776 | if (status_change & ATMEL_US_CTS) | 776 | if (status_change & ATMEL_US_CTS) |
777 | uart_handle_cts_change(port, !(status & ATMEL_US_CTS)); | 777 | uart_handle_cts_change(port, !(status & ATMEL_US_CTS)); |
778 | 778 | ||
779 | wake_up_interruptible(&port->info->delta_msr_wait); | 779 | wake_up_interruptible(&port->state->port.delta_msr_wait); |
780 | 780 | ||
781 | atmel_port->irq_status_prev = status; | 781 | atmel_port->irq_status_prev = status; |
782 | } | 782 | } |
@@ -795,7 +795,7 @@ static void atmel_tasklet_func(unsigned long data) | |||
795 | static int atmel_startup(struct uart_port *port) | 795 | static int atmel_startup(struct uart_port *port) |
796 | { | 796 | { |
797 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); | 797 | struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); |
798 | struct tty_struct *tty = port->info->port.tty; | 798 | struct tty_struct *tty = port->state->port.tty; |
799 | int retval; | 799 | int retval; |
800 | 800 | ||
801 | /* | 801 | /* |
@@ -854,7 +854,7 @@ static int atmel_startup(struct uart_port *port) | |||
854 | } | 854 | } |
855 | if (atmel_use_dma_tx(port)) { | 855 | if (atmel_use_dma_tx(port)) { |
856 | struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx; | 856 | struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx; |
857 | struct circ_buf *xmit = &port->info->xmit; | 857 | struct circ_buf *xmit = &port->state->xmit; |
858 | 858 | ||
859 | pdc->buf = xmit->buf; | 859 | pdc->buf = xmit->buf; |
860 | pdc->dma_addr = dma_map_single(port->dev, | 860 | pdc->dma_addr = dma_map_single(port->dev, |
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index b4a7650af696..50abb7e557f4 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -42,6 +42,10 @@ | |||
42 | # undef CONFIG_EARLY_PRINTK | 42 | # undef CONFIG_EARLY_PRINTK |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | #ifdef CONFIG_SERIAL_BFIN_MODULE | ||
46 | # undef CONFIG_EARLY_PRINTK | ||
47 | #endif | ||
48 | |||
45 | /* UART name and device definitions */ | 49 | /* UART name and device definitions */ |
46 | #define BFIN_SERIAL_NAME "ttyBF" | 50 | #define BFIN_SERIAL_NAME "ttyBF" |
47 | #define BFIN_SERIAL_MAJOR 204 | 51 | #define BFIN_SERIAL_MAJOR 204 |
@@ -140,7 +144,7 @@ static void bfin_serial_stop_tx(struct uart_port *port) | |||
140 | { | 144 | { |
141 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; | 145 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; |
142 | #ifdef CONFIG_SERIAL_BFIN_DMA | 146 | #ifdef CONFIG_SERIAL_BFIN_DMA |
143 | struct circ_buf *xmit = &uart->port.info->xmit; | 147 | struct circ_buf *xmit = &uart->port.state->xmit; |
144 | #endif | 148 | #endif |
145 | 149 | ||
146 | while (!(UART_GET_LSR(uart) & TEMT)) | 150 | while (!(UART_GET_LSR(uart) & TEMT)) |
@@ -167,7 +171,7 @@ static void bfin_serial_stop_tx(struct uart_port *port) | |||
167 | static void bfin_serial_start_tx(struct uart_port *port) | 171 | static void bfin_serial_start_tx(struct uart_port *port) |
168 | { | 172 | { |
169 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; | 173 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; |
170 | struct tty_struct *tty = uart->port.info->port.tty; | 174 | struct tty_struct *tty = uart->port.state->port.tty; |
171 | 175 | ||
172 | #ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS | 176 | #ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS |
173 | if (uart->scts && !(bfin_serial_get_mctrl(&uart->port) & TIOCM_CTS)) { | 177 | if (uart->scts && !(bfin_serial_get_mctrl(&uart->port) & TIOCM_CTS)) { |
@@ -239,10 +243,10 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) | |||
239 | return; | 243 | return; |
240 | } | 244 | } |
241 | 245 | ||
242 | if (!uart->port.info || !uart->port.info->port.tty) | 246 | if (!uart->port.state || !uart->port.state->port.tty) |
243 | return; | 247 | return; |
244 | #endif | 248 | #endif |
245 | tty = uart->port.info->port.tty; | 249 | tty = uart->port.state->port.tty; |
246 | 250 | ||
247 | if (ANOMALY_05000363) { | 251 | if (ANOMALY_05000363) { |
248 | /* The BF533 (and BF561) family of processors have a nice anomaly | 252 | /* The BF533 (and BF561) family of processors have a nice anomaly |
@@ -327,7 +331,7 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) | |||
327 | 331 | ||
328 | static void bfin_serial_tx_chars(struct bfin_serial_port *uart) | 332 | static void bfin_serial_tx_chars(struct bfin_serial_port *uart) |
329 | { | 333 | { |
330 | struct circ_buf *xmit = &uart->port.info->xmit; | 334 | struct circ_buf *xmit = &uart->port.state->xmit; |
331 | 335 | ||
332 | if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) { | 336 | if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) { |
333 | #ifdef CONFIG_BF54x | 337 | #ifdef CONFIG_BF54x |
@@ -394,7 +398,7 @@ static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id) | |||
394 | #ifdef CONFIG_SERIAL_BFIN_DMA | 398 | #ifdef CONFIG_SERIAL_BFIN_DMA |
395 | static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) | 399 | static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) |
396 | { | 400 | { |
397 | struct circ_buf *xmit = &uart->port.info->xmit; | 401 | struct circ_buf *xmit = &uart->port.state->xmit; |
398 | 402 | ||
399 | uart->tx_done = 0; | 403 | uart->tx_done = 0; |
400 | 404 | ||
@@ -432,7 +436,7 @@ static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) | |||
432 | 436 | ||
433 | static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) | 437 | static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) |
434 | { | 438 | { |
435 | struct tty_struct *tty = uart->port.info->port.tty; | 439 | struct tty_struct *tty = uart->port.state->port.tty; |
436 | int i, flg, status; | 440 | int i, flg, status; |
437 | 441 | ||
438 | status = UART_GET_LSR(uart); | 442 | status = UART_GET_LSR(uart); |
@@ -525,7 +529,7 @@ void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart) | |||
525 | static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id) | 529 | static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id) |
526 | { | 530 | { |
527 | struct bfin_serial_port *uart = dev_id; | 531 | struct bfin_serial_port *uart = dev_id; |
528 | struct circ_buf *xmit = &uart->port.info->xmit; | 532 | struct circ_buf *xmit = &uart->port.state->xmit; |
529 | 533 | ||
530 | #ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS | 534 | #ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS |
531 | if (uart->scts && !(bfin_serial_get_mctrl(&uart->port)&TIOCM_CTS)) { | 535 | if (uart->scts && !(bfin_serial_get_mctrl(&uart->port)&TIOCM_CTS)) { |
@@ -961,10 +965,10 @@ static void bfin_serial_set_ldisc(struct uart_port *port) | |||
961 | int line = port->line; | 965 | int line = port->line; |
962 | unsigned short val; | 966 | unsigned short val; |
963 | 967 | ||
964 | if (line >= port->info->port.tty->driver->num) | 968 | if (line >= port->state->port.tty->driver->num) |
965 | return; | 969 | return; |
966 | 970 | ||
967 | switch (port->info->port.tty->termios->c_line) { | 971 | switch (port->state->port.tty->termios->c_line) { |
968 | case N_IRDA: | 972 | case N_IRDA: |
969 | val = UART_GET_GCTL(&bfin_serial_ports[line]); | 973 | val = UART_GET_GCTL(&bfin_serial_ports[line]); |
970 | val |= (IREN | RPOLC); | 974 | val |= (IREN | RPOLC); |
diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c index c108b1a0ce98..088bb35475f1 100644 --- a/drivers/serial/bfin_sport_uart.c +++ b/drivers/serial/bfin_sport_uart.c | |||
@@ -178,7 +178,7 @@ static int sport_uart_setup(struct sport_uart_port *up, int sclk, int baud_rate) | |||
178 | static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id) | 178 | static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id) |
179 | { | 179 | { |
180 | struct sport_uart_port *up = dev_id; | 180 | struct sport_uart_port *up = dev_id; |
181 | struct tty_struct *tty = up->port.info->port.tty; | 181 | struct tty_struct *tty = up->port.state->port.tty; |
182 | unsigned int ch; | 182 | unsigned int ch; |
183 | 183 | ||
184 | do { | 184 | do { |
@@ -205,7 +205,7 @@ static irqreturn_t sport_uart_tx_irq(int irq, void *dev_id) | |||
205 | static irqreturn_t sport_uart_err_irq(int irq, void *dev_id) | 205 | static irqreturn_t sport_uart_err_irq(int irq, void *dev_id) |
206 | { | 206 | { |
207 | struct sport_uart_port *up = dev_id; | 207 | struct sport_uart_port *up = dev_id; |
208 | struct tty_struct *tty = up->port.info->port.tty; | 208 | struct tty_struct *tty = up->port.state->port.tty; |
209 | unsigned int stat = SPORT_GET_STAT(up); | 209 | unsigned int stat = SPORT_GET_STAT(up); |
210 | 210 | ||
211 | /* Overflow in RX FIFO */ | 211 | /* Overflow in RX FIFO */ |
@@ -290,7 +290,7 @@ fail1: | |||
290 | 290 | ||
291 | static void sport_uart_tx_chars(struct sport_uart_port *up) | 291 | static void sport_uart_tx_chars(struct sport_uart_port *up) |
292 | { | 292 | { |
293 | struct circ_buf *xmit = &up->port.info->xmit; | 293 | struct circ_buf *xmit = &up->port.state->xmit; |
294 | 294 | ||
295 | if (SPORT_GET_STAT(up) & TXF) | 295 | if (SPORT_GET_STAT(up) & TXF) |
296 | return; | 296 | return; |
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c index 80e76426131d..b6acd19b458e 100644 --- a/drivers/serial/clps711x.c +++ b/drivers/serial/clps711x.c | |||
@@ -93,7 +93,7 @@ static void clps711xuart_enable_ms(struct uart_port *port) | |||
93 | static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id) | 93 | static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id) |
94 | { | 94 | { |
95 | struct uart_port *port = dev_id; | 95 | struct uart_port *port = dev_id; |
96 | struct tty_struct *tty = port->info->port.tty; | 96 | struct tty_struct *tty = port->state->port.tty; |
97 | unsigned int status, ch, flg; | 97 | unsigned int status, ch, flg; |
98 | 98 | ||
99 | status = clps_readl(SYSFLG(port)); | 99 | status = clps_readl(SYSFLG(port)); |
@@ -147,7 +147,7 @@ static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id) | |||
147 | static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) | 147 | static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) |
148 | { | 148 | { |
149 | struct uart_port *port = dev_id; | 149 | struct uart_port *port = dev_id; |
150 | struct circ_buf *xmit = &port->info->xmit; | 150 | struct circ_buf *xmit = &port->state->xmit; |
151 | int count; | 151 | int count; |
152 | 152 | ||
153 | if (port->x_char) { | 153 | if (port->x_char) { |
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index f8df0681e160..8d349b23249a 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
@@ -244,7 +244,7 @@ static void cpm_uart_int_rx(struct uart_port *port) | |||
244 | int i; | 244 | int i; |
245 | unsigned char ch; | 245 | unsigned char ch; |
246 | u8 *cp; | 246 | u8 *cp; |
247 | struct tty_struct *tty = port->info->port.tty; | 247 | struct tty_struct *tty = port->state->port.tty; |
248 | struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; | 248 | struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; |
249 | cbd_t __iomem *bdp; | 249 | cbd_t __iomem *bdp; |
250 | u16 status; | 250 | u16 status; |
diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c index 6042b87797a1..57421d776329 100644 --- a/drivers/serial/dz.c +++ b/drivers/serial/dz.c | |||
@@ -197,7 +197,7 @@ static inline void dz_receive_chars(struct dz_mux *mux) | |||
197 | while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) { | 197 | while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) { |
198 | dport = &mux->dport[LINE(status)]; | 198 | dport = &mux->dport[LINE(status)]; |
199 | uport = &dport->port; | 199 | uport = &dport->port; |
200 | tty = uport->info->port.tty; /* point to the proper dev */ | 200 | tty = uport->state->port.tty; /* point to the proper dev */ |
201 | 201 | ||
202 | ch = UCHAR(status); /* grab the char */ | 202 | ch = UCHAR(status); /* grab the char */ |
203 | flag = TTY_NORMAL; | 203 | flag = TTY_NORMAL; |
@@ -249,7 +249,7 @@ static inline void dz_receive_chars(struct dz_mux *mux) | |||
249 | } | 249 | } |
250 | for (i = 0; i < DZ_NB_PORT; i++) | 250 | for (i = 0; i < DZ_NB_PORT; i++) |
251 | if (lines_rx[i]) | 251 | if (lines_rx[i]) |
252 | tty_flip_buffer_push(mux->dport[i].port.info->port.tty); | 252 | tty_flip_buffer_push(mux->dport[i].port.state->port.tty); |
253 | } | 253 | } |
254 | 254 | ||
255 | /* | 255 | /* |
@@ -268,7 +268,7 @@ static inline void dz_transmit_chars(struct dz_mux *mux) | |||
268 | 268 | ||
269 | status = dz_in(dport, DZ_CSR); | 269 | status = dz_in(dport, DZ_CSR); |
270 | dport = &mux->dport[LINE(status)]; | 270 | dport = &mux->dport[LINE(status)]; |
271 | xmit = &dport->port.info->xmit; | 271 | xmit = &dport->port.state->xmit; |
272 | 272 | ||
273 | if (dport->port.x_char) { /* XON/XOFF chars */ | 273 | if (dport->port.x_char) { /* XON/XOFF chars */ |
274 | dz_out(dport, DZ_TDR, dport->port.x_char); | 274 | dz_out(dport, DZ_TDR, dport->port.x_char); |
diff --git a/drivers/serial/icom.c b/drivers/serial/icom.c index cd1b6a45bb82..2d7feecaf492 100644 --- a/drivers/serial/icom.c +++ b/drivers/serial/icom.c | |||
@@ -617,7 +617,7 @@ static void shutdown(struct icom_port *icom_port) | |||
617 | * disable break condition | 617 | * disable break condition |
618 | */ | 618 | */ |
619 | cmdReg = readb(&icom_port->dram->CmdReg); | 619 | cmdReg = readb(&icom_port->dram->CmdReg); |
620 | if ((cmdReg | CMD_SND_BREAK) == CMD_SND_BREAK) { | 620 | if (cmdReg & CMD_SND_BREAK) { |
621 | writeb(cmdReg & ~CMD_SND_BREAK, &icom_port->dram->CmdReg); | 621 | writeb(cmdReg & ~CMD_SND_BREAK, &icom_port->dram->CmdReg); |
622 | } | 622 | } |
623 | } | 623 | } |
@@ -627,7 +627,7 @@ static int icom_write(struct uart_port *port) | |||
627 | unsigned long data_count; | 627 | unsigned long data_count; |
628 | unsigned char cmdReg; | 628 | unsigned char cmdReg; |
629 | unsigned long offset; | 629 | unsigned long offset; |
630 | int temp_tail = port->info->xmit.tail; | 630 | int temp_tail = port->state->xmit.tail; |
631 | 631 | ||
632 | trace(ICOM_PORT, "WRITE", 0); | 632 | trace(ICOM_PORT, "WRITE", 0); |
633 | 633 | ||
@@ -638,11 +638,11 @@ static int icom_write(struct uart_port *port) | |||
638 | } | 638 | } |
639 | 639 | ||
640 | data_count = 0; | 640 | data_count = 0; |
641 | while ((port->info->xmit.head != temp_tail) && | 641 | while ((port->state->xmit.head != temp_tail) && |
642 | (data_count <= XMIT_BUFF_SZ)) { | 642 | (data_count <= XMIT_BUFF_SZ)) { |
643 | 643 | ||
644 | ICOM_PORT->xmit_buf[data_count++] = | 644 | ICOM_PORT->xmit_buf[data_count++] = |
645 | port->info->xmit.buf[temp_tail]; | 645 | port->state->xmit.buf[temp_tail]; |
646 | 646 | ||
647 | temp_tail++; | 647 | temp_tail++; |
648 | temp_tail &= (UART_XMIT_SIZE - 1); | 648 | temp_tail &= (UART_XMIT_SIZE - 1); |
@@ -694,8 +694,8 @@ static inline void check_modem_status(struct icom_port *icom_port) | |||
694 | uart_handle_cts_change(&icom_port->uart_port, | 694 | uart_handle_cts_change(&icom_port->uart_port, |
695 | delta_status & ICOM_CTS); | 695 | delta_status & ICOM_CTS); |
696 | 696 | ||
697 | wake_up_interruptible(&icom_port->uart_port.info-> | 697 | wake_up_interruptible(&icom_port->uart_port.state-> |
698 | delta_msr_wait); | 698 | port.delta_msr_wait); |
699 | old_status = status; | 699 | old_status = status; |
700 | } | 700 | } |
701 | spin_unlock(&icom_port->uart_port.lock); | 701 | spin_unlock(&icom_port->uart_port.lock); |
@@ -718,10 +718,10 @@ static void xmit_interrupt(u16 port_int_reg, struct icom_port *icom_port) | |||
718 | icom_port->uart_port.icount.tx += count; | 718 | icom_port->uart_port.icount.tx += count; |
719 | 719 | ||
720 | for (i=0; i<count && | 720 | for (i=0; i<count && |
721 | !uart_circ_empty(&icom_port->uart_port.info->xmit); i++) { | 721 | !uart_circ_empty(&icom_port->uart_port.state->xmit); i++) { |
722 | 722 | ||
723 | icom_port->uart_port.info->xmit.tail++; | 723 | icom_port->uart_port.state->xmit.tail++; |
724 | icom_port->uart_port.info->xmit.tail &= | 724 | icom_port->uart_port.state->xmit.tail &= |
725 | (UART_XMIT_SIZE - 1); | 725 | (UART_XMIT_SIZE - 1); |
726 | } | 726 | } |
727 | 727 | ||
@@ -735,7 +735,7 @@ static void xmit_interrupt(u16 port_int_reg, struct icom_port *icom_port) | |||
735 | static void recv_interrupt(u16 port_int_reg, struct icom_port *icom_port) | 735 | static void recv_interrupt(u16 port_int_reg, struct icom_port *icom_port) |
736 | { | 736 | { |
737 | short int count, rcv_buff; | 737 | short int count, rcv_buff; |
738 | struct tty_struct *tty = icom_port->uart_port.info->port.tty; | 738 | struct tty_struct *tty = icom_port->uart_port.state->port.tty; |
739 | unsigned short int status; | 739 | unsigned short int status; |
740 | struct uart_icount *icount; | 740 | struct uart_icount *icount; |
741 | unsigned long offset; | 741 | unsigned long offset; |
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 7485afd0df4c..18130f11238e 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -224,7 +224,7 @@ static void imx_mctrl_check(struct imx_port *sport) | |||
224 | if (changed & TIOCM_CTS) | 224 | if (changed & TIOCM_CTS) |
225 | uart_handle_cts_change(&sport->port, status & TIOCM_CTS); | 225 | uart_handle_cts_change(&sport->port, status & TIOCM_CTS); |
226 | 226 | ||
227 | wake_up_interruptible(&sport->port.info->delta_msr_wait); | 227 | wake_up_interruptible(&sport->port.state->port.delta_msr_wait); |
228 | } | 228 | } |
229 | 229 | ||
230 | /* | 230 | /* |
@@ -236,7 +236,7 @@ static void imx_timeout(unsigned long data) | |||
236 | struct imx_port *sport = (struct imx_port *)data; | 236 | struct imx_port *sport = (struct imx_port *)data; |
237 | unsigned long flags; | 237 | unsigned long flags; |
238 | 238 | ||
239 | if (sport->port.info) { | 239 | if (sport->port.state) { |
240 | spin_lock_irqsave(&sport->port.lock, flags); | 240 | spin_lock_irqsave(&sport->port.lock, flags); |
241 | imx_mctrl_check(sport); | 241 | imx_mctrl_check(sport); |
242 | spin_unlock_irqrestore(&sport->port.lock, flags); | 242 | spin_unlock_irqrestore(&sport->port.lock, flags); |
@@ -323,7 +323,7 @@ static void imx_enable_ms(struct uart_port *port) | |||
323 | 323 | ||
324 | static inline void imx_transmit_buffer(struct imx_port *sport) | 324 | static inline void imx_transmit_buffer(struct imx_port *sport) |
325 | { | 325 | { |
326 | struct circ_buf *xmit = &sport->port.info->xmit; | 326 | struct circ_buf *xmit = &sport->port.state->xmit; |
327 | 327 | ||
328 | while (!(readl(sport->port.membase + UTS) & UTS_TXFULL)) { | 328 | while (!(readl(sport->port.membase + UTS) & UTS_TXFULL)) { |
329 | /* send xmit->buf[xmit->tail] | 329 | /* send xmit->buf[xmit->tail] |
@@ -388,7 +388,7 @@ static irqreturn_t imx_rtsint(int irq, void *dev_id) | |||
388 | 388 | ||
389 | writel(USR1_RTSD, sport->port.membase + USR1); | 389 | writel(USR1_RTSD, sport->port.membase + USR1); |
390 | uart_handle_cts_change(&sport->port, !!val); | 390 | uart_handle_cts_change(&sport->port, !!val); |
391 | wake_up_interruptible(&sport->port.info->delta_msr_wait); | 391 | wake_up_interruptible(&sport->port.state->port.delta_msr_wait); |
392 | 392 | ||
393 | spin_unlock_irqrestore(&sport->port.lock, flags); | 393 | spin_unlock_irqrestore(&sport->port.lock, flags); |
394 | return IRQ_HANDLED; | 394 | return IRQ_HANDLED; |
@@ -397,7 +397,7 @@ static irqreturn_t imx_rtsint(int irq, void *dev_id) | |||
397 | static irqreturn_t imx_txint(int irq, void *dev_id) | 397 | static irqreturn_t imx_txint(int irq, void *dev_id) |
398 | { | 398 | { |
399 | struct imx_port *sport = dev_id; | 399 | struct imx_port *sport = dev_id; |
400 | struct circ_buf *xmit = &sport->port.info->xmit; | 400 | struct circ_buf *xmit = &sport->port.state->xmit; |
401 | unsigned long flags; | 401 | unsigned long flags; |
402 | 402 | ||
403 | spin_lock_irqsave(&sport->port.lock,flags); | 403 | spin_lock_irqsave(&sport->port.lock,flags); |
@@ -427,7 +427,7 @@ static irqreturn_t imx_rxint(int irq, void *dev_id) | |||
427 | { | 427 | { |
428 | struct imx_port *sport = dev_id; | 428 | struct imx_port *sport = dev_id; |
429 | unsigned int rx,flg,ignored = 0; | 429 | unsigned int rx,flg,ignored = 0; |
430 | struct tty_struct *tty = sport->port.info->port.tty; | 430 | struct tty_struct *tty = sport->port.state->port.tty; |
431 | unsigned long flags, temp; | 431 | unsigned long flags, temp; |
432 | 432 | ||
433 | spin_lock_irqsave(&sport->port.lock,flags); | 433 | spin_lock_irqsave(&sport->port.lock,flags); |
@@ -900,11 +900,11 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, | |||
900 | rational_best_approximation(16 * div * baud, sport->port.uartclk, | 900 | rational_best_approximation(16 * div * baud, sport->port.uartclk, |
901 | 1 << 16, 1 << 16, &num, &denom); | 901 | 1 << 16, 1 << 16, &num, &denom); |
902 | 902 | ||
903 | if (port->info && port->info->port.tty) { | 903 | if (port->state && port->state->port.tty) { |
904 | tdiv64 = sport->port.uartclk; | 904 | tdiv64 = sport->port.uartclk; |
905 | tdiv64 *= num; | 905 | tdiv64 *= num; |
906 | do_div(tdiv64, denom * 16 * div); | 906 | do_div(tdiv64, denom * 16 * div); |
907 | tty_encode_baud_rate(sport->port.info->port.tty, | 907 | tty_encode_baud_rate(sport->port.state->port.tty, |
908 | (speed_t)tdiv64, (speed_t)tdiv64); | 908 | (speed_t)tdiv64, (speed_t)tdiv64); |
909 | } | 909 | } |
910 | 910 | ||
diff --git a/drivers/serial/ioc3_serial.c b/drivers/serial/ioc3_serial.c index ae3699d77dd0..d8983dd5c4b2 100644 --- a/drivers/serial/ioc3_serial.c +++ b/drivers/serial/ioc3_serial.c | |||
@@ -897,25 +897,25 @@ static void transmit_chars(struct uart_port *the_port) | |||
897 | char *start; | 897 | char *start; |
898 | struct tty_struct *tty; | 898 | struct tty_struct *tty; |
899 | struct ioc3_port *port = get_ioc3_port(the_port); | 899 | struct ioc3_port *port = get_ioc3_port(the_port); |
900 | struct uart_info *info; | 900 | struct uart_state *state; |
901 | 901 | ||
902 | if (!the_port) | 902 | if (!the_port) |
903 | return; | 903 | return; |
904 | if (!port) | 904 | if (!port) |
905 | return; | 905 | return; |
906 | 906 | ||
907 | info = the_port->info; | 907 | state = the_port->state; |
908 | tty = info->port.tty; | 908 | tty = state->port.tty; |
909 | 909 | ||
910 | if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) { | 910 | if (uart_circ_empty(&state->xmit) || uart_tx_stopped(the_port)) { |
911 | /* Nothing to do or hw stopped */ | 911 | /* Nothing to do or hw stopped */ |
912 | set_notification(port, N_ALL_OUTPUT, 0); | 912 | set_notification(port, N_ALL_OUTPUT, 0); |
913 | return; | 913 | return; |
914 | } | 914 | } |
915 | 915 | ||
916 | head = info->xmit.head; | 916 | head = state->xmit.head; |
917 | tail = info->xmit.tail; | 917 | tail = state->xmit.tail; |
918 | start = (char *)&info->xmit.buf[tail]; | 918 | start = (char *)&state->xmit.buf[tail]; |
919 | 919 | ||
920 | /* write out all the data or until the end of the buffer */ | 920 | /* write out all the data or until the end of the buffer */ |
921 | xmit_count = (head < tail) ? (UART_XMIT_SIZE - tail) : (head - tail); | 921 | xmit_count = (head < tail) ? (UART_XMIT_SIZE - tail) : (head - tail); |
@@ -928,14 +928,14 @@ static void transmit_chars(struct uart_port *the_port) | |||
928 | /* advance the pointers */ | 928 | /* advance the pointers */ |
929 | tail += result; | 929 | tail += result; |
930 | tail &= UART_XMIT_SIZE - 1; | 930 | tail &= UART_XMIT_SIZE - 1; |
931 | info->xmit.tail = tail; | 931 | state->xmit.tail = tail; |
932 | start = (char *)&info->xmit.buf[tail]; | 932 | start = (char *)&state->xmit.buf[tail]; |
933 | } | 933 | } |
934 | } | 934 | } |
935 | if (uart_circ_chars_pending(&info->xmit) < WAKEUP_CHARS) | 935 | if (uart_circ_chars_pending(&state->xmit) < WAKEUP_CHARS) |
936 | uart_write_wakeup(the_port); | 936 | uart_write_wakeup(the_port); |
937 | 937 | ||
938 | if (uart_circ_empty(&info->xmit)) { | 938 | if (uart_circ_empty(&state->xmit)) { |
939 | set_notification(port, N_OUTPUT_LOWAT, 0); | 939 | set_notification(port, N_OUTPUT_LOWAT, 0); |
940 | } else { | 940 | } else { |
941 | set_notification(port, N_OUTPUT_LOWAT, 1); | 941 | set_notification(port, N_OUTPUT_LOWAT, 1); |
@@ -956,7 +956,7 @@ ioc3_change_speed(struct uart_port *the_port, | |||
956 | unsigned int cflag; | 956 | unsigned int cflag; |
957 | int baud; | 957 | int baud; |
958 | int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; | 958 | int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; |
959 | struct uart_info *info = the_port->info; | 959 | struct uart_state *state = the_port->state; |
960 | 960 | ||
961 | cflag = new_termios->c_cflag; | 961 | cflag = new_termios->c_cflag; |
962 | 962 | ||
@@ -997,14 +997,14 @@ ioc3_change_speed(struct uart_port *the_port, | |||
997 | 997 | ||
998 | the_port->ignore_status_mask = N_ALL_INPUT; | 998 | the_port->ignore_status_mask = N_ALL_INPUT; |
999 | 999 | ||
1000 | info->port.tty->low_latency = 1; | 1000 | state->port.tty->low_latency = 1; |
1001 | 1001 | ||
1002 | if (I_IGNPAR(info->port.tty)) | 1002 | if (I_IGNPAR(state->port.tty)) |
1003 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR | 1003 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR |
1004 | | N_FRAMING_ERROR); | 1004 | | N_FRAMING_ERROR); |
1005 | if (I_IGNBRK(info->port.tty)) { | 1005 | if (I_IGNBRK(state->port.tty)) { |
1006 | the_port->ignore_status_mask &= ~N_BREAK; | 1006 | the_port->ignore_status_mask &= ~N_BREAK; |
1007 | if (I_IGNPAR(info->port.tty)) | 1007 | if (I_IGNPAR(state->port.tty)) |
1008 | the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; | 1008 | the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; |
1009 | } | 1009 | } |
1010 | if (!(cflag & CREAD)) { | 1010 | if (!(cflag & CREAD)) { |
@@ -1286,8 +1286,8 @@ static inline int do_read(struct uart_port *the_port, char *buf, int len) | |||
1286 | uart_handle_dcd_change | 1286 | uart_handle_dcd_change |
1287 | (port->ip_port, 0); | 1287 | (port->ip_port, 0); |
1288 | wake_up_interruptible | 1288 | wake_up_interruptible |
1289 | (&the_port->info-> | 1289 | (&the_port->state-> |
1290 | delta_msr_wait); | 1290 | port.delta_msr_wait); |
1291 | } | 1291 | } |
1292 | 1292 | ||
1293 | /* If we had any data to return, we | 1293 | /* If we had any data to return, we |
@@ -1392,21 +1392,21 @@ static int receive_chars(struct uart_port *the_port) | |||
1392 | struct tty_struct *tty; | 1392 | struct tty_struct *tty; |
1393 | unsigned char ch[MAX_CHARS]; | 1393 | unsigned char ch[MAX_CHARS]; |
1394 | int read_count = 0, read_room, flip = 0; | 1394 | int read_count = 0, read_room, flip = 0; |
1395 | struct uart_info *info = the_port->info; | 1395 | struct uart_state *state = the_port->state; |
1396 | struct ioc3_port *port = get_ioc3_port(the_port); | 1396 | struct ioc3_port *port = get_ioc3_port(the_port); |
1397 | unsigned long pflags; | 1397 | unsigned long pflags; |
1398 | 1398 | ||
1399 | /* Make sure all the pointers are "good" ones */ | 1399 | /* Make sure all the pointers are "good" ones */ |
1400 | if (!info) | 1400 | if (!state) |
1401 | return 0; | 1401 | return 0; |
1402 | if (!info->port.tty) | 1402 | if (!state->port.tty) |
1403 | return 0; | 1403 | return 0; |
1404 | 1404 | ||
1405 | if (!(port->ip_flags & INPUT_ENABLE)) | 1405 | if (!(port->ip_flags & INPUT_ENABLE)) |
1406 | return 0; | 1406 | return 0; |
1407 | 1407 | ||
1408 | spin_lock_irqsave(&the_port->lock, pflags); | 1408 | spin_lock_irqsave(&the_port->lock, pflags); |
1409 | tty = info->port.tty; | 1409 | tty = state->port.tty; |
1410 | 1410 | ||
1411 | read_count = do_read(the_port, ch, MAX_CHARS); | 1411 | read_count = do_read(the_port, ch, MAX_CHARS); |
1412 | if (read_count > 0) { | 1412 | if (read_count > 0) { |
@@ -1491,7 +1491,7 @@ ioc3uart_intr_one(struct ioc3_submodule *is, | |||
1491 | uart_handle_dcd_change(the_port, | 1491 | uart_handle_dcd_change(the_port, |
1492 | shadow & SHADOW_DCD); | 1492 | shadow & SHADOW_DCD); |
1493 | wake_up_interruptible | 1493 | wake_up_interruptible |
1494 | (&the_port->info->delta_msr_wait); | 1494 | (&the_port->state->port.delta_msr_wait); |
1495 | } else if ((port->ip_notify & N_DDCD) | 1495 | } else if ((port->ip_notify & N_DDCD) |
1496 | && !(shadow & SHADOW_DCD)) { | 1496 | && !(shadow & SHADOW_DCD)) { |
1497 | /* Flag delta DCD/no DCD */ | 1497 | /* Flag delta DCD/no DCD */ |
@@ -1511,7 +1511,7 @@ ioc3uart_intr_one(struct ioc3_submodule *is, | |||
1511 | uart_handle_cts_change(the_port, shadow | 1511 | uart_handle_cts_change(the_port, shadow |
1512 | & SHADOW_CTS); | 1512 | & SHADOW_CTS); |
1513 | wake_up_interruptible | 1513 | wake_up_interruptible |
1514 | (&the_port->info->delta_msr_wait); | 1514 | (&the_port->state->port.delta_msr_wait); |
1515 | } | 1515 | } |
1516 | } | 1516 | } |
1517 | 1517 | ||
@@ -1721,14 +1721,14 @@ static void ic3_shutdown(struct uart_port *the_port) | |||
1721 | { | 1721 | { |
1722 | unsigned long port_flags; | 1722 | unsigned long port_flags; |
1723 | struct ioc3_port *port; | 1723 | struct ioc3_port *port; |
1724 | struct uart_info *info; | 1724 | struct uart_state *state; |
1725 | 1725 | ||
1726 | port = get_ioc3_port(the_port); | 1726 | port = get_ioc3_port(the_port); |
1727 | if (!port) | 1727 | if (!port) |
1728 | return; | 1728 | return; |
1729 | 1729 | ||
1730 | info = the_port->info; | 1730 | state = the_port->state; |
1731 | wake_up_interruptible(&info->delta_msr_wait); | 1731 | wake_up_interruptible(&state->port.delta_msr_wait); |
1732 | 1732 | ||
1733 | spin_lock_irqsave(&the_port->lock, port_flags); | 1733 | spin_lock_irqsave(&the_port->lock, port_flags); |
1734 | set_notification(port, N_ALL, 0); | 1734 | set_notification(port, N_ALL, 0); |
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c index 6bab63cd5b29..2e02c3026d24 100644 --- a/drivers/serial/ioc4_serial.c +++ b/drivers/serial/ioc4_serial.c | |||
@@ -930,7 +930,7 @@ static void handle_dma_error_intr(void *arg, uint32_t other_ir) | |||
930 | 930 | ||
931 | if (readl(&port->ip_mem->pci_err_addr_l.raw) & IOC4_PCI_ERR_ADDR_VLD) { | 931 | if (readl(&port->ip_mem->pci_err_addr_l.raw) & IOC4_PCI_ERR_ADDR_VLD) { |
932 | printk(KERN_ERR | 932 | printk(KERN_ERR |
933 | "PCI error address is 0x%lx, " | 933 | "PCI error address is 0x%llx, " |
934 | "master is serial port %c %s\n", | 934 | "master is serial port %c %s\n", |
935 | (((uint64_t)readl(&port->ip_mem->pci_err_addr_h) | 935 | (((uint64_t)readl(&port->ip_mem->pci_err_addr_h) |
936 | << 32) | 936 | << 32) |
@@ -1627,25 +1627,25 @@ static void transmit_chars(struct uart_port *the_port) | |||
1627 | char *start; | 1627 | char *start; |
1628 | struct tty_struct *tty; | 1628 | struct tty_struct *tty; |
1629 | struct ioc4_port *port = get_ioc4_port(the_port, 0); | 1629 | struct ioc4_port *port = get_ioc4_port(the_port, 0); |
1630 | struct uart_info *info; | 1630 | struct uart_state *state; |
1631 | 1631 | ||
1632 | if (!the_port) | 1632 | if (!the_port) |
1633 | return; | 1633 | return; |
1634 | if (!port) | 1634 | if (!port) |
1635 | return; | 1635 | return; |
1636 | 1636 | ||
1637 | info = the_port->info; | 1637 | state = the_port->state; |
1638 | tty = info->port.tty; | 1638 | tty = state->port.tty; |
1639 | 1639 | ||
1640 | if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) { | 1640 | if (uart_circ_empty(&state->xmit) || uart_tx_stopped(the_port)) { |
1641 | /* Nothing to do or hw stopped */ | 1641 | /* Nothing to do or hw stopped */ |
1642 | set_notification(port, N_ALL_OUTPUT, 0); | 1642 | set_notification(port, N_ALL_OUTPUT, 0); |
1643 | return; | 1643 | return; |
1644 | } | 1644 | } |
1645 | 1645 | ||
1646 | head = info->xmit.head; | 1646 | head = state->xmit.head; |
1647 | tail = info->xmit.tail; | 1647 | tail = state->xmit.tail; |
1648 | start = (char *)&info->xmit.buf[tail]; | 1648 | start = (char *)&state->xmit.buf[tail]; |
1649 | 1649 | ||
1650 | /* write out all the data or until the end of the buffer */ | 1650 | /* write out all the data or until the end of the buffer */ |
1651 | xmit_count = (head < tail) ? (UART_XMIT_SIZE - tail) : (head - tail); | 1651 | xmit_count = (head < tail) ? (UART_XMIT_SIZE - tail) : (head - tail); |
@@ -1658,14 +1658,14 @@ static void transmit_chars(struct uart_port *the_port) | |||
1658 | /* advance the pointers */ | 1658 | /* advance the pointers */ |
1659 | tail += result; | 1659 | tail += result; |
1660 | tail &= UART_XMIT_SIZE - 1; | 1660 | tail &= UART_XMIT_SIZE - 1; |
1661 | info->xmit.tail = tail; | 1661 | state->xmit.tail = tail; |
1662 | start = (char *)&info->xmit.buf[tail]; | 1662 | start = (char *)&state->xmit.buf[tail]; |
1663 | } | 1663 | } |
1664 | } | 1664 | } |
1665 | if (uart_circ_chars_pending(&info->xmit) < WAKEUP_CHARS) | 1665 | if (uart_circ_chars_pending(&state->xmit) < WAKEUP_CHARS) |
1666 | uart_write_wakeup(the_port); | 1666 | uart_write_wakeup(the_port); |
1667 | 1667 | ||
1668 | if (uart_circ_empty(&info->xmit)) { | 1668 | if (uart_circ_empty(&state->xmit)) { |
1669 | set_notification(port, N_OUTPUT_LOWAT, 0); | 1669 | set_notification(port, N_OUTPUT_LOWAT, 0); |
1670 | } else { | 1670 | } else { |
1671 | set_notification(port, N_OUTPUT_LOWAT, 1); | 1671 | set_notification(port, N_OUTPUT_LOWAT, 1); |
@@ -1686,7 +1686,7 @@ ioc4_change_speed(struct uart_port *the_port, | |||
1686 | int baud, bits; | 1686 | int baud, bits; |
1687 | unsigned cflag; | 1687 | unsigned cflag; |
1688 | int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; | 1688 | int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8; |
1689 | struct uart_info *info = the_port->info; | 1689 | struct uart_state *state = the_port->state; |
1690 | 1690 | ||
1691 | cflag = new_termios->c_cflag; | 1691 | cflag = new_termios->c_cflag; |
1692 | 1692 | ||
@@ -1738,14 +1738,14 @@ ioc4_change_speed(struct uart_port *the_port, | |||
1738 | 1738 | ||
1739 | the_port->ignore_status_mask = N_ALL_INPUT; | 1739 | the_port->ignore_status_mask = N_ALL_INPUT; |
1740 | 1740 | ||
1741 | info->port.tty->low_latency = 1; | 1741 | state->port.tty->low_latency = 1; |
1742 | 1742 | ||
1743 | if (I_IGNPAR(info->port.tty)) | 1743 | if (I_IGNPAR(state->port.tty)) |
1744 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR | 1744 | the_port->ignore_status_mask &= ~(N_PARITY_ERROR |
1745 | | N_FRAMING_ERROR); | 1745 | | N_FRAMING_ERROR); |
1746 | if (I_IGNBRK(info->port.tty)) { | 1746 | if (I_IGNBRK(state->port.tty)) { |
1747 | the_port->ignore_status_mask &= ~N_BREAK; | 1747 | the_port->ignore_status_mask &= ~N_BREAK; |
1748 | if (I_IGNPAR(info->port.tty)) | 1748 | if (I_IGNPAR(state->port.tty)) |
1749 | the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; | 1749 | the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; |
1750 | } | 1750 | } |
1751 | if (!(cflag & CREAD)) { | 1751 | if (!(cflag & CREAD)) { |
@@ -1784,7 +1784,7 @@ ioc4_change_speed(struct uart_port *the_port, | |||
1784 | static inline int ic4_startup_local(struct uart_port *the_port) | 1784 | static inline int ic4_startup_local(struct uart_port *the_port) |
1785 | { | 1785 | { |
1786 | struct ioc4_port *port; | 1786 | struct ioc4_port *port; |
1787 | struct uart_info *info; | 1787 | struct uart_state *state; |
1788 | 1788 | ||
1789 | if (!the_port) | 1789 | if (!the_port) |
1790 | return -1; | 1790 | return -1; |
@@ -1793,7 +1793,7 @@ static inline int ic4_startup_local(struct uart_port *the_port) | |||
1793 | if (!port) | 1793 | if (!port) |
1794 | return -1; | 1794 | return -1; |
1795 | 1795 | ||
1796 | info = the_port->info; | 1796 | state = the_port->state; |
1797 | 1797 | ||
1798 | local_open(port); | 1798 | local_open(port); |
1799 | 1799 | ||
@@ -1801,7 +1801,7 @@ static inline int ic4_startup_local(struct uart_port *the_port) | |||
1801 | ioc4_set_proto(port, the_port->mapbase); | 1801 | ioc4_set_proto(port, the_port->mapbase); |
1802 | 1802 | ||
1803 | /* set the speed of the serial port */ | 1803 | /* set the speed of the serial port */ |
1804 | ioc4_change_speed(the_port, info->port.tty->termios, | 1804 | ioc4_change_speed(the_port, state->port.tty->termios, |
1805 | (struct ktermios *)0); | 1805 | (struct ktermios *)0); |
1806 | 1806 | ||
1807 | return 0; | 1807 | return 0; |
@@ -1882,7 +1882,7 @@ static void handle_intr(void *arg, uint32_t sio_ir) | |||
1882 | the_port = port->ip_port; | 1882 | the_port = port->ip_port; |
1883 | the_port->icount.dcd = 1; | 1883 | the_port->icount.dcd = 1; |
1884 | wake_up_interruptible | 1884 | wake_up_interruptible |
1885 | (&the_port-> info->delta_msr_wait); | 1885 | (&the_port->state->port.delta_msr_wait); |
1886 | } else if ((port->ip_notify & N_DDCD) | 1886 | } else if ((port->ip_notify & N_DDCD) |
1887 | && !(shadow & IOC4_SHADOW_DCD)) { | 1887 | && !(shadow & IOC4_SHADOW_DCD)) { |
1888 | /* Flag delta DCD/no DCD */ | 1888 | /* Flag delta DCD/no DCD */ |
@@ -1904,7 +1904,7 @@ static void handle_intr(void *arg, uint32_t sio_ir) | |||
1904 | the_port->icount.cts = | 1904 | the_port->icount.cts = |
1905 | (shadow & IOC4_SHADOW_CTS) ? 1 : 0; | 1905 | (shadow & IOC4_SHADOW_CTS) ? 1 : 0; |
1906 | wake_up_interruptible | 1906 | wake_up_interruptible |
1907 | (&the_port->info->delta_msr_wait); | 1907 | (&the_port->state->port.delta_msr_wait); |
1908 | } | 1908 | } |
1909 | } | 1909 | } |
1910 | 1910 | ||
@@ -2236,8 +2236,8 @@ static inline int do_read(struct uart_port *the_port, unsigned char *buf, | |||
2236 | && port->ip_port) { | 2236 | && port->ip_port) { |
2237 | the_port->icount.dcd = 0; | 2237 | the_port->icount.dcd = 0; |
2238 | wake_up_interruptible | 2238 | wake_up_interruptible |
2239 | (&the_port->info-> | 2239 | (&the_port->state-> |
2240 | delta_msr_wait); | 2240 | port.delta_msr_wait); |
2241 | } | 2241 | } |
2242 | 2242 | ||
2243 | /* If we had any data to return, we | 2243 | /* If we had any data to return, we |
@@ -2341,17 +2341,17 @@ static void receive_chars(struct uart_port *the_port) | |||
2341 | unsigned char ch[IOC4_MAX_CHARS]; | 2341 | unsigned char ch[IOC4_MAX_CHARS]; |
2342 | int read_count, request_count = IOC4_MAX_CHARS; | 2342 | int read_count, request_count = IOC4_MAX_CHARS; |
2343 | struct uart_icount *icount; | 2343 | struct uart_icount *icount; |
2344 | struct uart_info *info = the_port->info; | 2344 | struct uart_state *state = the_port->state; |
2345 | unsigned long pflags; | 2345 | unsigned long pflags; |
2346 | 2346 | ||
2347 | /* Make sure all the pointers are "good" ones */ | 2347 | /* Make sure all the pointers are "good" ones */ |
2348 | if (!info) | 2348 | if (!state) |
2349 | return; | 2349 | return; |
2350 | if (!info->port.tty) | 2350 | if (!state->port.tty) |
2351 | return; | 2351 | return; |
2352 | 2352 | ||
2353 | spin_lock_irqsave(&the_port->lock, pflags); | 2353 | spin_lock_irqsave(&the_port->lock, pflags); |
2354 | tty = info->port.tty; | 2354 | tty = state->port.tty; |
2355 | 2355 | ||
2356 | request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS); | 2356 | request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS); |
2357 | 2357 | ||
@@ -2430,19 +2430,19 @@ static void ic4_shutdown(struct uart_port *the_port) | |||
2430 | { | 2430 | { |
2431 | unsigned long port_flags; | 2431 | unsigned long port_flags; |
2432 | struct ioc4_port *port; | 2432 | struct ioc4_port *port; |
2433 | struct uart_info *info; | 2433 | struct uart_state *state; |
2434 | 2434 | ||
2435 | port = get_ioc4_port(the_port, 0); | 2435 | port = get_ioc4_port(the_port, 0); |
2436 | if (!port) | 2436 | if (!port) |
2437 | return; | 2437 | return; |
2438 | 2438 | ||
2439 | info = the_port->info; | 2439 | state = the_port->state; |
2440 | port->ip_port = NULL; | 2440 | port->ip_port = NULL; |
2441 | 2441 | ||
2442 | wake_up_interruptible(&info->delta_msr_wait); | 2442 | wake_up_interruptible(&state->port.delta_msr_wait); |
2443 | 2443 | ||
2444 | if (info->port.tty) | 2444 | if (state->port.tty) |
2445 | set_bit(TTY_IO_ERROR, &info->port.tty->flags); | 2445 | set_bit(TTY_IO_ERROR, &state->port.tty->flags); |
2446 | 2446 | ||
2447 | spin_lock_irqsave(&the_port->lock, port_flags); | 2447 | spin_lock_irqsave(&the_port->lock, port_flags); |
2448 | set_notification(port, N_ALL, 0); | 2448 | set_notification(port, N_ALL, 0); |
@@ -2538,7 +2538,7 @@ static int ic4_startup(struct uart_port *the_port) | |||
2538 | int retval; | 2538 | int retval; |
2539 | struct ioc4_port *port; | 2539 | struct ioc4_port *port; |
2540 | struct ioc4_control *control; | 2540 | struct ioc4_control *control; |
2541 | struct uart_info *info; | 2541 | struct uart_state *state; |
2542 | unsigned long port_flags; | 2542 | unsigned long port_flags; |
2543 | 2543 | ||
2544 | if (!the_port) | 2544 | if (!the_port) |
@@ -2546,7 +2546,7 @@ static int ic4_startup(struct uart_port *the_port) | |||
2546 | port = get_ioc4_port(the_port, 1); | 2546 | port = get_ioc4_port(the_port, 1); |
2547 | if (!port) | 2547 | if (!port) |
2548 | return -ENODEV; | 2548 | return -ENODEV; |
2549 | info = the_port->info; | 2549 | state = the_port->state; |
2550 | 2550 | ||
2551 | control = port->ip_control; | 2551 | control = port->ip_control; |
2552 | if (!control) { | 2552 | if (!control) { |
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c index 0d9acbd0bb70..ebff4a1d4bcc 100644 --- a/drivers/serial/ip22zilog.c +++ b/drivers/serial/ip22zilog.c | |||
@@ -256,9 +256,9 @@ static struct tty_struct *ip22zilog_receive_chars(struct uart_ip22zilog_port *up | |||
256 | unsigned int r1; | 256 | unsigned int r1; |
257 | 257 | ||
258 | tty = NULL; | 258 | tty = NULL; |
259 | if (up->port.info != NULL && | 259 | if (up->port.state != NULL && |
260 | up->port.info->port.tty != NULL) | 260 | up->port.state->port.tty != NULL) |
261 | tty = up->port.info->port.tty; | 261 | tty = up->port.state->port.tty; |
262 | 262 | ||
263 | for (;;) { | 263 | for (;;) { |
264 | ch = readb(&channel->control); | 264 | ch = readb(&channel->control); |
@@ -354,7 +354,7 @@ static void ip22zilog_status_handle(struct uart_ip22zilog_port *up, | |||
354 | uart_handle_cts_change(&up->port, | 354 | uart_handle_cts_change(&up->port, |
355 | (status & CTS)); | 355 | (status & CTS)); |
356 | 356 | ||
357 | wake_up_interruptible(&up->port.info->delta_msr_wait); | 357 | wake_up_interruptible(&up->port.state->port.delta_msr_wait); |
358 | } | 358 | } |
359 | 359 | ||
360 | up->prev_status = status; | 360 | up->prev_status = status; |
@@ -404,9 +404,9 @@ static void ip22zilog_transmit_chars(struct uart_ip22zilog_port *up, | |||
404 | return; | 404 | return; |
405 | } | 405 | } |
406 | 406 | ||
407 | if (up->port.info == NULL) | 407 | if (up->port.state == NULL) |
408 | goto ack_tx_int; | 408 | goto ack_tx_int; |
409 | xmit = &up->port.info->xmit; | 409 | xmit = &up->port.state->xmit; |
410 | if (uart_circ_empty(xmit)) | 410 | if (uart_circ_empty(xmit)) |
411 | goto ack_tx_int; | 411 | goto ack_tx_int; |
412 | if (uart_tx_stopped(&up->port)) | 412 | if (uart_tx_stopped(&up->port)) |
@@ -607,7 +607,7 @@ static void ip22zilog_start_tx(struct uart_port *port) | |||
607 | port->icount.tx++; | 607 | port->icount.tx++; |
608 | port->x_char = 0; | 608 | port->x_char = 0; |
609 | } else { | 609 | } else { |
610 | struct circ_buf *xmit = &port->info->xmit; | 610 | struct circ_buf *xmit = &port->state->xmit; |
611 | 611 | ||
612 | writeb(xmit->buf[xmit->tail], &channel->data); | 612 | writeb(xmit->buf[xmit->tail], &channel->data); |
613 | ZSDELAY(); | 613 | ZSDELAY(); |
diff --git a/drivers/serial/jsm/jsm_neo.c b/drivers/serial/jsm/jsm_neo.c index 9dadaa11d266..b4b124e4828f 100644 --- a/drivers/serial/jsm/jsm_neo.c +++ b/drivers/serial/jsm/jsm_neo.c | |||
@@ -989,7 +989,7 @@ static void neo_param(struct jsm_channel *ch) | |||
989 | { 50, B50 }, | 989 | { 50, B50 }, |
990 | }; | 990 | }; |
991 | 991 | ||
992 | cflag = C_BAUD(ch->uart_port.info->port.tty); | 992 | cflag = C_BAUD(ch->uart_port.state->port.tty); |
993 | baud = 9600; | 993 | baud = 9600; |
994 | for (i = 0; i < ARRAY_SIZE(baud_rates); i++) { | 994 | for (i = 0; i < ARRAY_SIZE(baud_rates); i++) { |
995 | if (baud_rates[i].cflag == cflag) { | 995 | if (baud_rates[i].cflag == cflag) { |
diff --git a/drivers/serial/jsm/jsm_tty.c b/drivers/serial/jsm/jsm_tty.c index 00f4577d2f7f..7439c0373620 100644 --- a/drivers/serial/jsm/jsm_tty.c +++ b/drivers/serial/jsm/jsm_tty.c | |||
@@ -147,7 +147,7 @@ static void jsm_tty_send_xchar(struct uart_port *port, char ch) | |||
147 | struct ktermios *termios; | 147 | struct ktermios *termios; |
148 | 148 | ||
149 | spin_lock_irqsave(&port->lock, lock_flags); | 149 | spin_lock_irqsave(&port->lock, lock_flags); |
150 | termios = port->info->port.tty->termios; | 150 | termios = port->state->port.tty->termios; |
151 | if (ch == termios->c_cc[VSTART]) | 151 | if (ch == termios->c_cc[VSTART]) |
152 | channel->ch_bd->bd_ops->send_start_character(channel); | 152 | channel->ch_bd->bd_ops->send_start_character(channel); |
153 | 153 | ||
@@ -245,7 +245,7 @@ static int jsm_tty_open(struct uart_port *port) | |||
245 | channel->ch_cached_lsr = 0; | 245 | channel->ch_cached_lsr = 0; |
246 | channel->ch_stops_sent = 0; | 246 | channel->ch_stops_sent = 0; |
247 | 247 | ||
248 | termios = port->info->port.tty->termios; | 248 | termios = port->state->port.tty->termios; |
249 | channel->ch_c_cflag = termios->c_cflag; | 249 | channel->ch_c_cflag = termios->c_cflag; |
250 | channel->ch_c_iflag = termios->c_iflag; | 250 | channel->ch_c_iflag = termios->c_iflag; |
251 | channel->ch_c_oflag = termios->c_oflag; | 251 | channel->ch_c_oflag = termios->c_oflag; |
@@ -278,7 +278,7 @@ static void jsm_tty_close(struct uart_port *port) | |||
278 | jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n"); | 278 | jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n"); |
279 | 279 | ||
280 | bd = channel->ch_bd; | 280 | bd = channel->ch_bd; |
281 | ts = port->info->port.tty->termios; | 281 | ts = port->state->port.tty->termios; |
282 | 282 | ||
283 | channel->ch_flags &= ~(CH_STOPI); | 283 | channel->ch_flags &= ~(CH_STOPI); |
284 | 284 | ||
@@ -530,7 +530,7 @@ void jsm_input(struct jsm_channel *ch) | |||
530 | if (!ch) | 530 | if (!ch) |
531 | return; | 531 | return; |
532 | 532 | ||
533 | tp = ch->uart_port.info->port.tty; | 533 | tp = ch->uart_port.state->port.tty; |
534 | 534 | ||
535 | bd = ch->ch_bd; | 535 | bd = ch->ch_bd; |
536 | if(!bd) | 536 | if(!bd) |
@@ -849,7 +849,7 @@ int jsm_tty_write(struct uart_port *port) | |||
849 | u16 tail; | 849 | u16 tail; |
850 | u16 tmask; | 850 | u16 tmask; |
851 | u32 remain; | 851 | u32 remain; |
852 | int temp_tail = port->info->xmit.tail; | 852 | int temp_tail = port->state->xmit.tail; |
853 | struct jsm_channel *channel = (struct jsm_channel *)port; | 853 | struct jsm_channel *channel = (struct jsm_channel *)port; |
854 | 854 | ||
855 | tmask = WQUEUEMASK; | 855 | tmask = WQUEUEMASK; |
@@ -865,10 +865,10 @@ int jsm_tty_write(struct uart_port *port) | |||
865 | data_count = 0; | 865 | data_count = 0; |
866 | if (bufcount >= remain) { | 866 | if (bufcount >= remain) { |
867 | bufcount -= remain; | 867 | bufcount -= remain; |
868 | while ((port->info->xmit.head != temp_tail) && | 868 | while ((port->state->xmit.head != temp_tail) && |
869 | (data_count < remain)) { | 869 | (data_count < remain)) { |
870 | channel->ch_wqueue[head++] = | 870 | channel->ch_wqueue[head++] = |
871 | port->info->xmit.buf[temp_tail]; | 871 | port->state->xmit.buf[temp_tail]; |
872 | 872 | ||
873 | temp_tail++; | 873 | temp_tail++; |
874 | temp_tail &= (UART_XMIT_SIZE - 1); | 874 | temp_tail &= (UART_XMIT_SIZE - 1); |
@@ -880,10 +880,10 @@ int jsm_tty_write(struct uart_port *port) | |||
880 | data_count1 = 0; | 880 | data_count1 = 0; |
881 | if (bufcount > 0) { | 881 | if (bufcount > 0) { |
882 | remain = bufcount; | 882 | remain = bufcount; |
883 | while ((port->info->xmit.head != temp_tail) && | 883 | while ((port->state->xmit.head != temp_tail) && |
884 | (data_count1 < remain)) { | 884 | (data_count1 < remain)) { |
885 | channel->ch_wqueue[head++] = | 885 | channel->ch_wqueue[head++] = |
886 | port->info->xmit.buf[temp_tail]; | 886 | port->state->xmit.buf[temp_tail]; |
887 | 887 | ||
888 | temp_tail++; | 888 | temp_tail++; |
889 | temp_tail &= (UART_XMIT_SIZE - 1); | 889 | temp_tail &= (UART_XMIT_SIZE - 1); |
@@ -892,7 +892,7 @@ int jsm_tty_write(struct uart_port *port) | |||
892 | } | 892 | } |
893 | } | 893 | } |
894 | 894 | ||
895 | port->info->xmit.tail = temp_tail; | 895 | port->state->xmit.tail = temp_tail; |
896 | 896 | ||
897 | data_count += data_count1; | 897 | data_count += data_count1; |
898 | if (data_count) { | 898 | if (data_count) { |
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c index 611c97a15654..bea5c215460c 100644 --- a/drivers/serial/m32r_sio.c +++ b/drivers/serial/m32r_sio.c | |||
@@ -286,7 +286,7 @@ static void m32r_sio_start_tx(struct uart_port *port) | |||
286 | { | 286 | { |
287 | #ifdef CONFIG_SERIAL_M32R_PLDSIO | 287 | #ifdef CONFIG_SERIAL_M32R_PLDSIO |
288 | struct uart_sio_port *up = (struct uart_sio_port *)port; | 288 | struct uart_sio_port *up = (struct uart_sio_port *)port; |
289 | struct circ_buf *xmit = &up->port.info->xmit; | 289 | struct circ_buf *xmit = &up->port.state->xmit; |
290 | 290 | ||
291 | if (!(up->ier & UART_IER_THRI)) { | 291 | if (!(up->ier & UART_IER_THRI)) { |
292 | up->ier |= UART_IER_THRI; | 292 | up->ier |= UART_IER_THRI; |
@@ -325,7 +325,7 @@ static void m32r_sio_enable_ms(struct uart_port *port) | |||
325 | 325 | ||
326 | static void receive_chars(struct uart_sio_port *up, int *status) | 326 | static void receive_chars(struct uart_sio_port *up, int *status) |
327 | { | 327 | { |
328 | struct tty_struct *tty = up->port.info->port.tty; | 328 | struct tty_struct *tty = up->port.state->port.tty; |
329 | unsigned char ch; | 329 | unsigned char ch; |
330 | unsigned char flag; | 330 | unsigned char flag; |
331 | int max_count = 256; | 331 | int max_count = 256; |
@@ -398,7 +398,7 @@ static void receive_chars(struct uart_sio_port *up, int *status) | |||
398 | 398 | ||
399 | static void transmit_chars(struct uart_sio_port *up) | 399 | static void transmit_chars(struct uart_sio_port *up) |
400 | { | 400 | { |
401 | struct circ_buf *xmit = &up->port.info->xmit; | 401 | struct circ_buf *xmit = &up->port.state->xmit; |
402 | int count; | 402 | int count; |
403 | 403 | ||
404 | if (up->port.x_char) { | 404 | if (up->port.x_char) { |
diff --git a/drivers/serial/max3100.c b/drivers/serial/max3100.c index 9fd33e5622bd..3c30c56aa2e1 100644 --- a/drivers/serial/max3100.c +++ b/drivers/serial/max3100.c | |||
@@ -184,7 +184,7 @@ static void max3100_timeout(unsigned long data) | |||
184 | { | 184 | { |
185 | struct max3100_port *s = (struct max3100_port *)data; | 185 | struct max3100_port *s = (struct max3100_port *)data; |
186 | 186 | ||
187 | if (s->port.info) { | 187 | if (s->port.state) { |
188 | max3100_dowork(s); | 188 | max3100_dowork(s); |
189 | mod_timer(&s->timer, jiffies + s->poll_time); | 189 | mod_timer(&s->timer, jiffies + s->poll_time); |
190 | } | 190 | } |
@@ -261,7 +261,7 @@ static void max3100_work(struct work_struct *w) | |||
261 | int rxchars; | 261 | int rxchars; |
262 | u16 tx, rx; | 262 | u16 tx, rx; |
263 | int conf, cconf, rts, crts; | 263 | int conf, cconf, rts, crts; |
264 | struct circ_buf *xmit = &s->port.info->xmit; | 264 | struct circ_buf *xmit = &s->port.state->xmit; |
265 | 265 | ||
266 | dev_dbg(&s->spi->dev, "%s\n", __func__); | 266 | dev_dbg(&s->spi->dev, "%s\n", __func__); |
267 | 267 | ||
@@ -307,8 +307,8 @@ static void max3100_work(struct work_struct *w) | |||
307 | } | 307 | } |
308 | } | 308 | } |
309 | 309 | ||
310 | if (rxchars > 16 && s->port.info->port.tty != NULL) { | 310 | if (rxchars > 16 && s->port.state->port.tty != NULL) { |
311 | tty_flip_buffer_push(s->port.info->port.tty); | 311 | tty_flip_buffer_push(s->port.state->port.tty); |
312 | rxchars = 0; | 312 | rxchars = 0; |
313 | } | 313 | } |
314 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 314 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
@@ -320,8 +320,8 @@ static void max3100_work(struct work_struct *w) | |||
320 | (!uart_circ_empty(xmit) && | 320 | (!uart_circ_empty(xmit) && |
321 | !uart_tx_stopped(&s->port)))); | 321 | !uart_tx_stopped(&s->port)))); |
322 | 322 | ||
323 | if (rxchars > 0 && s->port.info->port.tty != NULL) | 323 | if (rxchars > 0 && s->port.state->port.tty != NULL) |
324 | tty_flip_buffer_push(s->port.info->port.tty); | 324 | tty_flip_buffer_push(s->port.state->port.tty); |
325 | } | 325 | } |
326 | 326 | ||
327 | static irqreturn_t max3100_irq(int irqno, void *dev_id) | 327 | static irqreturn_t max3100_irq(int irqno, void *dev_id) |
@@ -429,7 +429,7 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios, | |||
429 | int baud = 0; | 429 | int baud = 0; |
430 | unsigned cflag; | 430 | unsigned cflag; |
431 | u32 param_new, param_mask, parity = 0; | 431 | u32 param_new, param_mask, parity = 0; |
432 | struct tty_struct *tty = s->port.info->port.tty; | 432 | struct tty_struct *tty = s->port.state->port.tty; |
433 | 433 | ||
434 | dev_dbg(&s->spi->dev, "%s\n", __func__); | 434 | dev_dbg(&s->spi->dev, "%s\n", __func__); |
435 | if (!tty) | 435 | if (!tty) |
@@ -529,7 +529,7 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios, | |||
529 | MAX3100_STATUS_OE; | 529 | MAX3100_STATUS_OE; |
530 | 530 | ||
531 | /* we are sending char from a workqueue so enable */ | 531 | /* we are sending char from a workqueue so enable */ |
532 | s->port.info->port.tty->low_latency = 1; | 532 | s->port.state->port.tty->low_latency = 1; |
533 | 533 | ||
534 | if (s->poll_time > 0) | 534 | if (s->poll_time > 0) |
535 | del_timer_sync(&s->timer); | 535 | del_timer_sync(&s->timer); |
@@ -925,3 +925,4 @@ module_exit(max3100_exit); | |||
925 | MODULE_DESCRIPTION("MAX3100 driver"); | 925 | MODULE_DESCRIPTION("MAX3100 driver"); |
926 | MODULE_AUTHOR("Christian Pellegrin <chripell@evolware.org>"); | 926 | MODULE_AUTHOR("Christian Pellegrin <chripell@evolware.org>"); |
927 | MODULE_LICENSE("GPL"); | 927 | MODULE_LICENSE("GPL"); |
928 | MODULE_ALIAS("spi:max3100"); | ||
diff --git a/drivers/serial/mcf.c b/drivers/serial/mcf.c index 0eefb07bebaf..b44382442bf1 100644 --- a/drivers/serial/mcf.c +++ b/drivers/serial/mcf.c | |||
@@ -323,7 +323,7 @@ static void mcf_rx_chars(struct mcf_uart *pp) | |||
323 | uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag); | 323 | uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag); |
324 | } | 324 | } |
325 | 325 | ||
326 | tty_flip_buffer_push(port->info->port.tty); | 326 | tty_flip_buffer_push(port->state->port.tty); |
327 | } | 327 | } |
328 | 328 | ||
329 | /****************************************************************************/ | 329 | /****************************************************************************/ |
@@ -331,7 +331,7 @@ static void mcf_rx_chars(struct mcf_uart *pp) | |||
331 | static void mcf_tx_chars(struct mcf_uart *pp) | 331 | static void mcf_tx_chars(struct mcf_uart *pp) |
332 | { | 332 | { |
333 | struct uart_port *port = &pp->port; | 333 | struct uart_port *port = &pp->port; |
334 | struct circ_buf *xmit = &port->info->xmit; | 334 | struct circ_buf *xmit = &port->state->xmit; |
335 | 335 | ||
336 | if (port->x_char) { | 336 | if (port->x_char) { |
337 | /* Send special char - probably flow control */ | 337 | /* Send special char - probably flow control */ |
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index abbd146c50d9..d7bcd074d383 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
@@ -745,7 +745,7 @@ static struct uart_ops mpc52xx_uart_ops = { | |||
745 | static inline int | 745 | static inline int |
746 | mpc52xx_uart_int_rx_chars(struct uart_port *port) | 746 | mpc52xx_uart_int_rx_chars(struct uart_port *port) |
747 | { | 747 | { |
748 | struct tty_struct *tty = port->info->port.tty; | 748 | struct tty_struct *tty = port->state->port.tty; |
749 | unsigned char ch, flag; | 749 | unsigned char ch, flag; |
750 | unsigned short status; | 750 | unsigned short status; |
751 | 751 | ||
@@ -812,7 +812,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port) | |||
812 | static inline int | 812 | static inline int |
813 | mpc52xx_uart_int_tx_chars(struct uart_port *port) | 813 | mpc52xx_uart_int_tx_chars(struct uart_port *port) |
814 | { | 814 | { |
815 | struct circ_buf *xmit = &port->info->xmit; | 815 | struct circ_buf *xmit = &port->state->xmit; |
816 | 816 | ||
817 | /* Process out of band chars */ | 817 | /* Process out of band chars */ |
818 | if (port->x_char) { | 818 | if (port->x_char) { |
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c index 61d3ade5286c..b5496c28e60b 100644 --- a/drivers/serial/mpsc.c +++ b/drivers/serial/mpsc.c | |||
@@ -936,7 +936,7 @@ static int serial_polled; | |||
936 | static int mpsc_rx_intr(struct mpsc_port_info *pi) | 936 | static int mpsc_rx_intr(struct mpsc_port_info *pi) |
937 | { | 937 | { |
938 | struct mpsc_rx_desc *rxre; | 938 | struct mpsc_rx_desc *rxre; |
939 | struct tty_struct *tty = pi->port.info->port.tty; | 939 | struct tty_struct *tty = pi->port.state->port.tty; |
940 | u32 cmdstat, bytes_in, i; | 940 | u32 cmdstat, bytes_in, i; |
941 | int rc = 0; | 941 | int rc = 0; |
942 | u8 *bp; | 942 | u8 *bp; |
@@ -1109,7 +1109,7 @@ static void mpsc_setup_tx_desc(struct mpsc_port_info *pi, u32 count, u32 intr) | |||
1109 | 1109 | ||
1110 | static void mpsc_copy_tx_data(struct mpsc_port_info *pi) | 1110 | static void mpsc_copy_tx_data(struct mpsc_port_info *pi) |
1111 | { | 1111 | { |
1112 | struct circ_buf *xmit = &pi->port.info->xmit; | 1112 | struct circ_buf *xmit = &pi->port.state->xmit; |
1113 | u8 *bp; | 1113 | u8 *bp; |
1114 | u32 i; | 1114 | u32 i; |
1115 | 1115 | ||
diff --git a/drivers/serial/msm_serial.c b/drivers/serial/msm_serial.c index f7c24baa1416..b05c5aa02cb4 100644 --- a/drivers/serial/msm_serial.c +++ b/drivers/serial/msm_serial.c | |||
@@ -88,7 +88,7 @@ static void msm_enable_ms(struct uart_port *port) | |||
88 | 88 | ||
89 | static void handle_rx(struct uart_port *port) | 89 | static void handle_rx(struct uart_port *port) |
90 | { | 90 | { |
91 | struct tty_struct *tty = port->info->port.tty; | 91 | struct tty_struct *tty = port->state->port.tty; |
92 | unsigned int sr; | 92 | unsigned int sr; |
93 | 93 | ||
94 | /* | 94 | /* |
@@ -136,7 +136,7 @@ static void handle_rx(struct uart_port *port) | |||
136 | 136 | ||
137 | static void handle_tx(struct uart_port *port) | 137 | static void handle_tx(struct uart_port *port) |
138 | { | 138 | { |
139 | struct circ_buf *xmit = &port->info->xmit; | 139 | struct circ_buf *xmit = &port->state->xmit; |
140 | struct msm_port *msm_port = UART_TO_MSM(port); | 140 | struct msm_port *msm_port = UART_TO_MSM(port); |
141 | int sent_tx; | 141 | int sent_tx; |
142 | 142 | ||
@@ -169,7 +169,7 @@ static void handle_delta_cts(struct uart_port *port) | |||
169 | { | 169 | { |
170 | msm_write(port, UART_CR_CMD_RESET_CTS, UART_CR); | 170 | msm_write(port, UART_CR_CMD_RESET_CTS, UART_CR); |
171 | port->icount.cts++; | 171 | port->icount.cts++; |
172 | wake_up_interruptible(&port->info->delta_msr_wait); | 172 | wake_up_interruptible(&port->state->port.delta_msr_wait); |
173 | } | 173 | } |
174 | 174 | ||
175 | static irqreturn_t msm_irq(int irq, void *dev_id) | 175 | static irqreturn_t msm_irq(int irq, void *dev_id) |
diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c index 953a5ffa9b44..7571aaa138b0 100644 --- a/drivers/serial/mux.c +++ b/drivers/serial/mux.c | |||
@@ -199,7 +199,7 @@ static void mux_break_ctl(struct uart_port *port, int break_state) | |||
199 | static void mux_write(struct uart_port *port) | 199 | static void mux_write(struct uart_port *port) |
200 | { | 200 | { |
201 | int count; | 201 | int count; |
202 | struct circ_buf *xmit = &port->info->xmit; | 202 | struct circ_buf *xmit = &port->state->xmit; |
203 | 203 | ||
204 | if(port->x_char) { | 204 | if(port->x_char) { |
205 | UART_PUT_CHAR(port, port->x_char); | 205 | UART_PUT_CHAR(port, port->x_char); |
@@ -243,7 +243,7 @@ static void mux_write(struct uart_port *port) | |||
243 | static void mux_read(struct uart_port *port) | 243 | static void mux_read(struct uart_port *port) |
244 | { | 244 | { |
245 | int data; | 245 | int data; |
246 | struct tty_struct *tty = port->info->port.tty; | 246 | struct tty_struct *tty = port->state->port.tty; |
247 | __u32 start_count = port->icount.rx; | 247 | __u32 start_count = port->icount.rx; |
248 | 248 | ||
249 | while(1) { | 249 | while(1) { |
diff --git a/drivers/serial/netx-serial.c b/drivers/serial/netx-serial.c index 3e5dda8518b7..7735c9f35fa0 100644 --- a/drivers/serial/netx-serial.c +++ b/drivers/serial/netx-serial.c | |||
@@ -140,7 +140,7 @@ static void netx_enable_ms(struct uart_port *port) | |||
140 | 140 | ||
141 | static inline void netx_transmit_buffer(struct uart_port *port) | 141 | static inline void netx_transmit_buffer(struct uart_port *port) |
142 | { | 142 | { |
143 | struct circ_buf *xmit = &port->info->xmit; | 143 | struct circ_buf *xmit = &port->state->xmit; |
144 | 144 | ||
145 | if (port->x_char) { | 145 | if (port->x_char) { |
146 | writel(port->x_char, port->membase + UART_DR); | 146 | writel(port->x_char, port->membase + UART_DR); |
@@ -185,7 +185,7 @@ static unsigned int netx_tx_empty(struct uart_port *port) | |||
185 | 185 | ||
186 | static void netx_txint(struct uart_port *port) | 186 | static void netx_txint(struct uart_port *port) |
187 | { | 187 | { |
188 | struct circ_buf *xmit = &port->info->xmit; | 188 | struct circ_buf *xmit = &port->state->xmit; |
189 | 189 | ||
190 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { | 190 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { |
191 | netx_stop_tx(port); | 191 | netx_stop_tx(port); |
@@ -201,7 +201,7 @@ static void netx_txint(struct uart_port *port) | |||
201 | static void netx_rxint(struct uart_port *port) | 201 | static void netx_rxint(struct uart_port *port) |
202 | { | 202 | { |
203 | unsigned char rx, flg, status; | 203 | unsigned char rx, flg, status; |
204 | struct tty_struct *tty = port->info->port.tty; | 204 | struct tty_struct *tty = port->state->port.tty; |
205 | 205 | ||
206 | while (!(readl(port->membase + UART_FR) & FR_RXFE)) { | 206 | while (!(readl(port->membase + UART_FR) & FR_RXFE)) { |
207 | rx = readl(port->membase + UART_DR); | 207 | rx = readl(port->membase + UART_DR); |
diff --git a/drivers/serial/nwpserial.c b/drivers/serial/nwpserial.c index 9e150b19d726..e1ab8ec0a4a6 100644 --- a/drivers/serial/nwpserial.c +++ b/drivers/serial/nwpserial.c | |||
@@ -126,7 +126,7 @@ static void nwpserial_config_port(struct uart_port *port, int flags) | |||
126 | static irqreturn_t nwpserial_interrupt(int irq, void *dev_id) | 126 | static irqreturn_t nwpserial_interrupt(int irq, void *dev_id) |
127 | { | 127 | { |
128 | struct nwpserial_port *up = dev_id; | 128 | struct nwpserial_port *up = dev_id; |
129 | struct tty_struct *tty = up->port.info->port.tty; | 129 | struct tty_struct *tty = up->port.state->port.tty; |
130 | irqreturn_t ret; | 130 | irqreturn_t ret; |
131 | unsigned int iir; | 131 | unsigned int iir; |
132 | unsigned char ch; | 132 | unsigned char ch; |
@@ -261,7 +261,7 @@ static void nwpserial_start_tx(struct uart_port *port) | |||
261 | struct nwpserial_port *up; | 261 | struct nwpserial_port *up; |
262 | struct circ_buf *xmit; | 262 | struct circ_buf *xmit; |
263 | up = container_of(port, struct nwpserial_port, port); | 263 | up = container_of(port, struct nwpserial_port, port); |
264 | xmit = &up->port.info->xmit; | 264 | xmit = &up->port.state->xmit; |
265 | 265 | ||
266 | if (port->x_char) { | 266 | if (port->x_char) { |
267 | nwpserial_putchar(up, up->port.x_char); | 267 | nwpserial_putchar(up, up->port.x_char); |
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index 9c1243fbd512..0700cd10b97c 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c | |||
@@ -242,12 +242,12 @@ static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap) | |||
242 | } | 242 | } |
243 | 243 | ||
244 | /* Sanity check, make sure the old bug is no longer happening */ | 244 | /* Sanity check, make sure the old bug is no longer happening */ |
245 | if (uap->port.info == NULL || uap->port.info->port.tty == NULL) { | 245 | if (uap->port.state == NULL || uap->port.state->port.tty == NULL) { |
246 | WARN_ON(1); | 246 | WARN_ON(1); |
247 | (void)read_zsdata(uap); | 247 | (void)read_zsdata(uap); |
248 | return NULL; | 248 | return NULL; |
249 | } | 249 | } |
250 | tty = uap->port.info->port.tty; | 250 | tty = uap->port.state->port.tty; |
251 | 251 | ||
252 | while (1) { | 252 | while (1) { |
253 | error = 0; | 253 | error = 0; |
@@ -369,7 +369,7 @@ static void pmz_status_handle(struct uart_pmac_port *uap) | |||
369 | uart_handle_cts_change(&uap->port, | 369 | uart_handle_cts_change(&uap->port, |
370 | !(status & CTS)); | 370 | !(status & CTS)); |
371 | 371 | ||
372 | wake_up_interruptible(&uap->port.info->delta_msr_wait); | 372 | wake_up_interruptible(&uap->port.state->port.delta_msr_wait); |
373 | } | 373 | } |
374 | 374 | ||
375 | if (status & BRK_ABRT) | 375 | if (status & BRK_ABRT) |
@@ -420,9 +420,9 @@ static void pmz_transmit_chars(struct uart_pmac_port *uap) | |||
420 | return; | 420 | return; |
421 | } | 421 | } |
422 | 422 | ||
423 | if (uap->port.info == NULL) | 423 | if (uap->port.state == NULL) |
424 | goto ack_tx_int; | 424 | goto ack_tx_int; |
425 | xmit = &uap->port.info->xmit; | 425 | xmit = &uap->port.state->xmit; |
426 | if (uart_circ_empty(xmit)) { | 426 | if (uart_circ_empty(xmit)) { |
427 | uart_write_wakeup(&uap->port); | 427 | uart_write_wakeup(&uap->port); |
428 | goto ack_tx_int; | 428 | goto ack_tx_int; |
@@ -655,7 +655,7 @@ static void pmz_start_tx(struct uart_port *port) | |||
655 | port->icount.tx++; | 655 | port->icount.tx++; |
656 | port->x_char = 0; | 656 | port->x_char = 0; |
657 | } else { | 657 | } else { |
658 | struct circ_buf *xmit = &port->info->xmit; | 658 | struct circ_buf *xmit = &port->state->xmit; |
659 | 659 | ||
660 | write_zsdata(uap, xmit->buf[xmit->tail]); | 660 | write_zsdata(uap, xmit->buf[xmit->tail]); |
661 | zssync(uap); | 661 | zssync(uap); |
@@ -1645,7 +1645,7 @@ static int pmz_suspend(struct macio_dev *mdev, pm_message_t pm_state) | |||
1645 | state = pmz_uart_reg.state + uap->port.line; | 1645 | state = pmz_uart_reg.state + uap->port.line; |
1646 | 1646 | ||
1647 | mutex_lock(&pmz_irq_mutex); | 1647 | mutex_lock(&pmz_irq_mutex); |
1648 | mutex_lock(&state->mutex); | 1648 | mutex_lock(&state->port.mutex); |
1649 | 1649 | ||
1650 | spin_lock_irqsave(&uap->port.lock, flags); | 1650 | spin_lock_irqsave(&uap->port.lock, flags); |
1651 | 1651 | ||
@@ -1676,7 +1676,7 @@ static int pmz_suspend(struct macio_dev *mdev, pm_message_t pm_state) | |||
1676 | /* Shut the chip down */ | 1676 | /* Shut the chip down */ |
1677 | pmz_set_scc_power(uap, 0); | 1677 | pmz_set_scc_power(uap, 0); |
1678 | 1678 | ||
1679 | mutex_unlock(&state->mutex); | 1679 | mutex_unlock(&state->port.mutex); |
1680 | mutex_unlock(&pmz_irq_mutex); | 1680 | mutex_unlock(&pmz_irq_mutex); |
1681 | 1681 | ||
1682 | pmz_debug("suspend, switching complete\n"); | 1682 | pmz_debug("suspend, switching complete\n"); |
@@ -1705,7 +1705,7 @@ static int pmz_resume(struct macio_dev *mdev) | |||
1705 | state = pmz_uart_reg.state + uap->port.line; | 1705 | state = pmz_uart_reg.state + uap->port.line; |
1706 | 1706 | ||
1707 | mutex_lock(&pmz_irq_mutex); | 1707 | mutex_lock(&pmz_irq_mutex); |
1708 | mutex_lock(&state->mutex); | 1708 | mutex_lock(&state->port.mutex); |
1709 | 1709 | ||
1710 | spin_lock_irqsave(&uap->port.lock, flags); | 1710 | spin_lock_irqsave(&uap->port.lock, flags); |
1711 | if (!ZS_IS_OPEN(uap) && !ZS_IS_CONS(uap)) { | 1711 | if (!ZS_IS_OPEN(uap) && !ZS_IS_CONS(uap)) { |
@@ -1737,7 +1737,7 @@ static int pmz_resume(struct macio_dev *mdev) | |||
1737 | } | 1737 | } |
1738 | 1738 | ||
1739 | bail: | 1739 | bail: |
1740 | mutex_unlock(&state->mutex); | 1740 | mutex_unlock(&state->port.mutex); |
1741 | mutex_unlock(&pmz_irq_mutex); | 1741 | mutex_unlock(&pmz_irq_mutex); |
1742 | 1742 | ||
1743 | /* Right now, we deal with delay by blocking here, I'll be | 1743 | /* Right now, we deal with delay by blocking here, I'll be |
diff --git a/drivers/serial/pnx8xxx_uart.c b/drivers/serial/pnx8xxx_uart.c index 1bb8f1b45767..0aa75a97531c 100644 --- a/drivers/serial/pnx8xxx_uart.c +++ b/drivers/serial/pnx8xxx_uart.c | |||
@@ -100,7 +100,7 @@ static void pnx8xxx_mctrl_check(struct pnx8xxx_port *sport) | |||
100 | if (changed & TIOCM_CTS) | 100 | if (changed & TIOCM_CTS) |
101 | uart_handle_cts_change(&sport->port, status & TIOCM_CTS); | 101 | uart_handle_cts_change(&sport->port, status & TIOCM_CTS); |
102 | 102 | ||
103 | wake_up_interruptible(&sport->port.info->delta_msr_wait); | 103 | wake_up_interruptible(&sport->port.state->port.delta_msr_wait); |
104 | } | 104 | } |
105 | 105 | ||
106 | /* | 106 | /* |
@@ -112,7 +112,7 @@ static void pnx8xxx_timeout(unsigned long data) | |||
112 | struct pnx8xxx_port *sport = (struct pnx8xxx_port *)data; | 112 | struct pnx8xxx_port *sport = (struct pnx8xxx_port *)data; |
113 | unsigned long flags; | 113 | unsigned long flags; |
114 | 114 | ||
115 | if (sport->port.info) { | 115 | if (sport->port.state) { |
116 | spin_lock_irqsave(&sport->port.lock, flags); | 116 | spin_lock_irqsave(&sport->port.lock, flags); |
117 | pnx8xxx_mctrl_check(sport); | 117 | pnx8xxx_mctrl_check(sport); |
118 | spin_unlock_irqrestore(&sport->port.lock, flags); | 118 | spin_unlock_irqrestore(&sport->port.lock, flags); |
@@ -181,7 +181,7 @@ static void pnx8xxx_enable_ms(struct uart_port *port) | |||
181 | 181 | ||
182 | static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) | 182 | static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) |
183 | { | 183 | { |
184 | struct tty_struct *tty = sport->port.info->port.tty; | 184 | struct tty_struct *tty = sport->port.state->port.tty; |
185 | unsigned int status, ch, flg; | 185 | unsigned int status, ch, flg; |
186 | 186 | ||
187 | status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) | | 187 | status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) | |
@@ -243,7 +243,7 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) | |||
243 | 243 | ||
244 | static void pnx8xxx_tx_chars(struct pnx8xxx_port *sport) | 244 | static void pnx8xxx_tx_chars(struct pnx8xxx_port *sport) |
245 | { | 245 | { |
246 | struct circ_buf *xmit = &sport->port.info->xmit; | 246 | struct circ_buf *xmit = &sport->port.state->xmit; |
247 | 247 | ||
248 | if (sport->port.x_char) { | 248 | if (sport->port.x_char) { |
249 | serial_out(sport, PNX8XXX_FIFO, sport->port.x_char); | 249 | serial_out(sport, PNX8XXX_FIFO, sport->port.x_char); |
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index 514971fb5bff..b8629d74f6a2 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c | |||
@@ -96,7 +96,7 @@ static void serial_pxa_stop_rx(struct uart_port *port) | |||
96 | 96 | ||
97 | static inline void receive_chars(struct uart_pxa_port *up, int *status) | 97 | static inline void receive_chars(struct uart_pxa_port *up, int *status) |
98 | { | 98 | { |
99 | struct tty_struct *tty = up->port.info->port.tty; | 99 | struct tty_struct *tty = up->port.state->port.tty; |
100 | unsigned int ch, flag; | 100 | unsigned int ch, flag; |
101 | int max_count = 256; | 101 | int max_count = 256; |
102 | 102 | ||
@@ -161,7 +161,7 @@ static inline void receive_chars(struct uart_pxa_port *up, int *status) | |||
161 | 161 | ||
162 | static void transmit_chars(struct uart_pxa_port *up) | 162 | static void transmit_chars(struct uart_pxa_port *up) |
163 | { | 163 | { |
164 | struct circ_buf *xmit = &up->port.info->xmit; | 164 | struct circ_buf *xmit = &up->port.state->xmit; |
165 | int count; | 165 | int count; |
166 | 166 | ||
167 | if (up->port.x_char) { | 167 | if (up->port.x_char) { |
@@ -220,7 +220,7 @@ static inline void check_modem_status(struct uart_pxa_port *up) | |||
220 | if (status & UART_MSR_DCTS) | 220 | if (status & UART_MSR_DCTS) |
221 | uart_handle_cts_change(&up->port, status & UART_MSR_CTS); | 221 | uart_handle_cts_change(&up->port, status & UART_MSR_CTS); |
222 | 222 | ||
223 | wake_up_interruptible(&up->port.info->delta_msr_wait); | 223 | wake_up_interruptible(&up->port.state->port.delta_msr_wait); |
224 | } | 224 | } |
225 | 225 | ||
226 | /* | 226 | /* |
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index 94530f01521e..7f5e26873220 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c | |||
@@ -117,7 +117,7 @@ static void sa1100_mctrl_check(struct sa1100_port *sport) | |||
117 | if (changed & TIOCM_CTS) | 117 | if (changed & TIOCM_CTS) |
118 | uart_handle_cts_change(&sport->port, status & TIOCM_CTS); | 118 | uart_handle_cts_change(&sport->port, status & TIOCM_CTS); |
119 | 119 | ||
120 | wake_up_interruptible(&sport->port.info->delta_msr_wait); | 120 | wake_up_interruptible(&sport->port.state->port.delta_msr_wait); |
121 | } | 121 | } |
122 | 122 | ||
123 | /* | 123 | /* |
@@ -129,7 +129,7 @@ static void sa1100_timeout(unsigned long data) | |||
129 | struct sa1100_port *sport = (struct sa1100_port *)data; | 129 | struct sa1100_port *sport = (struct sa1100_port *)data; |
130 | unsigned long flags; | 130 | unsigned long flags; |
131 | 131 | ||
132 | if (sport->port.info) { | 132 | if (sport->port.state) { |
133 | spin_lock_irqsave(&sport->port.lock, flags); | 133 | spin_lock_irqsave(&sport->port.lock, flags); |
134 | sa1100_mctrl_check(sport); | 134 | sa1100_mctrl_check(sport); |
135 | spin_unlock_irqrestore(&sport->port.lock, flags); | 135 | spin_unlock_irqrestore(&sport->port.lock, flags); |
@@ -189,7 +189,7 @@ static void sa1100_enable_ms(struct uart_port *port) | |||
189 | static void | 189 | static void |
190 | sa1100_rx_chars(struct sa1100_port *sport) | 190 | sa1100_rx_chars(struct sa1100_port *sport) |
191 | { | 191 | { |
192 | struct tty_struct *tty = sport->port.info->port.tty; | 192 | struct tty_struct *tty = sport->port.state->port.tty; |
193 | unsigned int status, ch, flg; | 193 | unsigned int status, ch, flg; |
194 | 194 | ||
195 | status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | | 195 | status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | |
@@ -239,7 +239,7 @@ sa1100_rx_chars(struct sa1100_port *sport) | |||
239 | 239 | ||
240 | static void sa1100_tx_chars(struct sa1100_port *sport) | 240 | static void sa1100_tx_chars(struct sa1100_port *sport) |
241 | { | 241 | { |
242 | struct circ_buf *xmit = &sport->port.info->xmit; | 242 | struct circ_buf *xmit = &sport->port.state->xmit; |
243 | 243 | ||
244 | if (sport->port.x_char) { | 244 | if (sport->port.x_char) { |
245 | UART_PUT_CHAR(sport, sport->port.x_char); | 245 | UART_PUT_CHAR(sport, sport->port.x_char); |
diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c index c8851a0db63a..1523e8d9ae77 100644 --- a/drivers/serial/samsung.c +++ b/drivers/serial/samsung.c | |||
@@ -196,7 +196,7 @@ s3c24xx_serial_rx_chars(int irq, void *dev_id) | |||
196 | { | 196 | { |
197 | struct s3c24xx_uart_port *ourport = dev_id; | 197 | struct s3c24xx_uart_port *ourport = dev_id; |
198 | struct uart_port *port = &ourport->port; | 198 | struct uart_port *port = &ourport->port; |
199 | struct tty_struct *tty = port->info->port.tty; | 199 | struct tty_struct *tty = port->state->port.tty; |
200 | unsigned int ufcon, ch, flag, ufstat, uerstat; | 200 | unsigned int ufcon, ch, flag, ufstat, uerstat; |
201 | int max_count = 64; | 201 | int max_count = 64; |
202 | 202 | ||
@@ -281,7 +281,7 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id) | |||
281 | { | 281 | { |
282 | struct s3c24xx_uart_port *ourport = id; | 282 | struct s3c24xx_uart_port *ourport = id; |
283 | struct uart_port *port = &ourport->port; | 283 | struct uart_port *port = &ourport->port; |
284 | struct circ_buf *xmit = &port->info->xmit; | 284 | struct circ_buf *xmit = &port->state->xmit; |
285 | int count = 256; | 285 | int count = 256; |
286 | 286 | ||
287 | if (port->x_char) { | 287 | if (port->x_char) { |
@@ -992,10 +992,10 @@ static int s3c24xx_serial_cpufreq_transition(struct notifier_block *nb, | |||
992 | struct ktermios *termios; | 992 | struct ktermios *termios; |
993 | struct tty_struct *tty; | 993 | struct tty_struct *tty; |
994 | 994 | ||
995 | if (uport->info == NULL) | 995 | if (uport->state == NULL) |
996 | goto exit; | 996 | goto exit; |
997 | 997 | ||
998 | tty = uport->info->port.tty; | 998 | tty = uport->state->port.tty; |
999 | 999 | ||
1000 | if (tty == NULL) | 1000 | if (tty == NULL) |
1001 | goto exit; | 1001 | goto exit; |
diff --git a/drivers/serial/sb1250-duart.c b/drivers/serial/sb1250-duart.c index 319e8b83f6be..a2f2b3254499 100644 --- a/drivers/serial/sb1250-duart.c +++ b/drivers/serial/sb1250-duart.c | |||
@@ -384,13 +384,13 @@ static void sbd_receive_chars(struct sbd_port *sport) | |||
384 | uart_insert_char(uport, status, M_DUART_OVRUN_ERR, ch, flag); | 384 | uart_insert_char(uport, status, M_DUART_OVRUN_ERR, ch, flag); |
385 | } | 385 | } |
386 | 386 | ||
387 | tty_flip_buffer_push(uport->info->port.tty); | 387 | tty_flip_buffer_push(uport->state->port.tty); |
388 | } | 388 | } |
389 | 389 | ||
390 | static void sbd_transmit_chars(struct sbd_port *sport) | 390 | static void sbd_transmit_chars(struct sbd_port *sport) |
391 | { | 391 | { |
392 | struct uart_port *uport = &sport->port; | 392 | struct uart_port *uport = &sport->port; |
393 | struct circ_buf *xmit = &sport->port.info->xmit; | 393 | struct circ_buf *xmit = &sport->port.state->xmit; |
394 | unsigned int mask; | 394 | unsigned int mask; |
395 | int stop_tx; | 395 | int stop_tx; |
396 | 396 | ||
@@ -440,7 +440,7 @@ static void sbd_status_handle(struct sbd_port *sport) | |||
440 | 440 | ||
441 | if (delta & ((M_DUART_IN_PIN2_VAL | M_DUART_IN_PIN0_VAL) << | 441 | if (delta & ((M_DUART_IN_PIN2_VAL | M_DUART_IN_PIN0_VAL) << |
442 | S_DUART_IN_PIN_CHNG)) | 442 | S_DUART_IN_PIN_CHNG)) |
443 | wake_up_interruptible(&uport->info->delta_msr_wait); | 443 | wake_up_interruptible(&uport->state->port.delta_msr_wait); |
444 | } | 444 | } |
445 | 445 | ||
446 | static irqreturn_t sbd_interrupt(int irq, void *dev_id) | 446 | static irqreturn_t sbd_interrupt(int irq, void *dev_id) |
diff --git a/drivers/serial/sc26xx.c b/drivers/serial/sc26xx.c index e0be11ceaa25..75038ad2b242 100644 --- a/drivers/serial/sc26xx.c +++ b/drivers/serial/sc26xx.c | |||
@@ -140,8 +140,8 @@ static struct tty_struct *receive_chars(struct uart_port *port) | |||
140 | char flag; | 140 | char flag; |
141 | u8 status; | 141 | u8 status; |
142 | 142 | ||
143 | if (port->info != NULL) /* Unopened serial console */ | 143 | if (port->state != NULL) /* Unopened serial console */ |
144 | tty = port->info->port.tty; | 144 | tty = port->state->port.tty; |
145 | 145 | ||
146 | while (limit-- > 0) { | 146 | while (limit-- > 0) { |
147 | status = READ_SC_PORT(port, SR); | 147 | status = READ_SC_PORT(port, SR); |
@@ -190,10 +190,10 @@ static void transmit_chars(struct uart_port *port) | |||
190 | { | 190 | { |
191 | struct circ_buf *xmit; | 191 | struct circ_buf *xmit; |
192 | 192 | ||
193 | if (!port->info) | 193 | if (!port->state) |
194 | return; | 194 | return; |
195 | 195 | ||
196 | xmit = &port->info->xmit; | 196 | xmit = &port->state->xmit; |
197 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { | 197 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { |
198 | sc26xx_disable_irq(port, IMR_TXRDY); | 198 | sc26xx_disable_irq(port, IMR_TXRDY); |
199 | return; | 199 | return; |
@@ -316,7 +316,7 @@ static void sc26xx_stop_tx(struct uart_port *port) | |||
316 | /* port->lock held by caller. */ | 316 | /* port->lock held by caller. */ |
317 | static void sc26xx_start_tx(struct uart_port *port) | 317 | static void sc26xx_start_tx(struct uart_port *port) |
318 | { | 318 | { |
319 | struct circ_buf *xmit = &port->info->xmit; | 319 | struct circ_buf *xmit = &port->state->xmit; |
320 | 320 | ||
321 | while (!uart_circ_empty(xmit)) { | 321 | while (!uart_circ_empty(xmit)) { |
322 | if (!(READ_SC_PORT(port, SR) & SR_TXRDY)) { | 322 | if (!(READ_SC_PORT(port, SR) & SR_TXRDY)) { |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index b0bb29d804ae..1689bda1d13b 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -29,10 +29,10 @@ | |||
29 | #include <linux/console.h> | 29 | #include <linux/console.h> |
30 | #include <linux/proc_fs.h> | 30 | #include <linux/proc_fs.h> |
31 | #include <linux/seq_file.h> | 31 | #include <linux/seq_file.h> |
32 | #include <linux/serial_core.h> | ||
33 | #include <linux/smp_lock.h> | 32 | #include <linux/smp_lock.h> |
34 | #include <linux/device.h> | 33 | #include <linux/device.h> |
35 | #include <linux/serial.h> /* for serial_state and serial_icounter_struct */ | 34 | #include <linux/serial.h> /* for serial_state and serial_icounter_struct */ |
35 | #include <linux/serial_core.h> | ||
36 | #include <linux/delay.h> | 36 | #include <linux/delay.h> |
37 | #include <linux/mutex.h> | 37 | #include <linux/mutex.h> |
38 | 38 | ||
@@ -52,8 +52,6 @@ static struct lock_class_key port_lock_key; | |||
52 | 52 | ||
53 | #define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) | 53 | #define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) |
54 | 54 | ||
55 | #define uart_users(state) ((state)->count + (state)->info.port.blocked_open) | ||
56 | |||
57 | #ifdef CONFIG_SERIAL_CORE_CONSOLE | 55 | #ifdef CONFIG_SERIAL_CORE_CONSOLE |
58 | #define uart_console(port) ((port)->cons && (port)->cons->index == (port)->line) | 56 | #define uart_console(port) ((port)->cons && (port)->cons->index == (port)->line) |
59 | #else | 57 | #else |
@@ -71,19 +69,19 @@ static void uart_change_pm(struct uart_state *state, int pm_state); | |||
71 | */ | 69 | */ |
72 | void uart_write_wakeup(struct uart_port *port) | 70 | void uart_write_wakeup(struct uart_port *port) |
73 | { | 71 | { |
74 | struct uart_info *info = port->info; | 72 | struct uart_state *state = port->state; |
75 | /* | 73 | /* |
76 | * This means you called this function _after_ the port was | 74 | * This means you called this function _after_ the port was |
77 | * closed. No cookie for you. | 75 | * closed. No cookie for you. |
78 | */ | 76 | */ |
79 | BUG_ON(!info); | 77 | BUG_ON(!state); |
80 | tasklet_schedule(&info->tlet); | 78 | tasklet_schedule(&state->tlet); |
81 | } | 79 | } |
82 | 80 | ||
83 | static void uart_stop(struct tty_struct *tty) | 81 | static void uart_stop(struct tty_struct *tty) |
84 | { | 82 | { |
85 | struct uart_state *state = tty->driver_data; | 83 | struct uart_state *state = tty->driver_data; |
86 | struct uart_port *port = state->port; | 84 | struct uart_port *port = state->uart_port; |
87 | unsigned long flags; | 85 | unsigned long flags; |
88 | 86 | ||
89 | spin_lock_irqsave(&port->lock, flags); | 87 | spin_lock_irqsave(&port->lock, flags); |
@@ -94,9 +92,9 @@ static void uart_stop(struct tty_struct *tty) | |||
94 | static void __uart_start(struct tty_struct *tty) | 92 | static void __uart_start(struct tty_struct *tty) |
95 | { | 93 | { |
96 | struct uart_state *state = tty->driver_data; | 94 | struct uart_state *state = tty->driver_data; |
97 | struct uart_port *port = state->port; | 95 | struct uart_port *port = state->uart_port; |
98 | 96 | ||
99 | if (!uart_circ_empty(&state->info.xmit) && state->info.xmit.buf && | 97 | if (!uart_circ_empty(&state->xmit) && state->xmit.buf && |
100 | !tty->stopped && !tty->hw_stopped) | 98 | !tty->stopped && !tty->hw_stopped) |
101 | port->ops->start_tx(port); | 99 | port->ops->start_tx(port); |
102 | } | 100 | } |
@@ -104,7 +102,7 @@ static void __uart_start(struct tty_struct *tty) | |||
104 | static void uart_start(struct tty_struct *tty) | 102 | static void uart_start(struct tty_struct *tty) |
105 | { | 103 | { |
106 | struct uart_state *state = tty->driver_data; | 104 | struct uart_state *state = tty->driver_data; |
107 | struct uart_port *port = state->port; | 105 | struct uart_port *port = state->uart_port; |
108 | unsigned long flags; | 106 | unsigned long flags; |
109 | 107 | ||
110 | spin_lock_irqsave(&port->lock, flags); | 108 | spin_lock_irqsave(&port->lock, flags); |
@@ -115,7 +113,7 @@ static void uart_start(struct tty_struct *tty) | |||
115 | static void uart_tasklet_action(unsigned long data) | 113 | static void uart_tasklet_action(unsigned long data) |
116 | { | 114 | { |
117 | struct uart_state *state = (struct uart_state *)data; | 115 | struct uart_state *state = (struct uart_state *)data; |
118 | tty_wakeup(state->info.port.tty); | 116 | tty_wakeup(state->port.tty); |
119 | } | 117 | } |
120 | 118 | ||
121 | static inline void | 119 | static inline void |
@@ -141,12 +139,12 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear) | |||
141 | */ | 139 | */ |
142 | static int uart_startup(struct uart_state *state, int init_hw) | 140 | static int uart_startup(struct uart_state *state, int init_hw) |
143 | { | 141 | { |
144 | struct uart_info *info = &state->info; | 142 | struct uart_port *uport = state->uart_port; |
145 | struct uart_port *port = state->port; | 143 | struct tty_port *port = &state->port; |
146 | unsigned long page; | 144 | unsigned long page; |
147 | int retval = 0; | 145 | int retval = 0; |
148 | 146 | ||
149 | if (info->flags & UIF_INITIALIZED) | 147 | if (port->flags & ASYNC_INITIALIZED) |
150 | return 0; | 148 | return 0; |
151 | 149 | ||
152 | /* | 150 | /* |
@@ -154,26 +152,26 @@ static int uart_startup(struct uart_state *state, int init_hw) | |||
154 | * once we have successfully opened the port. Also set | 152 | * once we have successfully opened the port. Also set |
155 | * up the tty->alt_speed kludge | 153 | * up the tty->alt_speed kludge |
156 | */ | 154 | */ |
157 | set_bit(TTY_IO_ERROR, &info->port.tty->flags); | 155 | set_bit(TTY_IO_ERROR, &port->tty->flags); |
158 | 156 | ||
159 | if (port->type == PORT_UNKNOWN) | 157 | if (uport->type == PORT_UNKNOWN) |
160 | return 0; | 158 | return 0; |
161 | 159 | ||
162 | /* | 160 | /* |
163 | * Initialise and allocate the transmit and temporary | 161 | * Initialise and allocate the transmit and temporary |
164 | * buffer. | 162 | * buffer. |
165 | */ | 163 | */ |
166 | if (!info->xmit.buf) { | 164 | if (!state->xmit.buf) { |
167 | /* This is protected by the per port mutex */ | 165 | /* This is protected by the per port mutex */ |
168 | page = get_zeroed_page(GFP_KERNEL); | 166 | page = get_zeroed_page(GFP_KERNEL); |
169 | if (!page) | 167 | if (!page) |
170 | return -ENOMEM; | 168 | return -ENOMEM; |
171 | 169 | ||
172 | info->xmit.buf = (unsigned char *) page; | 170 | state->xmit.buf = (unsigned char *) page; |
173 | uart_circ_clear(&info->xmit); | 171 | uart_circ_clear(&state->xmit); |
174 | } | 172 | } |
175 | 173 | ||
176 | retval = port->ops->startup(port); | 174 | retval = uport->ops->startup(uport); |
177 | if (retval == 0) { | 175 | if (retval == 0) { |
178 | if (init_hw) { | 176 | if (init_hw) { |
179 | /* | 177 | /* |
@@ -185,20 +183,20 @@ static int uart_startup(struct uart_state *state, int init_hw) | |||
185 | * Setup the RTS and DTR signals once the | 183 | * Setup the RTS and DTR signals once the |
186 | * port is open and ready to respond. | 184 | * port is open and ready to respond. |
187 | */ | 185 | */ |
188 | if (info->port.tty->termios->c_cflag & CBAUD) | 186 | if (port->tty->termios->c_cflag & CBAUD) |
189 | uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR); | 187 | uart_set_mctrl(uport, TIOCM_RTS | TIOCM_DTR); |
190 | } | 188 | } |
191 | 189 | ||
192 | if (info->flags & UIF_CTS_FLOW) { | 190 | if (port->flags & ASYNC_CTS_FLOW) { |
193 | spin_lock_irq(&port->lock); | 191 | spin_lock_irq(&uport->lock); |
194 | if (!(port->ops->get_mctrl(port) & TIOCM_CTS)) | 192 | if (!(uport->ops->get_mctrl(uport) & TIOCM_CTS)) |
195 | info->port.tty->hw_stopped = 1; | 193 | port->tty->hw_stopped = 1; |
196 | spin_unlock_irq(&port->lock); | 194 | spin_unlock_irq(&uport->lock); |
197 | } | 195 | } |
198 | 196 | ||
199 | info->flags |= UIF_INITIALIZED; | 197 | set_bit(ASYNCB_INITIALIZED, &port->flags); |
200 | 198 | ||
201 | clear_bit(TTY_IO_ERROR, &info->port.tty->flags); | 199 | clear_bit(TTY_IO_ERROR, &port->tty->flags); |
202 | } | 200 | } |
203 | 201 | ||
204 | if (retval && capable(CAP_SYS_ADMIN)) | 202 | if (retval && capable(CAP_SYS_ADMIN)) |
@@ -214,9 +212,9 @@ static int uart_startup(struct uart_state *state, int init_hw) | |||
214 | */ | 212 | */ |
215 | static void uart_shutdown(struct uart_state *state) | 213 | static void uart_shutdown(struct uart_state *state) |
216 | { | 214 | { |
217 | struct uart_info *info = &state->info; | 215 | struct uart_port *uport = state->uart_port; |
218 | struct uart_port *port = state->port; | 216 | struct tty_port *port = &state->port; |
219 | struct tty_struct *tty = info->port.tty; | 217 | struct tty_struct *tty = port->tty; |
220 | 218 | ||
221 | /* | 219 | /* |
222 | * Set the TTY IO error marker | 220 | * Set the TTY IO error marker |
@@ -224,14 +222,12 @@ static void uart_shutdown(struct uart_state *state) | |||
224 | if (tty) | 222 | if (tty) |
225 | set_bit(TTY_IO_ERROR, &tty->flags); | 223 | set_bit(TTY_IO_ERROR, &tty->flags); |
226 | 224 | ||
227 | if (info->flags & UIF_INITIALIZED) { | 225 | if (test_and_clear_bit(ASYNCB_INITIALIZED, &port->flags)) { |
228 | info->flags &= ~UIF_INITIALIZED; | ||
229 | |||
230 | /* | 226 | /* |
231 | * Turn off DTR and RTS early. | 227 | * Turn off DTR and RTS early. |
232 | */ | 228 | */ |
233 | if (!tty || (tty->termios->c_cflag & HUPCL)) | 229 | if (!tty || (tty->termios->c_cflag & HUPCL)) |
234 | uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); | 230 | uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); |
235 | 231 | ||
236 | /* | 232 | /* |
237 | * clear delta_msr_wait queue to avoid mem leaks: we may free | 233 | * clear delta_msr_wait queue to avoid mem leaks: we may free |
@@ -240,30 +236,30 @@ static void uart_shutdown(struct uart_state *state) | |||
240 | * any outstanding file descriptors should be pointing at | 236 | * any outstanding file descriptors should be pointing at |
241 | * hung_up_tty_fops now. | 237 | * hung_up_tty_fops now. |
242 | */ | 238 | */ |
243 | wake_up_interruptible(&info->delta_msr_wait); | 239 | wake_up_interruptible(&port->delta_msr_wait); |
244 | 240 | ||
245 | /* | 241 | /* |
246 | * Free the IRQ and disable the port. | 242 | * Free the IRQ and disable the port. |
247 | */ | 243 | */ |
248 | port->ops->shutdown(port); | 244 | uport->ops->shutdown(uport); |
249 | 245 | ||
250 | /* | 246 | /* |
251 | * Ensure that the IRQ handler isn't running on another CPU. | 247 | * Ensure that the IRQ handler isn't running on another CPU. |
252 | */ | 248 | */ |
253 | synchronize_irq(port->irq); | 249 | synchronize_irq(uport->irq); |
254 | } | 250 | } |
255 | 251 | ||
256 | /* | 252 | /* |
257 | * kill off our tasklet | 253 | * kill off our tasklet |
258 | */ | 254 | */ |
259 | tasklet_kill(&info->tlet); | 255 | tasklet_kill(&state->tlet); |
260 | 256 | ||
261 | /* | 257 | /* |
262 | * Free the transmit buffer page. | 258 | * Free the transmit buffer page. |
263 | */ | 259 | */ |
264 | if (info->xmit.buf) { | 260 | if (state->xmit.buf) { |
265 | free_page((unsigned long)info->xmit.buf); | 261 | free_page((unsigned long)state->xmit.buf); |
266 | info->xmit.buf = NULL; | 262 | state->xmit.buf = NULL; |
267 | } | 263 | } |
268 | } | 264 | } |
269 | 265 | ||
@@ -430,15 +426,16 @@ EXPORT_SYMBOL(uart_get_divisor); | |||
430 | static void | 426 | static void |
431 | uart_change_speed(struct uart_state *state, struct ktermios *old_termios) | 427 | uart_change_speed(struct uart_state *state, struct ktermios *old_termios) |
432 | { | 428 | { |
433 | struct tty_struct *tty = state->info.port.tty; | 429 | struct tty_port *port = &state->port; |
434 | struct uart_port *port = state->port; | 430 | struct tty_struct *tty = port->tty; |
431 | struct uart_port *uport = state->uart_port; | ||
435 | struct ktermios *termios; | 432 | struct ktermios *termios; |
436 | 433 | ||
437 | /* | 434 | /* |
438 | * If we have no tty, termios, or the port does not exist, | 435 | * If we have no tty, termios, or the port does not exist, |
439 | * then we can't set the parameters for this port. | 436 | * then we can't set the parameters for this port. |
440 | */ | 437 | */ |
441 | if (!tty || !tty->termios || port->type == PORT_UNKNOWN) | 438 | if (!tty || !tty->termios || uport->type == PORT_UNKNOWN) |
442 | return; | 439 | return; |
443 | 440 | ||
444 | termios = tty->termios; | 441 | termios = tty->termios; |
@@ -447,16 +444,16 @@ uart_change_speed(struct uart_state *state, struct ktermios *old_termios) | |||
447 | * Set flags based on termios cflag | 444 | * Set flags based on termios cflag |
448 | */ | 445 | */ |
449 | if (termios->c_cflag & CRTSCTS) | 446 | if (termios->c_cflag & CRTSCTS) |
450 | state->info.flags |= UIF_CTS_FLOW; | 447 | set_bit(ASYNCB_CTS_FLOW, &port->flags); |
451 | else | 448 | else |
452 | state->info.flags &= ~UIF_CTS_FLOW; | 449 | clear_bit(ASYNCB_CTS_FLOW, &port->flags); |
453 | 450 | ||
454 | if (termios->c_cflag & CLOCAL) | 451 | if (termios->c_cflag & CLOCAL) |
455 | state->info.flags &= ~UIF_CHECK_CD; | 452 | clear_bit(ASYNCB_CHECK_CD, &port->flags); |
456 | else | 453 | else |
457 | state->info.flags |= UIF_CHECK_CD; | 454 | set_bit(ASYNCB_CHECK_CD, &port->flags); |
458 | 455 | ||
459 | port->ops->set_termios(port, termios, old_termios); | 456 | uport->ops->set_termios(uport, termios, old_termios); |
460 | } | 457 | } |
461 | 458 | ||
462 | static inline int | 459 | static inline int |
@@ -482,7 +479,7 @@ static int uart_put_char(struct tty_struct *tty, unsigned char ch) | |||
482 | { | 479 | { |
483 | struct uart_state *state = tty->driver_data; | 480 | struct uart_state *state = tty->driver_data; |
484 | 481 | ||
485 | return __uart_put_char(state->port, &state->info.xmit, ch); | 482 | return __uart_put_char(state->uart_port, &state->xmit, ch); |
486 | } | 483 | } |
487 | 484 | ||
488 | static void uart_flush_chars(struct tty_struct *tty) | 485 | static void uart_flush_chars(struct tty_struct *tty) |
@@ -508,8 +505,8 @@ uart_write(struct tty_struct *tty, const unsigned char *buf, int count) | |||
508 | return -EL3HLT; | 505 | return -EL3HLT; |
509 | } | 506 | } |
510 | 507 | ||
511 | port = state->port; | 508 | port = state->uart_port; |
512 | circ = &state->info.xmit; | 509 | circ = &state->xmit; |
513 | 510 | ||
514 | if (!circ->buf) | 511 | if (!circ->buf) |
515 | return 0; | 512 | return 0; |
@@ -539,9 +536,9 @@ static int uart_write_room(struct tty_struct *tty) | |||
539 | unsigned long flags; | 536 | unsigned long flags; |
540 | int ret; | 537 | int ret; |
541 | 538 | ||
542 | spin_lock_irqsave(&state->port->lock, flags); | 539 | spin_lock_irqsave(&state->uart_port->lock, flags); |
543 | ret = uart_circ_chars_free(&state->info.xmit); | 540 | ret = uart_circ_chars_free(&state->xmit); |
544 | spin_unlock_irqrestore(&state->port->lock, flags); | 541 | spin_unlock_irqrestore(&state->uart_port->lock, flags); |
545 | return ret; | 542 | return ret; |
546 | } | 543 | } |
547 | 544 | ||
@@ -551,9 +548,9 @@ static int uart_chars_in_buffer(struct tty_struct *tty) | |||
551 | unsigned long flags; | 548 | unsigned long flags; |
552 | int ret; | 549 | int ret; |
553 | 550 | ||
554 | spin_lock_irqsave(&state->port->lock, flags); | 551 | spin_lock_irqsave(&state->uart_port->lock, flags); |
555 | ret = uart_circ_chars_pending(&state->info.xmit); | 552 | ret = uart_circ_chars_pending(&state->xmit); |
556 | spin_unlock_irqrestore(&state->port->lock, flags); | 553 | spin_unlock_irqrestore(&state->uart_port->lock, flags); |
557 | return ret; | 554 | return ret; |
558 | } | 555 | } |
559 | 556 | ||
@@ -572,11 +569,11 @@ static void uart_flush_buffer(struct tty_struct *tty) | |||
572 | return; | 569 | return; |
573 | } | 570 | } |
574 | 571 | ||
575 | port = state->port; | 572 | port = state->uart_port; |
576 | pr_debug("uart_flush_buffer(%d) called\n", tty->index); | 573 | pr_debug("uart_flush_buffer(%d) called\n", tty->index); |
577 | 574 | ||
578 | spin_lock_irqsave(&port->lock, flags); | 575 | spin_lock_irqsave(&port->lock, flags); |
579 | uart_circ_clear(&state->info.xmit); | 576 | uart_circ_clear(&state->xmit); |
580 | if (port->ops->flush_buffer) | 577 | if (port->ops->flush_buffer) |
581 | port->ops->flush_buffer(port); | 578 | port->ops->flush_buffer(port); |
582 | spin_unlock_irqrestore(&port->lock, flags); | 579 | spin_unlock_irqrestore(&port->lock, flags); |
@@ -590,7 +587,7 @@ static void uart_flush_buffer(struct tty_struct *tty) | |||
590 | static void uart_send_xchar(struct tty_struct *tty, char ch) | 587 | static void uart_send_xchar(struct tty_struct *tty, char ch) |
591 | { | 588 | { |
592 | struct uart_state *state = tty->driver_data; | 589 | struct uart_state *state = tty->driver_data; |
593 | struct uart_port *port = state->port; | 590 | struct uart_port *port = state->uart_port; |
594 | unsigned long flags; | 591 | unsigned long flags; |
595 | 592 | ||
596 | if (port->ops->send_xchar) | 593 | if (port->ops->send_xchar) |
@@ -613,13 +610,13 @@ static void uart_throttle(struct tty_struct *tty) | |||
613 | uart_send_xchar(tty, STOP_CHAR(tty)); | 610 | uart_send_xchar(tty, STOP_CHAR(tty)); |
614 | 611 | ||
615 | if (tty->termios->c_cflag & CRTSCTS) | 612 | if (tty->termios->c_cflag & CRTSCTS) |
616 | uart_clear_mctrl(state->port, TIOCM_RTS); | 613 | uart_clear_mctrl(state->uart_port, TIOCM_RTS); |
617 | } | 614 | } |
618 | 615 | ||
619 | static void uart_unthrottle(struct tty_struct *tty) | 616 | static void uart_unthrottle(struct tty_struct *tty) |
620 | { | 617 | { |
621 | struct uart_state *state = tty->driver_data; | 618 | struct uart_state *state = tty->driver_data; |
622 | struct uart_port *port = state->port; | 619 | struct uart_port *port = state->uart_port; |
623 | 620 | ||
624 | if (I_IXOFF(tty)) { | 621 | if (I_IXOFF(tty)) { |
625 | if (port->x_char) | 622 | if (port->x_char) |
@@ -635,35 +632,36 @@ static void uart_unthrottle(struct tty_struct *tty) | |||
635 | static int uart_get_info(struct uart_state *state, | 632 | static int uart_get_info(struct uart_state *state, |
636 | struct serial_struct __user *retinfo) | 633 | struct serial_struct __user *retinfo) |
637 | { | 634 | { |
638 | struct uart_port *port = state->port; | 635 | struct uart_port *uport = state->uart_port; |
636 | struct tty_port *port = &state->port; | ||
639 | struct serial_struct tmp; | 637 | struct serial_struct tmp; |
640 | 638 | ||
641 | memset(&tmp, 0, sizeof(tmp)); | 639 | memset(&tmp, 0, sizeof(tmp)); |
642 | 640 | ||
643 | /* Ensure the state we copy is consistent and no hardware changes | 641 | /* Ensure the state we copy is consistent and no hardware changes |
644 | occur as we go */ | 642 | occur as we go */ |
645 | mutex_lock(&state->mutex); | 643 | mutex_lock(&port->mutex); |
646 | 644 | ||
647 | tmp.type = port->type; | 645 | tmp.type = uport->type; |
648 | tmp.line = port->line; | 646 | tmp.line = uport->line; |
649 | tmp.port = port->iobase; | 647 | tmp.port = uport->iobase; |
650 | if (HIGH_BITS_OFFSET) | 648 | if (HIGH_BITS_OFFSET) |
651 | tmp.port_high = (long) port->iobase >> HIGH_BITS_OFFSET; | 649 | tmp.port_high = (long) uport->iobase >> HIGH_BITS_OFFSET; |
652 | tmp.irq = port->irq; | 650 | tmp.irq = uport->irq; |
653 | tmp.flags = port->flags; | 651 | tmp.flags = uport->flags; |
654 | tmp.xmit_fifo_size = port->fifosize; | 652 | tmp.xmit_fifo_size = uport->fifosize; |
655 | tmp.baud_base = port->uartclk / 16; | 653 | tmp.baud_base = uport->uartclk / 16; |
656 | tmp.close_delay = state->close_delay / 10; | 654 | tmp.close_delay = port->close_delay / 10; |
657 | tmp.closing_wait = state->closing_wait == USF_CLOSING_WAIT_NONE ? | 655 | tmp.closing_wait = port->closing_wait == ASYNC_CLOSING_WAIT_NONE ? |
658 | ASYNC_CLOSING_WAIT_NONE : | 656 | ASYNC_CLOSING_WAIT_NONE : |
659 | state->closing_wait / 10; | 657 | port->closing_wait / 10; |
660 | tmp.custom_divisor = port->custom_divisor; | 658 | tmp.custom_divisor = uport->custom_divisor; |
661 | tmp.hub6 = port->hub6; | 659 | tmp.hub6 = uport->hub6; |
662 | tmp.io_type = port->iotype; | 660 | tmp.io_type = uport->iotype; |
663 | tmp.iomem_reg_shift = port->regshift; | 661 | tmp.iomem_reg_shift = uport->regshift; |
664 | tmp.iomem_base = (void *)(unsigned long)port->mapbase; | 662 | tmp.iomem_base = (void *)(unsigned long)uport->mapbase; |
665 | 663 | ||
666 | mutex_unlock(&state->mutex); | 664 | mutex_unlock(&port->mutex); |
667 | 665 | ||
668 | if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) | 666 | if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) |
669 | return -EFAULT; | 667 | return -EFAULT; |
@@ -674,7 +672,8 @@ static int uart_set_info(struct uart_state *state, | |||
674 | struct serial_struct __user *newinfo) | 672 | struct serial_struct __user *newinfo) |
675 | { | 673 | { |
676 | struct serial_struct new_serial; | 674 | struct serial_struct new_serial; |
677 | struct uart_port *port = state->port; | 675 | struct uart_port *uport = state->uart_port; |
676 | struct tty_port *port = &state->port; | ||
678 | unsigned long new_port; | 677 | unsigned long new_port; |
679 | unsigned int change_irq, change_port, closing_wait; | 678 | unsigned int change_irq, change_port, closing_wait; |
680 | unsigned int old_custom_divisor, close_delay; | 679 | unsigned int old_custom_divisor, close_delay; |
@@ -691,58 +690,58 @@ static int uart_set_info(struct uart_state *state, | |||
691 | new_serial.irq = irq_canonicalize(new_serial.irq); | 690 | new_serial.irq = irq_canonicalize(new_serial.irq); |
692 | close_delay = new_serial.close_delay * 10; | 691 | close_delay = new_serial.close_delay * 10; |
693 | closing_wait = new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE ? | 692 | closing_wait = new_serial.closing_wait == ASYNC_CLOSING_WAIT_NONE ? |
694 | USF_CLOSING_WAIT_NONE : new_serial.closing_wait * 10; | 693 | ASYNC_CLOSING_WAIT_NONE : new_serial.closing_wait * 10; |
695 | 694 | ||
696 | /* | 695 | /* |
697 | * This semaphore protects state->count. It is also | 696 | * This semaphore protects port->count. It is also |
698 | * very useful to prevent opens. Also, take the | 697 | * very useful to prevent opens. Also, take the |
699 | * port configuration semaphore to make sure that a | 698 | * port configuration semaphore to make sure that a |
700 | * module insertion/removal doesn't change anything | 699 | * module insertion/removal doesn't change anything |
701 | * under us. | 700 | * under us. |
702 | */ | 701 | */ |
703 | mutex_lock(&state->mutex); | 702 | mutex_lock(&port->mutex); |
704 | 703 | ||
705 | change_irq = !(port->flags & UPF_FIXED_PORT) | 704 | change_irq = !(uport->flags & UPF_FIXED_PORT) |
706 | && new_serial.irq != port->irq; | 705 | && new_serial.irq != uport->irq; |
707 | 706 | ||
708 | /* | 707 | /* |
709 | * Since changing the 'type' of the port changes its resource | 708 | * Since changing the 'type' of the port changes its resource |
710 | * allocations, we should treat type changes the same as | 709 | * allocations, we should treat type changes the same as |
711 | * IO port changes. | 710 | * IO port changes. |
712 | */ | 711 | */ |
713 | change_port = !(port->flags & UPF_FIXED_PORT) | 712 | change_port = !(uport->flags & UPF_FIXED_PORT) |
714 | && (new_port != port->iobase || | 713 | && (new_port != uport->iobase || |
715 | (unsigned long)new_serial.iomem_base != port->mapbase || | 714 | (unsigned long)new_serial.iomem_base != uport->mapbase || |
716 | new_serial.hub6 != port->hub6 || | 715 | new_serial.hub6 != uport->hub6 || |
717 | new_serial.io_type != port->iotype || | 716 | new_serial.io_type != uport->iotype || |
718 | new_serial.iomem_reg_shift != port->regshift || | 717 | new_serial.iomem_reg_shift != uport->regshift || |
719 | new_serial.type != port->type); | 718 | new_serial.type != uport->type); |
720 | 719 | ||
721 | old_flags = port->flags; | 720 | old_flags = uport->flags; |
722 | new_flags = new_serial.flags; | 721 | new_flags = new_serial.flags; |
723 | old_custom_divisor = port->custom_divisor; | 722 | old_custom_divisor = uport->custom_divisor; |
724 | 723 | ||
725 | if (!capable(CAP_SYS_ADMIN)) { | 724 | if (!capable(CAP_SYS_ADMIN)) { |
726 | retval = -EPERM; | 725 | retval = -EPERM; |
727 | if (change_irq || change_port || | 726 | if (change_irq || change_port || |
728 | (new_serial.baud_base != port->uartclk / 16) || | 727 | (new_serial.baud_base != uport->uartclk / 16) || |
729 | (close_delay != state->close_delay) || | 728 | (close_delay != port->close_delay) || |
730 | (closing_wait != state->closing_wait) || | 729 | (closing_wait != port->closing_wait) || |
731 | (new_serial.xmit_fifo_size && | 730 | (new_serial.xmit_fifo_size && |
732 | new_serial.xmit_fifo_size != port->fifosize) || | 731 | new_serial.xmit_fifo_size != uport->fifosize) || |
733 | (((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0)) | 732 | (((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0)) |
734 | goto exit; | 733 | goto exit; |
735 | port->flags = ((port->flags & ~UPF_USR_MASK) | | 734 | uport->flags = ((uport->flags & ~UPF_USR_MASK) | |
736 | (new_flags & UPF_USR_MASK)); | 735 | (new_flags & UPF_USR_MASK)); |
737 | port->custom_divisor = new_serial.custom_divisor; | 736 | uport->custom_divisor = new_serial.custom_divisor; |
738 | goto check_and_exit; | 737 | goto check_and_exit; |
739 | } | 738 | } |
740 | 739 | ||
741 | /* | 740 | /* |
742 | * Ask the low level driver to verify the settings. | 741 | * Ask the low level driver to verify the settings. |
743 | */ | 742 | */ |
744 | if (port->ops->verify_port) | 743 | if (uport->ops->verify_port) |
745 | retval = port->ops->verify_port(port, &new_serial); | 744 | retval = uport->ops->verify_port(uport, &new_serial); |
746 | 745 | ||
747 | if ((new_serial.irq >= nr_irqs) || (new_serial.irq < 0) || | 746 | if ((new_serial.irq >= nr_irqs) || (new_serial.irq < 0) || |
748 | (new_serial.baud_base < 9600)) | 747 | (new_serial.baud_base < 9600)) |
@@ -757,7 +756,7 @@ static int uart_set_info(struct uart_state *state, | |||
757 | /* | 756 | /* |
758 | * Make sure that we are the sole user of this port. | 757 | * Make sure that we are the sole user of this port. |
759 | */ | 758 | */ |
760 | if (uart_users(state) > 1) | 759 | if (tty_port_users(port) > 1) |
761 | goto exit; | 760 | goto exit; |
762 | 761 | ||
763 | /* | 762 | /* |
@@ -771,31 +770,31 @@ static int uart_set_info(struct uart_state *state, | |||
771 | unsigned long old_iobase, old_mapbase; | 770 | unsigned long old_iobase, old_mapbase; |
772 | unsigned int old_type, old_iotype, old_hub6, old_shift; | 771 | unsigned int old_type, old_iotype, old_hub6, old_shift; |
773 | 772 | ||
774 | old_iobase = port->iobase; | 773 | old_iobase = uport->iobase; |
775 | old_mapbase = port->mapbase; | 774 | old_mapbase = uport->mapbase; |
776 | old_type = port->type; | 775 | old_type = uport->type; |
777 | old_hub6 = port->hub6; | 776 | old_hub6 = uport->hub6; |
778 | old_iotype = port->iotype; | 777 | old_iotype = uport->iotype; |
779 | old_shift = port->regshift; | 778 | old_shift = uport->regshift; |
780 | 779 | ||
781 | /* | 780 | /* |
782 | * Free and release old regions | 781 | * Free and release old regions |
783 | */ | 782 | */ |
784 | if (old_type != PORT_UNKNOWN) | 783 | if (old_type != PORT_UNKNOWN) |
785 | port->ops->release_port(port); | 784 | uport->ops->release_port(uport); |
786 | 785 | ||
787 | port->iobase = new_port; | 786 | uport->iobase = new_port; |
788 | port->type = new_serial.type; | 787 | uport->type = new_serial.type; |
789 | port->hub6 = new_serial.hub6; | 788 | uport->hub6 = new_serial.hub6; |
790 | port->iotype = new_serial.io_type; | 789 | uport->iotype = new_serial.io_type; |
791 | port->regshift = new_serial.iomem_reg_shift; | 790 | uport->regshift = new_serial.iomem_reg_shift; |
792 | port->mapbase = (unsigned long)new_serial.iomem_base; | 791 | uport->mapbase = (unsigned long)new_serial.iomem_base; |
793 | 792 | ||
794 | /* | 793 | /* |
795 | * Claim and map the new regions | 794 | * Claim and map the new regions |
796 | */ | 795 | */ |
797 | if (port->type != PORT_UNKNOWN) { | 796 | if (uport->type != PORT_UNKNOWN) { |
798 | retval = port->ops->request_port(port); | 797 | retval = uport->ops->request_port(uport); |
799 | } else { | 798 | } else { |
800 | /* Always success - Jean II */ | 799 | /* Always success - Jean II */ |
801 | retval = 0; | 800 | retval = 0; |
@@ -806,19 +805,19 @@ static int uart_set_info(struct uart_state *state, | |||
806 | * new port, try to restore the old settings. | 805 | * new port, try to restore the old settings. |
807 | */ | 806 | */ |
808 | if (retval && old_type != PORT_UNKNOWN) { | 807 | if (retval && old_type != PORT_UNKNOWN) { |
809 | port->iobase = old_iobase; | 808 | uport->iobase = old_iobase; |
810 | port->type = old_type; | 809 | uport->type = old_type; |
811 | port->hub6 = old_hub6; | 810 | uport->hub6 = old_hub6; |
812 | port->iotype = old_iotype; | 811 | uport->iotype = old_iotype; |
813 | port->regshift = old_shift; | 812 | uport->regshift = old_shift; |
814 | port->mapbase = old_mapbase; | 813 | uport->mapbase = old_mapbase; |
815 | retval = port->ops->request_port(port); | 814 | retval = uport->ops->request_port(uport); |
816 | /* | 815 | /* |
817 | * If we failed to restore the old settings, | 816 | * If we failed to restore the old settings, |
818 | * we fail like this. | 817 | * we fail like this. |
819 | */ | 818 | */ |
820 | if (retval) | 819 | if (retval) |
821 | port->type = PORT_UNKNOWN; | 820 | uport->type = PORT_UNKNOWN; |
822 | 821 | ||
823 | /* | 822 | /* |
824 | * We failed anyway. | 823 | * We failed anyway. |
@@ -830,45 +829,45 @@ static int uart_set_info(struct uart_state *state, | |||
830 | } | 829 | } |
831 | 830 | ||
832 | if (change_irq) | 831 | if (change_irq) |
833 | port->irq = new_serial.irq; | 832 | uport->irq = new_serial.irq; |
834 | if (!(port->flags & UPF_FIXED_PORT)) | 833 | if (!(uport->flags & UPF_FIXED_PORT)) |
835 | port->uartclk = new_serial.baud_base * 16; | 834 | uport->uartclk = new_serial.baud_base * 16; |
836 | port->flags = (port->flags & ~UPF_CHANGE_MASK) | | 835 | uport->flags = (uport->flags & ~UPF_CHANGE_MASK) | |
837 | (new_flags & UPF_CHANGE_MASK); | 836 | (new_flags & UPF_CHANGE_MASK); |
838 | port->custom_divisor = new_serial.custom_divisor; | 837 | uport->custom_divisor = new_serial.custom_divisor; |
839 | state->close_delay = close_delay; | 838 | port->close_delay = close_delay; |
840 | state->closing_wait = closing_wait; | 839 | port->closing_wait = closing_wait; |
841 | if (new_serial.xmit_fifo_size) | 840 | if (new_serial.xmit_fifo_size) |
842 | port->fifosize = new_serial.xmit_fifo_size; | 841 | uport->fifosize = new_serial.xmit_fifo_size; |
843 | if (state->info.port.tty) | 842 | if (port->tty) |
844 | state->info.port.tty->low_latency = | 843 | port->tty->low_latency = |
845 | (port->flags & UPF_LOW_LATENCY) ? 1 : 0; | 844 | (uport->flags & UPF_LOW_LATENCY) ? 1 : 0; |
846 | 845 | ||
847 | check_and_exit: | 846 | check_and_exit: |
848 | retval = 0; | 847 | retval = 0; |
849 | if (port->type == PORT_UNKNOWN) | 848 | if (uport->type == PORT_UNKNOWN) |
850 | goto exit; | 849 | goto exit; |
851 | if (state->info.flags & UIF_INITIALIZED) { | 850 | if (port->flags & ASYNC_INITIALIZED) { |
852 | if (((old_flags ^ port->flags) & UPF_SPD_MASK) || | 851 | if (((old_flags ^ uport->flags) & UPF_SPD_MASK) || |
853 | old_custom_divisor != port->custom_divisor) { | 852 | old_custom_divisor != uport->custom_divisor) { |
854 | /* | 853 | /* |
855 | * If they're setting up a custom divisor or speed, | 854 | * If they're setting up a custom divisor or speed, |
856 | * instead of clearing it, then bitch about it. No | 855 | * instead of clearing it, then bitch about it. No |
857 | * need to rate-limit; it's CAP_SYS_ADMIN only. | 856 | * need to rate-limit; it's CAP_SYS_ADMIN only. |
858 | */ | 857 | */ |
859 | if (port->flags & UPF_SPD_MASK) { | 858 | if (uport->flags & UPF_SPD_MASK) { |
860 | char buf[64]; | 859 | char buf[64]; |
861 | printk(KERN_NOTICE | 860 | printk(KERN_NOTICE |
862 | "%s sets custom speed on %s. This " | 861 | "%s sets custom speed on %s. This " |
863 | "is deprecated.\n", current->comm, | 862 | "is deprecated.\n", current->comm, |
864 | tty_name(state->info.port.tty, buf)); | 863 | tty_name(port->tty, buf)); |
865 | } | 864 | } |
866 | uart_change_speed(state, NULL); | 865 | uart_change_speed(state, NULL); |
867 | } | 866 | } |
868 | } else | 867 | } else |
869 | retval = uart_startup(state, 1); | 868 | retval = uart_startup(state, 1); |
870 | exit: | 869 | exit: |
871 | mutex_unlock(&state->mutex); | 870 | mutex_unlock(&port->mutex); |
872 | return retval; | 871 | return retval; |
873 | } | 872 | } |
874 | 873 | ||
@@ -880,10 +879,11 @@ static int uart_set_info(struct uart_state *state, | |||
880 | static int uart_get_lsr_info(struct uart_state *state, | 879 | static int uart_get_lsr_info(struct uart_state *state, |
881 | unsigned int __user *value) | 880 | unsigned int __user *value) |
882 | { | 881 | { |
883 | struct uart_port *port = state->port; | 882 | struct uart_port *uport = state->uart_port; |
883 | struct tty_port *port = &state->port; | ||
884 | unsigned int result; | 884 | unsigned int result; |
885 | 885 | ||
886 | result = port->ops->tx_empty(port); | 886 | result = uport->ops->tx_empty(uport); |
887 | 887 | ||
888 | /* | 888 | /* |
889 | * If we're about to load something into the transmit | 889 | * If we're about to load something into the transmit |
@@ -891,9 +891,9 @@ static int uart_get_lsr_info(struct uart_state *state, | |||
891 | * avoid a race condition (depending on when the transmit | 891 | * avoid a race condition (depending on when the transmit |
892 | * interrupt happens). | 892 | * interrupt happens). |
893 | */ | 893 | */ |
894 | if (port->x_char || | 894 | if (uport->x_char || |
895 | ((uart_circ_chars_pending(&state->info.xmit) > 0) && | 895 | ((uart_circ_chars_pending(&state->xmit) > 0) && |
896 | !state->info.port.tty->stopped && !state->info.port.tty->hw_stopped)) | 896 | !port->tty->stopped && !port->tty->hw_stopped)) |
897 | result &= ~TIOCSER_TEMT; | 897 | result &= ~TIOCSER_TEMT; |
898 | 898 | ||
899 | return put_user(result, value); | 899 | return put_user(result, value); |
@@ -902,19 +902,20 @@ static int uart_get_lsr_info(struct uart_state *state, | |||
902 | static int uart_tiocmget(struct tty_struct *tty, struct file *file) | 902 | static int uart_tiocmget(struct tty_struct *tty, struct file *file) |
903 | { | 903 | { |
904 | struct uart_state *state = tty->driver_data; | 904 | struct uart_state *state = tty->driver_data; |
905 | struct uart_port *port = state->port; | 905 | struct tty_port *port = &state->port; |
906 | struct uart_port *uport = state->uart_port; | ||
906 | int result = -EIO; | 907 | int result = -EIO; |
907 | 908 | ||
908 | mutex_lock(&state->mutex); | 909 | mutex_lock(&port->mutex); |
909 | if ((!file || !tty_hung_up_p(file)) && | 910 | if ((!file || !tty_hung_up_p(file)) && |
910 | !(tty->flags & (1 << TTY_IO_ERROR))) { | 911 | !(tty->flags & (1 << TTY_IO_ERROR))) { |
911 | result = port->mctrl; | 912 | result = uport->mctrl; |
912 | 913 | ||
913 | spin_lock_irq(&port->lock); | 914 | spin_lock_irq(&uport->lock); |
914 | result |= port->ops->get_mctrl(port); | 915 | result |= uport->ops->get_mctrl(uport); |
915 | spin_unlock_irq(&port->lock); | 916 | spin_unlock_irq(&uport->lock); |
916 | } | 917 | } |
917 | mutex_unlock(&state->mutex); | 918 | mutex_unlock(&port->mutex); |
918 | 919 | ||
919 | return result; | 920 | return result; |
920 | } | 921 | } |
@@ -924,36 +925,39 @@ uart_tiocmset(struct tty_struct *tty, struct file *file, | |||
924 | unsigned int set, unsigned int clear) | 925 | unsigned int set, unsigned int clear) |
925 | { | 926 | { |
926 | struct uart_state *state = tty->driver_data; | 927 | struct uart_state *state = tty->driver_data; |
927 | struct uart_port *port = state->port; | 928 | struct uart_port *uport = state->uart_port; |
929 | struct tty_port *port = &state->port; | ||
928 | int ret = -EIO; | 930 | int ret = -EIO; |
929 | 931 | ||
930 | mutex_lock(&state->mutex); | 932 | mutex_lock(&port->mutex); |
931 | if ((!file || !tty_hung_up_p(file)) && | 933 | if ((!file || !tty_hung_up_p(file)) && |
932 | !(tty->flags & (1 << TTY_IO_ERROR))) { | 934 | !(tty->flags & (1 << TTY_IO_ERROR))) { |
933 | uart_update_mctrl(port, set, clear); | 935 | uart_update_mctrl(uport, set, clear); |
934 | ret = 0; | 936 | ret = 0; |
935 | } | 937 | } |
936 | mutex_unlock(&state->mutex); | 938 | mutex_unlock(&port->mutex); |
937 | return ret; | 939 | return ret; |
938 | } | 940 | } |
939 | 941 | ||
940 | static int uart_break_ctl(struct tty_struct *tty, int break_state) | 942 | static int uart_break_ctl(struct tty_struct *tty, int break_state) |
941 | { | 943 | { |
942 | struct uart_state *state = tty->driver_data; | 944 | struct uart_state *state = tty->driver_data; |
943 | struct uart_port *port = state->port; | 945 | struct tty_port *port = &state->port; |
946 | struct uart_port *uport = state->uart_port; | ||
944 | 947 | ||
945 | mutex_lock(&state->mutex); | 948 | mutex_lock(&port->mutex); |
946 | 949 | ||
947 | if (port->type != PORT_UNKNOWN) | 950 | if (uport->type != PORT_UNKNOWN) |
948 | port->ops->break_ctl(port, break_state); | 951 | uport->ops->break_ctl(uport, break_state); |
949 | 952 | ||
950 | mutex_unlock(&state->mutex); | 953 | mutex_unlock(&port->mutex); |
951 | return 0; | 954 | return 0; |
952 | } | 955 | } |
953 | 956 | ||
954 | static int uart_do_autoconfig(struct uart_state *state) | 957 | static int uart_do_autoconfig(struct uart_state *state) |
955 | { | 958 | { |
956 | struct uart_port *port = state->port; | 959 | struct uart_port *uport = state->uart_port; |
960 | struct tty_port *port = &state->port; | ||
957 | int flags, ret; | 961 | int flags, ret; |
958 | 962 | ||
959 | if (!capable(CAP_SYS_ADMIN)) | 963 | if (!capable(CAP_SYS_ADMIN)) |
@@ -964,33 +968,33 @@ static int uart_do_autoconfig(struct uart_state *state) | |||
964 | * changing, and hence any extra opens of the port while | 968 | * changing, and hence any extra opens of the port while |
965 | * we're auto-configuring. | 969 | * we're auto-configuring. |
966 | */ | 970 | */ |
967 | if (mutex_lock_interruptible(&state->mutex)) | 971 | if (mutex_lock_interruptible(&port->mutex)) |
968 | return -ERESTARTSYS; | 972 | return -ERESTARTSYS; |
969 | 973 | ||
970 | ret = -EBUSY; | 974 | ret = -EBUSY; |
971 | if (uart_users(state) == 1) { | 975 | if (tty_port_users(port) == 1) { |
972 | uart_shutdown(state); | 976 | uart_shutdown(state); |
973 | 977 | ||
974 | /* | 978 | /* |
975 | * If we already have a port type configured, | 979 | * If we already have a port type configured, |
976 | * we must release its resources. | 980 | * we must release its resources. |
977 | */ | 981 | */ |
978 | if (port->type != PORT_UNKNOWN) | 982 | if (uport->type != PORT_UNKNOWN) |
979 | port->ops->release_port(port); | 983 | uport->ops->release_port(uport); |
980 | 984 | ||
981 | flags = UART_CONFIG_TYPE; | 985 | flags = UART_CONFIG_TYPE; |
982 | if (port->flags & UPF_AUTO_IRQ) | 986 | if (uport->flags & UPF_AUTO_IRQ) |
983 | flags |= UART_CONFIG_IRQ; | 987 | flags |= UART_CONFIG_IRQ; |
984 | 988 | ||
985 | /* | 989 | /* |
986 | * This will claim the ports resources if | 990 | * This will claim the ports resources if |
987 | * a port is found. | 991 | * a port is found. |
988 | */ | 992 | */ |
989 | port->ops->config_port(port, flags); | 993 | uport->ops->config_port(uport, flags); |
990 | 994 | ||
991 | ret = uart_startup(state, 1); | 995 | ret = uart_startup(state, 1); |
992 | } | 996 | } |
993 | mutex_unlock(&state->mutex); | 997 | mutex_unlock(&port->mutex); |
994 | return ret; | 998 | return ret; |
995 | } | 999 | } |
996 | 1000 | ||
@@ -999,11 +1003,15 @@ static int uart_do_autoconfig(struct uart_state *state) | |||
999 | * - mask passed in arg for lines of interest | 1003 | * - mask passed in arg for lines of interest |
1000 | * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) | 1004 | * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) |
1001 | * Caller should use TIOCGICOUNT to see which one it was | 1005 | * Caller should use TIOCGICOUNT to see which one it was |
1006 | * | ||
1007 | * FIXME: This wants extracting into a common all driver implementation | ||
1008 | * of TIOCMWAIT using tty_port. | ||
1002 | */ | 1009 | */ |
1003 | static int | 1010 | static int |
1004 | uart_wait_modem_status(struct uart_state *state, unsigned long arg) | 1011 | uart_wait_modem_status(struct uart_state *state, unsigned long arg) |
1005 | { | 1012 | { |
1006 | struct uart_port *port = state->port; | 1013 | struct uart_port *uport = state->uart_port; |
1014 | struct tty_port *port = &state->port; | ||
1007 | DECLARE_WAITQUEUE(wait, current); | 1015 | DECLARE_WAITQUEUE(wait, current); |
1008 | struct uart_icount cprev, cnow; | 1016 | struct uart_icount cprev, cnow; |
1009 | int ret; | 1017 | int ret; |
@@ -1011,20 +1019,20 @@ uart_wait_modem_status(struct uart_state *state, unsigned long arg) | |||
1011 | /* | 1019 | /* |
1012 | * note the counters on entry | 1020 | * note the counters on entry |
1013 | */ | 1021 | */ |
1014 | spin_lock_irq(&port->lock); | 1022 | spin_lock_irq(&uport->lock); |
1015 | memcpy(&cprev, &port->icount, sizeof(struct uart_icount)); | 1023 | memcpy(&cprev, &uport->icount, sizeof(struct uart_icount)); |
1016 | 1024 | ||
1017 | /* | 1025 | /* |
1018 | * Force modem status interrupts on | 1026 | * Force modem status interrupts on |
1019 | */ | 1027 | */ |
1020 | port->ops->enable_ms(port); | 1028 | uport->ops->enable_ms(uport); |
1021 | spin_unlock_irq(&port->lock); | 1029 | spin_unlock_irq(&uport->lock); |
1022 | 1030 | ||
1023 | add_wait_queue(&state->info.delta_msr_wait, &wait); | 1031 | add_wait_queue(&port->delta_msr_wait, &wait); |
1024 | for (;;) { | 1032 | for (;;) { |
1025 | spin_lock_irq(&port->lock); | 1033 | spin_lock_irq(&uport->lock); |
1026 | memcpy(&cnow, &port->icount, sizeof(struct uart_icount)); | 1034 | memcpy(&cnow, &uport->icount, sizeof(struct uart_icount)); |
1027 | spin_unlock_irq(&port->lock); | 1035 | spin_unlock_irq(&uport->lock); |
1028 | 1036 | ||
1029 | set_current_state(TASK_INTERRUPTIBLE); | 1037 | set_current_state(TASK_INTERRUPTIBLE); |
1030 | 1038 | ||
@@ -1048,7 +1056,7 @@ uart_wait_modem_status(struct uart_state *state, unsigned long arg) | |||
1048 | } | 1056 | } |
1049 | 1057 | ||
1050 | current->state = TASK_RUNNING; | 1058 | current->state = TASK_RUNNING; |
1051 | remove_wait_queue(&state->info.delta_msr_wait, &wait); | 1059 | remove_wait_queue(&port->delta_msr_wait, &wait); |
1052 | 1060 | ||
1053 | return ret; | 1061 | return ret; |
1054 | } | 1062 | } |
@@ -1064,11 +1072,11 @@ static int uart_get_count(struct uart_state *state, | |||
1064 | { | 1072 | { |
1065 | struct serial_icounter_struct icount; | 1073 | struct serial_icounter_struct icount; |
1066 | struct uart_icount cnow; | 1074 | struct uart_icount cnow; |
1067 | struct uart_port *port = state->port; | 1075 | struct uart_port *uport = state->uart_port; |
1068 | 1076 | ||
1069 | spin_lock_irq(&port->lock); | 1077 | spin_lock_irq(&uport->lock); |
1070 | memcpy(&cnow, &port->icount, sizeof(struct uart_icount)); | 1078 | memcpy(&cnow, &uport->icount, sizeof(struct uart_icount)); |
1071 | spin_unlock_irq(&port->lock); | 1079 | spin_unlock_irq(&uport->lock); |
1072 | 1080 | ||
1073 | icount.cts = cnow.cts; | 1081 | icount.cts = cnow.cts; |
1074 | icount.dsr = cnow.dsr; | 1082 | icount.dsr = cnow.dsr; |
@@ -1093,6 +1101,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, | |||
1093 | unsigned long arg) | 1101 | unsigned long arg) |
1094 | { | 1102 | { |
1095 | struct uart_state *state = tty->driver_data; | 1103 | struct uart_state *state = tty->driver_data; |
1104 | struct tty_port *port = &state->port; | ||
1096 | void __user *uarg = (void __user *)arg; | 1105 | void __user *uarg = (void __user *)arg; |
1097 | int ret = -ENOIOCTLCMD; | 1106 | int ret = -ENOIOCTLCMD; |
1098 | 1107 | ||
@@ -1143,7 +1152,7 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, | |||
1143 | if (ret != -ENOIOCTLCMD) | 1152 | if (ret != -ENOIOCTLCMD) |
1144 | goto out; | 1153 | goto out; |
1145 | 1154 | ||
1146 | mutex_lock(&state->mutex); | 1155 | mutex_lock(&port->mutex); |
1147 | 1156 | ||
1148 | if (tty_hung_up_p(filp)) { | 1157 | if (tty_hung_up_p(filp)) { |
1149 | ret = -EIO; | 1158 | ret = -EIO; |
@@ -1160,14 +1169,14 @@ uart_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, | |||
1160 | break; | 1169 | break; |
1161 | 1170 | ||
1162 | default: { | 1171 | default: { |
1163 | struct uart_port *port = state->port; | 1172 | struct uart_port *uport = state->uart_port; |
1164 | if (port->ops->ioctl) | 1173 | if (uport->ops->ioctl) |
1165 | ret = port->ops->ioctl(port, cmd, arg); | 1174 | ret = uport->ops->ioctl(uport, cmd, arg); |
1166 | break; | 1175 | break; |
1167 | } | 1176 | } |
1168 | } | 1177 | } |
1169 | out_up: | 1178 | out_up: |
1170 | mutex_unlock(&state->mutex); | 1179 | mutex_unlock(&port->mutex); |
1171 | out: | 1180 | out: |
1172 | return ret; | 1181 | return ret; |
1173 | } | 1182 | } |
@@ -1175,10 +1184,10 @@ out: | |||
1175 | static void uart_set_ldisc(struct tty_struct *tty) | 1184 | static void uart_set_ldisc(struct tty_struct *tty) |
1176 | { | 1185 | { |
1177 | struct uart_state *state = tty->driver_data; | 1186 | struct uart_state *state = tty->driver_data; |
1178 | struct uart_port *port = state->port; | 1187 | struct uart_port *uport = state->uart_port; |
1179 | 1188 | ||
1180 | if (port->ops->set_ldisc) | 1189 | if (uport->ops->set_ldisc) |
1181 | port->ops->set_ldisc(port); | 1190 | uport->ops->set_ldisc(uport); |
1182 | } | 1191 | } |
1183 | 1192 | ||
1184 | static void uart_set_termios(struct tty_struct *tty, | 1193 | static void uart_set_termios(struct tty_struct *tty, |
@@ -1207,7 +1216,7 @@ static void uart_set_termios(struct tty_struct *tty, | |||
1207 | 1216 | ||
1208 | /* Handle transition to B0 status */ | 1217 | /* Handle transition to B0 status */ |
1209 | if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) | 1218 | if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) |
1210 | uart_clear_mctrl(state->port, TIOCM_RTS | TIOCM_DTR); | 1219 | uart_clear_mctrl(state->uart_port, TIOCM_RTS | TIOCM_DTR); |
1211 | 1220 | ||
1212 | /* Handle transition away from B0 status */ | 1221 | /* Handle transition away from B0 status */ |
1213 | if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) { | 1222 | if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) { |
@@ -1215,25 +1224,25 @@ static void uart_set_termios(struct tty_struct *tty, | |||
1215 | if (!(cflag & CRTSCTS) || | 1224 | if (!(cflag & CRTSCTS) || |
1216 | !test_bit(TTY_THROTTLED, &tty->flags)) | 1225 | !test_bit(TTY_THROTTLED, &tty->flags)) |
1217 | mask |= TIOCM_RTS; | 1226 | mask |= TIOCM_RTS; |
1218 | uart_set_mctrl(state->port, mask); | 1227 | uart_set_mctrl(state->uart_port, mask); |
1219 | } | 1228 | } |
1220 | 1229 | ||
1221 | /* Handle turning off CRTSCTS */ | 1230 | /* Handle turning off CRTSCTS */ |
1222 | if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) { | 1231 | if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) { |
1223 | spin_lock_irqsave(&state->port->lock, flags); | 1232 | spin_lock_irqsave(&state->uart_port->lock, flags); |
1224 | tty->hw_stopped = 0; | 1233 | tty->hw_stopped = 0; |
1225 | __uart_start(tty); | 1234 | __uart_start(tty); |
1226 | spin_unlock_irqrestore(&state->port->lock, flags); | 1235 | spin_unlock_irqrestore(&state->uart_port->lock, flags); |
1227 | } | 1236 | } |
1228 | 1237 | ||
1229 | /* Handle turning on CRTSCTS */ | 1238 | /* Handle turning on CRTSCTS */ |
1230 | if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) { | 1239 | if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) { |
1231 | spin_lock_irqsave(&state->port->lock, flags); | 1240 | spin_lock_irqsave(&state->uart_port->lock, flags); |
1232 | if (!(state->port->ops->get_mctrl(state->port) & TIOCM_CTS)) { | 1241 | if (!(state->uart_port->ops->get_mctrl(state->uart_port) & TIOCM_CTS)) { |
1233 | tty->hw_stopped = 1; | 1242 | tty->hw_stopped = 1; |
1234 | state->port->ops->stop_tx(state->port); | 1243 | state->uart_port->ops->stop_tx(state->uart_port); |
1235 | } | 1244 | } |
1236 | spin_unlock_irqrestore(&state->port->lock, flags); | 1245 | spin_unlock_irqrestore(&state->uart_port->lock, flags); |
1237 | } | 1246 | } |
1238 | #if 0 | 1247 | #if 0 |
1239 | /* | 1248 | /* |
@@ -1244,7 +1253,7 @@ static void uart_set_termios(struct tty_struct *tty, | |||
1244 | */ | 1253 | */ |
1245 | if (!(old_termios->c_cflag & CLOCAL) && | 1254 | if (!(old_termios->c_cflag & CLOCAL) && |
1246 | (tty->termios->c_cflag & CLOCAL)) | 1255 | (tty->termios->c_cflag & CLOCAL)) |
1247 | wake_up_interruptible(&info->port.open_wait); | 1256 | wake_up_interruptible(&state->uart_port.open_wait); |
1248 | #endif | 1257 | #endif |
1249 | } | 1258 | } |
1250 | 1259 | ||
@@ -1256,40 +1265,39 @@ static void uart_set_termios(struct tty_struct *tty, | |||
1256 | static void uart_close(struct tty_struct *tty, struct file *filp) | 1265 | static void uart_close(struct tty_struct *tty, struct file *filp) |
1257 | { | 1266 | { |
1258 | struct uart_state *state = tty->driver_data; | 1267 | struct uart_state *state = tty->driver_data; |
1259 | struct uart_port *port; | 1268 | struct tty_port *port; |
1269 | struct uart_port *uport; | ||
1260 | 1270 | ||
1261 | BUG_ON(!kernel_locked()); | 1271 | BUG_ON(!kernel_locked()); |
1262 | 1272 | ||
1263 | if (!state || !state->port) | 1273 | uport = state->uart_port; |
1264 | return; | 1274 | port = &state->port; |
1265 | 1275 | ||
1266 | port = state->port; | 1276 | pr_debug("uart_close(%d) called\n", uport->line); |
1267 | 1277 | ||
1268 | pr_debug("uart_close(%d) called\n", port->line); | 1278 | mutex_lock(&port->mutex); |
1269 | |||
1270 | mutex_lock(&state->mutex); | ||
1271 | 1279 | ||
1272 | if (tty_hung_up_p(filp)) | 1280 | if (tty_hung_up_p(filp)) |
1273 | goto done; | 1281 | goto done; |
1274 | 1282 | ||
1275 | if ((tty->count == 1) && (state->count != 1)) { | 1283 | if ((tty->count == 1) && (port->count != 1)) { |
1276 | /* | 1284 | /* |
1277 | * Uh, oh. tty->count is 1, which means that the tty | 1285 | * Uh, oh. tty->count is 1, which means that the tty |
1278 | * structure will be freed. state->count should always | 1286 | * structure will be freed. port->count should always |
1279 | * be one in these conditions. If it's greater than | 1287 | * be one in these conditions. If it's greater than |
1280 | * one, we've got real problems, since it means the | 1288 | * one, we've got real problems, since it means the |
1281 | * serial port won't be shutdown. | 1289 | * serial port won't be shutdown. |
1282 | */ | 1290 | */ |
1283 | printk(KERN_ERR "uart_close: bad serial port count; tty->count is 1, " | 1291 | printk(KERN_ERR "uart_close: bad serial port count; tty->count is 1, " |
1284 | "state->count is %d\n", state->count); | 1292 | "port->count is %d\n", port->count); |
1285 | state->count = 1; | 1293 | port->count = 1; |
1286 | } | 1294 | } |
1287 | if (--state->count < 0) { | 1295 | if (--port->count < 0) { |
1288 | printk(KERN_ERR "uart_close: bad serial port count for %s: %d\n", | 1296 | printk(KERN_ERR "uart_close: bad serial port count for %s: %d\n", |
1289 | tty->name, state->count); | 1297 | tty->name, port->count); |
1290 | state->count = 0; | 1298 | port->count = 0; |
1291 | } | 1299 | } |
1292 | if (state->count) | 1300 | if (port->count) |
1293 | goto done; | 1301 | goto done; |
1294 | 1302 | ||
1295 | /* | 1303 | /* |
@@ -1299,24 +1307,24 @@ static void uart_close(struct tty_struct *tty, struct file *filp) | |||
1299 | */ | 1307 | */ |
1300 | tty->closing = 1; | 1308 | tty->closing = 1; |
1301 | 1309 | ||
1302 | if (state->closing_wait != USF_CLOSING_WAIT_NONE) | 1310 | if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) |
1303 | tty_wait_until_sent(tty, msecs_to_jiffies(state->closing_wait)); | 1311 | tty_wait_until_sent(tty, msecs_to_jiffies(port->closing_wait)); |
1304 | 1312 | ||
1305 | /* | 1313 | /* |
1306 | * At this point, we stop accepting input. To do this, we | 1314 | * At this point, we stop accepting input. To do this, we |
1307 | * disable the receive line status interrupts. | 1315 | * disable the receive line status interrupts. |
1308 | */ | 1316 | */ |
1309 | if (state->info.flags & UIF_INITIALIZED) { | 1317 | if (port->flags & ASYNC_INITIALIZED) { |
1310 | unsigned long flags; | 1318 | unsigned long flags; |
1311 | spin_lock_irqsave(&port->lock, flags); | 1319 | spin_lock_irqsave(&port->lock, flags); |
1312 | port->ops->stop_rx(port); | 1320 | uport->ops->stop_rx(uport); |
1313 | spin_unlock_irqrestore(&port->lock, flags); | 1321 | spin_unlock_irqrestore(&port->lock, flags); |
1314 | /* | 1322 | /* |
1315 | * Before we drop DTR, make sure the UART transmitter | 1323 | * Before we drop DTR, make sure the UART transmitter |
1316 | * has completely drained; this is especially | 1324 | * has completely drained; this is especially |
1317 | * important if there is a transmit FIFO! | 1325 | * important if there is a transmit FIFO! |
1318 | */ | 1326 | */ |
1319 | uart_wait_until_sent(tty, port->timeout); | 1327 | uart_wait_until_sent(tty, uport->timeout); |
1320 | } | 1328 | } |
1321 | 1329 | ||
1322 | uart_shutdown(state); | 1330 | uart_shutdown(state); |
@@ -1325,29 +1333,29 @@ static void uart_close(struct tty_struct *tty, struct file *filp) | |||
1325 | tty_ldisc_flush(tty); | 1333 | tty_ldisc_flush(tty); |
1326 | 1334 | ||
1327 | tty->closing = 0; | 1335 | tty->closing = 0; |
1328 | state->info.port.tty = NULL; | 1336 | tty_port_tty_set(port, NULL); |
1329 | 1337 | ||
1330 | if (state->info.port.blocked_open) { | 1338 | if (port->blocked_open) { |
1331 | if (state->close_delay) | 1339 | if (port->close_delay) |
1332 | msleep_interruptible(state->close_delay); | 1340 | msleep_interruptible(port->close_delay); |
1333 | } else if (!uart_console(port)) { | 1341 | } else if (!uart_console(uport)) { |
1334 | uart_change_pm(state, 3); | 1342 | uart_change_pm(state, 3); |
1335 | } | 1343 | } |
1336 | 1344 | ||
1337 | /* | 1345 | /* |
1338 | * Wake up anyone trying to open this port. | 1346 | * Wake up anyone trying to open this port. |
1339 | */ | 1347 | */ |
1340 | state->info.flags &= ~UIF_NORMAL_ACTIVE; | 1348 | clear_bit(ASYNCB_NORMAL_ACTIVE, &port->flags); |
1341 | wake_up_interruptible(&state->info.port.open_wait); | 1349 | wake_up_interruptible(&port->open_wait); |
1342 | 1350 | ||
1343 | done: | 1351 | done: |
1344 | mutex_unlock(&state->mutex); | 1352 | mutex_unlock(&port->mutex); |
1345 | } | 1353 | } |
1346 | 1354 | ||
1347 | static void uart_wait_until_sent(struct tty_struct *tty, int timeout) | 1355 | static void uart_wait_until_sent(struct tty_struct *tty, int timeout) |
1348 | { | 1356 | { |
1349 | struct uart_state *state = tty->driver_data; | 1357 | struct uart_state *state = tty->driver_data; |
1350 | struct uart_port *port = state->port; | 1358 | struct uart_port *port = state->uart_port; |
1351 | unsigned long char_time, expire; | 1359 | unsigned long char_time, expire; |
1352 | 1360 | ||
1353 | if (port->type == PORT_UNKNOWN || port->fifosize == 0) | 1361 | if (port->type == PORT_UNKNOWN || port->fifosize == 0) |
@@ -1412,22 +1420,22 @@ static void uart_wait_until_sent(struct tty_struct *tty, int timeout) | |||
1412 | static void uart_hangup(struct tty_struct *tty) | 1420 | static void uart_hangup(struct tty_struct *tty) |
1413 | { | 1421 | { |
1414 | struct uart_state *state = tty->driver_data; | 1422 | struct uart_state *state = tty->driver_data; |
1415 | struct uart_info *info = &state->info; | 1423 | struct tty_port *port = &state->port; |
1416 | 1424 | ||
1417 | BUG_ON(!kernel_locked()); | 1425 | BUG_ON(!kernel_locked()); |
1418 | pr_debug("uart_hangup(%d)\n", state->port->line); | 1426 | pr_debug("uart_hangup(%d)\n", state->uart_port->line); |
1419 | 1427 | ||
1420 | mutex_lock(&state->mutex); | 1428 | mutex_lock(&port->mutex); |
1421 | if (info->flags & UIF_NORMAL_ACTIVE) { | 1429 | if (port->flags & ASYNC_NORMAL_ACTIVE) { |
1422 | uart_flush_buffer(tty); | 1430 | uart_flush_buffer(tty); |
1423 | uart_shutdown(state); | 1431 | uart_shutdown(state); |
1424 | state->count = 0; | 1432 | port->count = 0; |
1425 | info->flags &= ~UIF_NORMAL_ACTIVE; | 1433 | clear_bit(ASYNCB_NORMAL_ACTIVE, &port->flags); |
1426 | info->port.tty = NULL; | 1434 | tty_port_tty_set(port, NULL); |
1427 | wake_up_interruptible(&info->port.open_wait); | 1435 | wake_up_interruptible(&port->open_wait); |
1428 | wake_up_interruptible(&info->delta_msr_wait); | 1436 | wake_up_interruptible(&port->delta_msr_wait); |
1429 | } | 1437 | } |
1430 | mutex_unlock(&state->mutex); | 1438 | mutex_unlock(&port->mutex); |
1431 | } | 1439 | } |
1432 | 1440 | ||
1433 | /* | 1441 | /* |
@@ -1438,8 +1446,8 @@ static void uart_hangup(struct tty_struct *tty) | |||
1438 | */ | 1446 | */ |
1439 | static void uart_update_termios(struct uart_state *state) | 1447 | static void uart_update_termios(struct uart_state *state) |
1440 | { | 1448 | { |
1441 | struct tty_struct *tty = state->info.port.tty; | 1449 | struct tty_struct *tty = state->port.tty; |
1442 | struct uart_port *port = state->port; | 1450 | struct uart_port *port = state->uart_port; |
1443 | 1451 | ||
1444 | if (uart_console(port) && port->cons->cflag) { | 1452 | if (uart_console(port) && port->cons->cflag) { |
1445 | tty->termios->c_cflag = port->cons->cflag; | 1453 | tty->termios->c_cflag = port->cons->cflag; |
@@ -1473,27 +1481,27 @@ static int | |||
1473 | uart_block_til_ready(struct file *filp, struct uart_state *state) | 1481 | uart_block_til_ready(struct file *filp, struct uart_state *state) |
1474 | { | 1482 | { |
1475 | DECLARE_WAITQUEUE(wait, current); | 1483 | DECLARE_WAITQUEUE(wait, current); |
1476 | struct uart_info *info = &state->info; | 1484 | struct uart_port *uport = state->uart_port; |
1477 | struct uart_port *port = state->port; | 1485 | struct tty_port *port = &state->port; |
1478 | unsigned int mctrl; | 1486 | unsigned int mctrl; |
1479 | 1487 | ||
1480 | info->port.blocked_open++; | 1488 | port->blocked_open++; |
1481 | state->count--; | 1489 | port->count--; |
1482 | 1490 | ||
1483 | add_wait_queue(&info->port.open_wait, &wait); | 1491 | add_wait_queue(&port->open_wait, &wait); |
1484 | while (1) { | 1492 | while (1) { |
1485 | set_current_state(TASK_INTERRUPTIBLE); | 1493 | set_current_state(TASK_INTERRUPTIBLE); |
1486 | 1494 | ||
1487 | /* | 1495 | /* |
1488 | * If we have been hung up, tell userspace/restart open. | 1496 | * If we have been hung up, tell userspace/restart open. |
1489 | */ | 1497 | */ |
1490 | if (tty_hung_up_p(filp) || info->port.tty == NULL) | 1498 | if (tty_hung_up_p(filp) || port->tty == NULL) |
1491 | break; | 1499 | break; |
1492 | 1500 | ||
1493 | /* | 1501 | /* |
1494 | * If the port has been closed, tell userspace/restart open. | 1502 | * If the port has been closed, tell userspace/restart open. |
1495 | */ | 1503 | */ |
1496 | if (!(info->flags & UIF_INITIALIZED)) | 1504 | if (!(port->flags & ASYNC_INITIALIZED)) |
1497 | break; | 1505 | break; |
1498 | 1506 | ||
1499 | /* | 1507 | /* |
@@ -1506,8 +1514,8 @@ uart_block_til_ready(struct file *filp, struct uart_state *state) | |||
1506 | * have set TTY_IO_ERROR for a non-existant port. | 1514 | * have set TTY_IO_ERROR for a non-existant port. |
1507 | */ | 1515 | */ |
1508 | if ((filp->f_flags & O_NONBLOCK) || | 1516 | if ((filp->f_flags & O_NONBLOCK) || |
1509 | (info->port.tty->termios->c_cflag & CLOCAL) || | 1517 | (port->tty->termios->c_cflag & CLOCAL) || |
1510 | (info->port.tty->flags & (1 << TTY_IO_ERROR))) | 1518 | (port->tty->flags & (1 << TTY_IO_ERROR))) |
1511 | break; | 1519 | break; |
1512 | 1520 | ||
1513 | /* | 1521 | /* |
@@ -1515,37 +1523,37 @@ uart_block_til_ready(struct file *filp, struct uart_state *state) | |||
1515 | * not set RTS here - we want to make sure we catch | 1523 | * not set RTS here - we want to make sure we catch |
1516 | * the data from the modem. | 1524 | * the data from the modem. |
1517 | */ | 1525 | */ |
1518 | if (info->port.tty->termios->c_cflag & CBAUD) | 1526 | if (port->tty->termios->c_cflag & CBAUD) |
1519 | uart_set_mctrl(port, TIOCM_DTR); | 1527 | uart_set_mctrl(uport, TIOCM_DTR); |
1520 | 1528 | ||
1521 | /* | 1529 | /* |
1522 | * and wait for the carrier to indicate that the | 1530 | * and wait for the carrier to indicate that the |
1523 | * modem is ready for us. | 1531 | * modem is ready for us. |
1524 | */ | 1532 | */ |
1525 | spin_lock_irq(&port->lock); | 1533 | spin_lock_irq(&uport->lock); |
1526 | port->ops->enable_ms(port); | 1534 | uport->ops->enable_ms(uport); |
1527 | mctrl = port->ops->get_mctrl(port); | 1535 | mctrl = uport->ops->get_mctrl(uport); |
1528 | spin_unlock_irq(&port->lock); | 1536 | spin_unlock_irq(&uport->lock); |
1529 | if (mctrl & TIOCM_CAR) | 1537 | if (mctrl & TIOCM_CAR) |
1530 | break; | 1538 | break; |
1531 | 1539 | ||
1532 | mutex_unlock(&state->mutex); | 1540 | mutex_unlock(&port->mutex); |
1533 | schedule(); | 1541 | schedule(); |
1534 | mutex_lock(&state->mutex); | 1542 | mutex_lock(&port->mutex); |
1535 | 1543 | ||
1536 | if (signal_pending(current)) | 1544 | if (signal_pending(current)) |
1537 | break; | 1545 | break; |
1538 | } | 1546 | } |
1539 | set_current_state(TASK_RUNNING); | 1547 | set_current_state(TASK_RUNNING); |
1540 | remove_wait_queue(&info->port.open_wait, &wait); | 1548 | remove_wait_queue(&port->open_wait, &wait); |
1541 | 1549 | ||
1542 | state->count++; | 1550 | port->count++; |
1543 | info->port.blocked_open--; | 1551 | port->blocked_open--; |
1544 | 1552 | ||
1545 | if (signal_pending(current)) | 1553 | if (signal_pending(current)) |
1546 | return -ERESTARTSYS; | 1554 | return -ERESTARTSYS; |
1547 | 1555 | ||
1548 | if (!info->port.tty || tty_hung_up_p(filp)) | 1556 | if (!port->tty || tty_hung_up_p(filp)) |
1549 | return -EAGAIN; | 1557 | return -EAGAIN; |
1550 | 1558 | ||
1551 | return 0; | 1559 | return 0; |
@@ -1554,24 +1562,26 @@ uart_block_til_ready(struct file *filp, struct uart_state *state) | |||
1554 | static struct uart_state *uart_get(struct uart_driver *drv, int line) | 1562 | static struct uart_state *uart_get(struct uart_driver *drv, int line) |
1555 | { | 1563 | { |
1556 | struct uart_state *state; | 1564 | struct uart_state *state; |
1565 | struct tty_port *port; | ||
1557 | int ret = 0; | 1566 | int ret = 0; |
1558 | 1567 | ||
1559 | state = drv->state + line; | 1568 | state = drv->state + line; |
1560 | if (mutex_lock_interruptible(&state->mutex)) { | 1569 | port = &state->port; |
1570 | if (mutex_lock_interruptible(&port->mutex)) { | ||
1561 | ret = -ERESTARTSYS; | 1571 | ret = -ERESTARTSYS; |
1562 | goto err; | 1572 | goto err; |
1563 | } | 1573 | } |
1564 | 1574 | ||
1565 | state->count++; | 1575 | port->count++; |
1566 | if (!state->port || state->port->flags & UPF_DEAD) { | 1576 | if (!state->uart_port || state->uart_port->flags & UPF_DEAD) { |
1567 | ret = -ENXIO; | 1577 | ret = -ENXIO; |
1568 | goto err_unlock; | 1578 | goto err_unlock; |
1569 | } | 1579 | } |
1570 | return state; | 1580 | return state; |
1571 | 1581 | ||
1572 | err_unlock: | 1582 | err_unlock: |
1573 | state->count--; | 1583 | port->count--; |
1574 | mutex_unlock(&state->mutex); | 1584 | mutex_unlock(&port->mutex); |
1575 | err: | 1585 | err: |
1576 | return ERR_PTR(ret); | 1586 | return ERR_PTR(ret); |
1577 | } | 1587 | } |
@@ -1590,6 +1600,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp) | |||
1590 | { | 1600 | { |
1591 | struct uart_driver *drv = (struct uart_driver *)tty->driver->driver_state; | 1601 | struct uart_driver *drv = (struct uart_driver *)tty->driver->driver_state; |
1592 | struct uart_state *state; | 1602 | struct uart_state *state; |
1603 | struct tty_port *port; | ||
1593 | int retval, line = tty->index; | 1604 | int retval, line = tty->index; |
1594 | 1605 | ||
1595 | BUG_ON(!kernel_locked()); | 1606 | BUG_ON(!kernel_locked()); |
@@ -1606,16 +1617,18 @@ static int uart_open(struct tty_struct *tty, struct file *filp) | |||
1606 | 1617 | ||
1607 | /* | 1618 | /* |
1608 | * We take the semaphore inside uart_get to guarantee that we won't | 1619 | * We take the semaphore inside uart_get to guarantee that we won't |
1609 | * be re-entered while allocating the info structure, or while we | 1620 | * be re-entered while allocating the state structure, or while we |
1610 | * request any IRQs that the driver may need. This also has the nice | 1621 | * request any IRQs that the driver may need. This also has the nice |
1611 | * side-effect that it delays the action of uart_hangup, so we can | 1622 | * side-effect that it delays the action of uart_hangup, so we can |
1612 | * guarantee that info->port.tty will always contain something reasonable. | 1623 | * guarantee that state->port.tty will always contain something |
1624 | * reasonable. | ||
1613 | */ | 1625 | */ |
1614 | state = uart_get(drv, line); | 1626 | state = uart_get(drv, line); |
1615 | if (IS_ERR(state)) { | 1627 | if (IS_ERR(state)) { |
1616 | retval = PTR_ERR(state); | 1628 | retval = PTR_ERR(state); |
1617 | goto fail; | 1629 | goto fail; |
1618 | } | 1630 | } |
1631 | port = &state->port; | ||
1619 | 1632 | ||
1620 | /* | 1633 | /* |
1621 | * Once we set tty->driver_data here, we are guaranteed that | 1634 | * Once we set tty->driver_data here, we are guaranteed that |
@@ -1623,25 +1636,25 @@ static int uart_open(struct tty_struct *tty, struct file *filp) | |||
1623 | * Any failures from here onwards should not touch the count. | 1636 | * Any failures from here onwards should not touch the count. |
1624 | */ | 1637 | */ |
1625 | tty->driver_data = state; | 1638 | tty->driver_data = state; |
1626 | state->port->info = &state->info; | 1639 | state->uart_port->state = state; |
1627 | tty->low_latency = (state->port->flags & UPF_LOW_LATENCY) ? 1 : 0; | 1640 | tty->low_latency = (state->uart_port->flags & UPF_LOW_LATENCY) ? 1 : 0; |
1628 | tty->alt_speed = 0; | 1641 | tty->alt_speed = 0; |
1629 | state->info.port.tty = tty; | 1642 | tty_port_tty_set(port, tty); |
1630 | 1643 | ||
1631 | /* | 1644 | /* |
1632 | * If the port is in the middle of closing, bail out now. | 1645 | * If the port is in the middle of closing, bail out now. |
1633 | */ | 1646 | */ |
1634 | if (tty_hung_up_p(filp)) { | 1647 | if (tty_hung_up_p(filp)) { |
1635 | retval = -EAGAIN; | 1648 | retval = -EAGAIN; |
1636 | state->count--; | 1649 | port->count--; |
1637 | mutex_unlock(&state->mutex); | 1650 | mutex_unlock(&port->mutex); |
1638 | goto fail; | 1651 | goto fail; |
1639 | } | 1652 | } |
1640 | 1653 | ||
1641 | /* | 1654 | /* |
1642 | * Make sure the device is in D0 state. | 1655 | * Make sure the device is in D0 state. |
1643 | */ | 1656 | */ |
1644 | if (state->count == 1) | 1657 | if (port->count == 1) |
1645 | uart_change_pm(state, 0); | 1658 | uart_change_pm(state, 0); |
1646 | 1659 | ||
1647 | /* | 1660 | /* |
@@ -1654,18 +1667,18 @@ static int uart_open(struct tty_struct *tty, struct file *filp) | |||
1654 | */ | 1667 | */ |
1655 | if (retval == 0) | 1668 | if (retval == 0) |
1656 | retval = uart_block_til_ready(filp, state); | 1669 | retval = uart_block_til_ready(filp, state); |
1657 | mutex_unlock(&state->mutex); | 1670 | mutex_unlock(&port->mutex); |
1658 | 1671 | ||
1659 | /* | 1672 | /* |
1660 | * If this is the first open to succeed, adjust things to suit. | 1673 | * If this is the first open to succeed, adjust things to suit. |
1661 | */ | 1674 | */ |
1662 | if (retval == 0 && !(state->info.flags & UIF_NORMAL_ACTIVE)) { | 1675 | if (retval == 0 && !(port->flags & ASYNC_NORMAL_ACTIVE)) { |
1663 | state->info.flags |= UIF_NORMAL_ACTIVE; | 1676 | set_bit(ASYNCB_NORMAL_ACTIVE, &port->flags); |
1664 | 1677 | ||
1665 | uart_update_termios(state); | 1678 | uart_update_termios(state); |
1666 | } | 1679 | } |
1667 | 1680 | ||
1668 | fail: | 1681 | fail: |
1669 | return retval; | 1682 | return retval; |
1670 | } | 1683 | } |
1671 | 1684 | ||
@@ -1687,57 +1700,58 @@ static const char *uart_type(struct uart_port *port) | |||
1687 | static void uart_line_info(struct seq_file *m, struct uart_driver *drv, int i) | 1700 | static void uart_line_info(struct seq_file *m, struct uart_driver *drv, int i) |
1688 | { | 1701 | { |
1689 | struct uart_state *state = drv->state + i; | 1702 | struct uart_state *state = drv->state + i; |
1703 | struct tty_port *port = &state->port; | ||
1690 | int pm_state; | 1704 | int pm_state; |
1691 | struct uart_port *port = state->port; | 1705 | struct uart_port *uport = state->uart_port; |
1692 | char stat_buf[32]; | 1706 | char stat_buf[32]; |
1693 | unsigned int status; | 1707 | unsigned int status; |
1694 | int mmio; | 1708 | int mmio; |
1695 | 1709 | ||
1696 | if (!port) | 1710 | if (!uport) |
1697 | return; | 1711 | return; |
1698 | 1712 | ||
1699 | mmio = port->iotype >= UPIO_MEM; | 1713 | mmio = uport->iotype >= UPIO_MEM; |
1700 | seq_printf(m, "%d: uart:%s %s%08llX irq:%d", | 1714 | seq_printf(m, "%d: uart:%s %s%08llX irq:%d", |
1701 | port->line, uart_type(port), | 1715 | uport->line, uart_type(uport), |
1702 | mmio ? "mmio:0x" : "port:", | 1716 | mmio ? "mmio:0x" : "port:", |
1703 | mmio ? (unsigned long long)port->mapbase | 1717 | mmio ? (unsigned long long)uport->mapbase |
1704 | : (unsigned long long) port->iobase, | 1718 | : (unsigned long long)uport->iobase, |
1705 | port->irq); | 1719 | uport->irq); |
1706 | 1720 | ||
1707 | if (port->type == PORT_UNKNOWN) { | 1721 | if (uport->type == PORT_UNKNOWN) { |
1708 | seq_putc(m, '\n'); | 1722 | seq_putc(m, '\n'); |
1709 | return; | 1723 | return; |
1710 | } | 1724 | } |
1711 | 1725 | ||
1712 | if (capable(CAP_SYS_ADMIN)) { | 1726 | if (capable(CAP_SYS_ADMIN)) { |
1713 | mutex_lock(&state->mutex); | 1727 | mutex_lock(&port->mutex); |
1714 | pm_state = state->pm_state; | 1728 | pm_state = state->pm_state; |
1715 | if (pm_state) | 1729 | if (pm_state) |
1716 | uart_change_pm(state, 0); | 1730 | uart_change_pm(state, 0); |
1717 | spin_lock_irq(&port->lock); | 1731 | spin_lock_irq(&uport->lock); |
1718 | status = port->ops->get_mctrl(port); | 1732 | status = uport->ops->get_mctrl(uport); |
1719 | spin_unlock_irq(&port->lock); | 1733 | spin_unlock_irq(&uport->lock); |
1720 | if (pm_state) | 1734 | if (pm_state) |
1721 | uart_change_pm(state, pm_state); | 1735 | uart_change_pm(state, pm_state); |
1722 | mutex_unlock(&state->mutex); | 1736 | mutex_unlock(&port->mutex); |
1723 | 1737 | ||
1724 | seq_printf(m, " tx:%d rx:%d", | 1738 | seq_printf(m, " tx:%d rx:%d", |
1725 | port->icount.tx, port->icount.rx); | 1739 | uport->icount.tx, uport->icount.rx); |
1726 | if (port->icount.frame) | 1740 | if (uport->icount.frame) |
1727 | seq_printf(m, " fe:%d", | 1741 | seq_printf(m, " fe:%d", |
1728 | port->icount.frame); | 1742 | uport->icount.frame); |
1729 | if (port->icount.parity) | 1743 | if (uport->icount.parity) |
1730 | seq_printf(m, " pe:%d", | 1744 | seq_printf(m, " pe:%d", |
1731 | port->icount.parity); | 1745 | uport->icount.parity); |
1732 | if (port->icount.brk) | 1746 | if (uport->icount.brk) |
1733 | seq_printf(m, " brk:%d", | 1747 | seq_printf(m, " brk:%d", |
1734 | port->icount.brk); | 1748 | uport->icount.brk); |
1735 | if (port->icount.overrun) | 1749 | if (uport->icount.overrun) |
1736 | seq_printf(m, " oe:%d", | 1750 | seq_printf(m, " oe:%d", |
1737 | port->icount.overrun); | 1751 | uport->icount.overrun); |
1738 | 1752 | ||
1739 | #define INFOBIT(bit, str) \ | 1753 | #define INFOBIT(bit, str) \ |
1740 | if (port->mctrl & (bit)) \ | 1754 | if (uport->mctrl & (bit)) \ |
1741 | strncat(stat_buf, (str), sizeof(stat_buf) - \ | 1755 | strncat(stat_buf, (str), sizeof(stat_buf) - \ |
1742 | strlen(stat_buf) - 2) | 1756 | strlen(stat_buf) - 2) |
1743 | #define STATBIT(bit, str) \ | 1757 | #define STATBIT(bit, str) \ |
@@ -1958,7 +1972,7 @@ EXPORT_SYMBOL_GPL(uart_set_options); | |||
1958 | 1972 | ||
1959 | static void uart_change_pm(struct uart_state *state, int pm_state) | 1973 | static void uart_change_pm(struct uart_state *state, int pm_state) |
1960 | { | 1974 | { |
1961 | struct uart_port *port = state->port; | 1975 | struct uart_port *port = state->uart_port; |
1962 | 1976 | ||
1963 | if (state->pm_state != pm_state) { | 1977 | if (state->pm_state != pm_state) { |
1964 | if (port->ops->pm) | 1978 | if (port->ops->pm) |
@@ -1982,132 +1996,138 @@ static int serial_match_port(struct device *dev, void *data) | |||
1982 | return dev->devt == devt; /* Actually, only one tty per port */ | 1996 | return dev->devt == devt; /* Actually, only one tty per port */ |
1983 | } | 1997 | } |
1984 | 1998 | ||
1985 | int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) | 1999 | int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) |
1986 | { | 2000 | { |
1987 | struct uart_state *state = drv->state + port->line; | 2001 | struct uart_state *state = drv->state + uport->line; |
2002 | struct tty_port *port = &state->port; | ||
1988 | struct device *tty_dev; | 2003 | struct device *tty_dev; |
1989 | struct uart_match match = {port, drv}; | 2004 | struct uart_match match = {uport, drv}; |
1990 | 2005 | ||
1991 | mutex_lock(&state->mutex); | 2006 | mutex_lock(&port->mutex); |
1992 | 2007 | ||
1993 | if (!console_suspend_enabled && uart_console(port)) { | 2008 | if (!console_suspend_enabled && uart_console(uport)) { |
1994 | /* we're going to avoid suspending serial console */ | 2009 | /* we're going to avoid suspending serial console */ |
1995 | mutex_unlock(&state->mutex); | 2010 | mutex_unlock(&port->mutex); |
1996 | return 0; | 2011 | return 0; |
1997 | } | 2012 | } |
1998 | 2013 | ||
1999 | tty_dev = device_find_child(port->dev, &match, serial_match_port); | 2014 | tty_dev = device_find_child(uport->dev, &match, serial_match_port); |
2000 | if (device_may_wakeup(tty_dev)) { | 2015 | if (device_may_wakeup(tty_dev)) { |
2001 | enable_irq_wake(port->irq); | 2016 | enable_irq_wake(uport->irq); |
2002 | put_device(tty_dev); | 2017 | put_device(tty_dev); |
2003 | mutex_unlock(&state->mutex); | 2018 | mutex_unlock(&port->mutex); |
2004 | return 0; | 2019 | return 0; |
2005 | } | 2020 | } |
2006 | port->suspended = 1; | 2021 | uport->suspended = 1; |
2007 | 2022 | ||
2008 | if (state->info.flags & UIF_INITIALIZED) { | 2023 | if (port->flags & ASYNC_INITIALIZED) { |
2009 | const struct uart_ops *ops = port->ops; | 2024 | const struct uart_ops *ops = uport->ops; |
2010 | int tries; | 2025 | int tries; |
2011 | 2026 | ||
2012 | state->info.flags = (state->info.flags & ~UIF_INITIALIZED) | 2027 | set_bit(ASYNCB_SUSPENDED, &port->flags); |
2013 | | UIF_SUSPENDED; | 2028 | clear_bit(ASYNCB_INITIALIZED, &port->flags); |
2014 | 2029 | ||
2015 | spin_lock_irq(&port->lock); | 2030 | spin_lock_irq(&uport->lock); |
2016 | ops->stop_tx(port); | 2031 | ops->stop_tx(uport); |
2017 | ops->set_mctrl(port, 0); | 2032 | ops->set_mctrl(uport, 0); |
2018 | ops->stop_rx(port); | 2033 | ops->stop_rx(uport); |
2019 | spin_unlock_irq(&port->lock); | 2034 | spin_unlock_irq(&uport->lock); |
2020 | 2035 | ||
2021 | /* | 2036 | /* |
2022 | * Wait for the transmitter to empty. | 2037 | * Wait for the transmitter to empty. |
2023 | */ | 2038 | */ |
2024 | for (tries = 3; !ops->tx_empty(port) && tries; tries--) | 2039 | for (tries = 3; !ops->tx_empty(uport) && tries; tries--) |
2025 | msleep(10); | 2040 | msleep(10); |
2026 | if (!tries) | 2041 | if (!tries) |
2027 | printk(KERN_ERR "%s%s%s%d: Unable to drain " | 2042 | printk(KERN_ERR "%s%s%s%d: Unable to drain " |
2028 | "transmitter\n", | 2043 | "transmitter\n", |
2029 | port->dev ? dev_name(port->dev) : "", | 2044 | uport->dev ? dev_name(uport->dev) : "", |
2030 | port->dev ? ": " : "", | 2045 | uport->dev ? ": " : "", |
2031 | drv->dev_name, | 2046 | drv->dev_name, |
2032 | drv->tty_driver->name_base + port->line); | 2047 | drv->tty_driver->name_base + uport->line); |
2033 | 2048 | ||
2034 | ops->shutdown(port); | 2049 | ops->shutdown(uport); |
2035 | } | 2050 | } |
2036 | 2051 | ||
2037 | /* | 2052 | /* |
2038 | * Disable the console device before suspending. | 2053 | * Disable the console device before suspending. |
2039 | */ | 2054 | */ |
2040 | if (uart_console(port)) | 2055 | if (uart_console(uport)) |
2041 | console_stop(port->cons); | 2056 | console_stop(uport->cons); |
2042 | 2057 | ||
2043 | uart_change_pm(state, 3); | 2058 | uart_change_pm(state, 3); |
2044 | 2059 | ||
2045 | mutex_unlock(&state->mutex); | 2060 | mutex_unlock(&port->mutex); |
2046 | 2061 | ||
2047 | return 0; | 2062 | return 0; |
2048 | } | 2063 | } |
2049 | 2064 | ||
2050 | int uart_resume_port(struct uart_driver *drv, struct uart_port *port) | 2065 | int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) |
2051 | { | 2066 | { |
2052 | struct uart_state *state = drv->state + port->line; | 2067 | struct uart_state *state = drv->state + uport->line; |
2068 | struct tty_port *port = &state->port; | ||
2053 | struct device *tty_dev; | 2069 | struct device *tty_dev; |
2054 | struct uart_match match = {port, drv}; | 2070 | struct uart_match match = {uport, drv}; |
2071 | struct ktermios termios; | ||
2055 | 2072 | ||
2056 | mutex_lock(&state->mutex); | 2073 | mutex_lock(&port->mutex); |
2057 | 2074 | ||
2058 | if (!console_suspend_enabled && uart_console(port)) { | 2075 | if (!console_suspend_enabled && uart_console(uport)) { |
2059 | /* no need to resume serial console, it wasn't suspended */ | 2076 | /* no need to resume serial console, it wasn't suspended */ |
2060 | mutex_unlock(&state->mutex); | 2077 | /* |
2078 | * First try to use the console cflag setting. | ||
2079 | */ | ||
2080 | memset(&termios, 0, sizeof(struct ktermios)); | ||
2081 | termios.c_cflag = uport->cons->cflag; | ||
2082 | /* | ||
2083 | * If that's unset, use the tty termios setting. | ||
2084 | */ | ||
2085 | if (termios.c_cflag == 0) | ||
2086 | termios = *state->port.tty->termios; | ||
2087 | else { | ||
2088 | termios.c_ispeed = termios.c_ospeed = | ||
2089 | tty_termios_input_baud_rate(&termios); | ||
2090 | termios.c_ispeed = termios.c_ospeed = | ||
2091 | tty_termios_baud_rate(&termios); | ||
2092 | } | ||
2093 | uport->ops->set_termios(uport, &termios, NULL); | ||
2094 | mutex_unlock(&port->mutex); | ||
2061 | return 0; | 2095 | return 0; |
2062 | } | 2096 | } |
2063 | 2097 | ||
2064 | tty_dev = device_find_child(port->dev, &match, serial_match_port); | 2098 | tty_dev = device_find_child(uport->dev, &match, serial_match_port); |
2065 | if (!port->suspended && device_may_wakeup(tty_dev)) { | 2099 | if (!uport->suspended && device_may_wakeup(tty_dev)) { |
2066 | disable_irq_wake(port->irq); | 2100 | disable_irq_wake(uport->irq); |
2067 | mutex_unlock(&state->mutex); | 2101 | mutex_unlock(&port->mutex); |
2068 | return 0; | 2102 | return 0; |
2069 | } | 2103 | } |
2070 | port->suspended = 0; | 2104 | uport->suspended = 0; |
2071 | 2105 | ||
2072 | /* | 2106 | /* |
2073 | * Re-enable the console device after suspending. | 2107 | * Re-enable the console device after suspending. |
2074 | */ | 2108 | */ |
2075 | if (uart_console(port)) { | 2109 | if (uart_console(uport)) { |
2076 | struct ktermios termios; | ||
2077 | |||
2078 | /* | ||
2079 | * First try to use the console cflag setting. | ||
2080 | */ | ||
2081 | memset(&termios, 0, sizeof(struct ktermios)); | ||
2082 | termios.c_cflag = port->cons->cflag; | ||
2083 | |||
2084 | /* | ||
2085 | * If that's unset, use the tty termios setting. | ||
2086 | */ | ||
2087 | if (state->info.port.tty && termios.c_cflag == 0) | ||
2088 | termios = *state->info.port.tty->termios; | ||
2089 | |||
2090 | uart_change_pm(state, 0); | 2110 | uart_change_pm(state, 0); |
2091 | port->ops->set_termios(port, &termios, NULL); | 2111 | uport->ops->set_termios(uport, &termios, NULL); |
2092 | console_start(port->cons); | 2112 | console_start(uport->cons); |
2093 | } | 2113 | } |
2094 | 2114 | ||
2095 | if (state->info.flags & UIF_SUSPENDED) { | 2115 | if (port->flags & ASYNC_SUSPENDED) { |
2096 | const struct uart_ops *ops = port->ops; | 2116 | const struct uart_ops *ops = uport->ops; |
2097 | int ret; | 2117 | int ret; |
2098 | 2118 | ||
2099 | uart_change_pm(state, 0); | 2119 | uart_change_pm(state, 0); |
2100 | spin_lock_irq(&port->lock); | 2120 | spin_lock_irq(&uport->lock); |
2101 | ops->set_mctrl(port, 0); | 2121 | ops->set_mctrl(uport, 0); |
2102 | spin_unlock_irq(&port->lock); | 2122 | spin_unlock_irq(&uport->lock); |
2103 | ret = ops->startup(port); | 2123 | ret = ops->startup(uport); |
2104 | if (ret == 0) { | 2124 | if (ret == 0) { |
2105 | uart_change_speed(state, NULL); | 2125 | uart_change_speed(state, NULL); |
2106 | spin_lock_irq(&port->lock); | 2126 | spin_lock_irq(&uport->lock); |
2107 | ops->set_mctrl(port, port->mctrl); | 2127 | ops->set_mctrl(uport, uport->mctrl); |
2108 | ops->start_tx(port); | 2128 | ops->start_tx(uport); |
2109 | spin_unlock_irq(&port->lock); | 2129 | spin_unlock_irq(&uport->lock); |
2110 | state->info.flags |= UIF_INITIALIZED; | 2130 | set_bit(ASYNCB_INITIALIZED, &port->flags); |
2111 | } else { | 2131 | } else { |
2112 | /* | 2132 | /* |
2113 | * Failed to resume - maybe hardware went away? | 2133 | * Failed to resume - maybe hardware went away? |
@@ -2117,10 +2137,10 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port) | |||
2117 | uart_shutdown(state); | 2137 | uart_shutdown(state); |
2118 | } | 2138 | } |
2119 | 2139 | ||
2120 | state->info.flags &= ~UIF_SUSPENDED; | 2140 | clear_bit(ASYNCB_SUSPENDED, &port->flags); |
2121 | } | 2141 | } |
2122 | 2142 | ||
2123 | mutex_unlock(&state->mutex); | 2143 | mutex_unlock(&port->mutex); |
2124 | 2144 | ||
2125 | return 0; | 2145 | return 0; |
2126 | } | 2146 | } |
@@ -2232,10 +2252,10 @@ static int uart_poll_init(struct tty_driver *driver, int line, char *options) | |||
2232 | int parity = 'n'; | 2252 | int parity = 'n'; |
2233 | int flow = 'n'; | 2253 | int flow = 'n'; |
2234 | 2254 | ||
2235 | if (!state || !state->port) | 2255 | if (!state || !state->uart_port) |
2236 | return -1; | 2256 | return -1; |
2237 | 2257 | ||
2238 | port = state->port; | 2258 | port = state->uart_port; |
2239 | if (!(port->ops->poll_get_char && port->ops->poll_put_char)) | 2259 | if (!(port->ops->poll_get_char && port->ops->poll_put_char)) |
2240 | return -1; | 2260 | return -1; |
2241 | 2261 | ||
@@ -2253,10 +2273,10 @@ static int uart_poll_get_char(struct tty_driver *driver, int line) | |||
2253 | struct uart_state *state = drv->state + line; | 2273 | struct uart_state *state = drv->state + line; |
2254 | struct uart_port *port; | 2274 | struct uart_port *port; |
2255 | 2275 | ||
2256 | if (!state || !state->port) | 2276 | if (!state || !state->uart_port) |
2257 | return -1; | 2277 | return -1; |
2258 | 2278 | ||
2259 | port = state->port; | 2279 | port = state->uart_port; |
2260 | return port->ops->poll_get_char(port); | 2280 | return port->ops->poll_get_char(port); |
2261 | } | 2281 | } |
2262 | 2282 | ||
@@ -2266,10 +2286,10 @@ static void uart_poll_put_char(struct tty_driver *driver, int line, char ch) | |||
2266 | struct uart_state *state = drv->state + line; | 2286 | struct uart_state *state = drv->state + line; |
2267 | struct uart_port *port; | 2287 | struct uart_port *port; |
2268 | 2288 | ||
2269 | if (!state || !state->port) | 2289 | if (!state || !state->uart_port) |
2270 | return; | 2290 | return; |
2271 | 2291 | ||
2272 | port = state->port; | 2292 | port = state->uart_port; |
2273 | port->ops->poll_put_char(port, ch); | 2293 | port->ops->poll_put_char(port, ch); |
2274 | } | 2294 | } |
2275 | #endif | 2295 | #endif |
@@ -2360,14 +2380,12 @@ int uart_register_driver(struct uart_driver *drv) | |||
2360 | */ | 2380 | */ |
2361 | for (i = 0; i < drv->nr; i++) { | 2381 | for (i = 0; i < drv->nr; i++) { |
2362 | struct uart_state *state = drv->state + i; | 2382 | struct uart_state *state = drv->state + i; |
2383 | struct tty_port *port = &state->port; | ||
2363 | 2384 | ||
2364 | state->close_delay = 500; /* .5 seconds */ | 2385 | tty_port_init(port); |
2365 | state->closing_wait = 30000; /* 30 seconds */ | 2386 | port->close_delay = 500; /* .5 seconds */ |
2366 | mutex_init(&state->mutex); | 2387 | port->closing_wait = 30000; /* 30 seconds */ |
2367 | 2388 | tasklet_init(&state->tlet, uart_tasklet_action, | |
2368 | tty_port_init(&state->info.port); | ||
2369 | init_waitqueue_head(&state->info.delta_msr_wait); | ||
2370 | tasklet_init(&state->info.tlet, uart_tasklet_action, | ||
2371 | (unsigned long)state); | 2389 | (unsigned long)state); |
2372 | } | 2390 | } |
2373 | 2391 | ||
@@ -2408,69 +2426,71 @@ struct tty_driver *uart_console_device(struct console *co, int *index) | |||
2408 | /** | 2426 | /** |
2409 | * uart_add_one_port - attach a driver-defined port structure | 2427 | * uart_add_one_port - attach a driver-defined port structure |
2410 | * @drv: pointer to the uart low level driver structure for this port | 2428 | * @drv: pointer to the uart low level driver structure for this port |
2411 | * @port: uart port structure to use for this port. | 2429 | * @uport: uart port structure to use for this port. |
2412 | * | 2430 | * |
2413 | * This allows the driver to register its own uart_port structure | 2431 | * This allows the driver to register its own uart_port structure |
2414 | * with the core driver. The main purpose is to allow the low | 2432 | * with the core driver. The main purpose is to allow the low |
2415 | * level uart drivers to expand uart_port, rather than having yet | 2433 | * level uart drivers to expand uart_port, rather than having yet |
2416 | * more levels of structures. | 2434 | * more levels of structures. |
2417 | */ | 2435 | */ |
2418 | int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) | 2436 | int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) |
2419 | { | 2437 | { |
2420 | struct uart_state *state; | 2438 | struct uart_state *state; |
2439 | struct tty_port *port; | ||
2421 | int ret = 0; | 2440 | int ret = 0; |
2422 | struct device *tty_dev; | 2441 | struct device *tty_dev; |
2423 | 2442 | ||
2424 | BUG_ON(in_interrupt()); | 2443 | BUG_ON(in_interrupt()); |
2425 | 2444 | ||
2426 | if (port->line >= drv->nr) | 2445 | if (uport->line >= drv->nr) |
2427 | return -EINVAL; | 2446 | return -EINVAL; |
2428 | 2447 | ||
2429 | state = drv->state + port->line; | 2448 | state = drv->state + uport->line; |
2449 | port = &state->port; | ||
2430 | 2450 | ||
2431 | mutex_lock(&port_mutex); | 2451 | mutex_lock(&port_mutex); |
2432 | mutex_lock(&state->mutex); | 2452 | mutex_lock(&port->mutex); |
2433 | if (state->port) { | 2453 | if (state->uart_port) { |
2434 | ret = -EINVAL; | 2454 | ret = -EINVAL; |
2435 | goto out; | 2455 | goto out; |
2436 | } | 2456 | } |
2437 | 2457 | ||
2438 | state->port = port; | 2458 | state->uart_port = uport; |
2439 | state->pm_state = -1; | 2459 | state->pm_state = -1; |
2440 | 2460 | ||
2441 | port->cons = drv->cons; | 2461 | uport->cons = drv->cons; |
2442 | port->info = &state->info; | 2462 | uport->state = state; |
2443 | 2463 | ||
2444 | /* | 2464 | /* |
2445 | * If this port is a console, then the spinlock is already | 2465 | * If this port is a console, then the spinlock is already |
2446 | * initialised. | 2466 | * initialised. |
2447 | */ | 2467 | */ |
2448 | if (!(uart_console(port) && (port->cons->flags & CON_ENABLED))) { | 2468 | if (!(uart_console(uport) && (uport->cons->flags & CON_ENABLED))) { |
2449 | spin_lock_init(&port->lock); | 2469 | spin_lock_init(&uport->lock); |
2450 | lockdep_set_class(&port->lock, &port_lock_key); | 2470 | lockdep_set_class(&uport->lock, &port_lock_key); |
2451 | } | 2471 | } |
2452 | 2472 | ||
2453 | uart_configure_port(drv, state, port); | 2473 | uart_configure_port(drv, state, uport); |
2454 | 2474 | ||
2455 | /* | 2475 | /* |
2456 | * Register the port whether it's detected or not. This allows | 2476 | * Register the port whether it's detected or not. This allows |
2457 | * setserial to be used to alter this ports parameters. | 2477 | * setserial to be used to alter this ports parameters. |
2458 | */ | 2478 | */ |
2459 | tty_dev = tty_register_device(drv->tty_driver, port->line, port->dev); | 2479 | tty_dev = tty_register_device(drv->tty_driver, uport->line, uport->dev); |
2460 | if (likely(!IS_ERR(tty_dev))) { | 2480 | if (likely(!IS_ERR(tty_dev))) { |
2461 | device_init_wakeup(tty_dev, 1); | 2481 | device_init_wakeup(tty_dev, 1); |
2462 | device_set_wakeup_enable(tty_dev, 0); | 2482 | device_set_wakeup_enable(tty_dev, 0); |
2463 | } else | 2483 | } else |
2464 | printk(KERN_ERR "Cannot register tty device on line %d\n", | 2484 | printk(KERN_ERR "Cannot register tty device on line %d\n", |
2465 | port->line); | 2485 | uport->line); |
2466 | 2486 | ||
2467 | /* | 2487 | /* |
2468 | * Ensure UPF_DEAD is not set. | 2488 | * Ensure UPF_DEAD is not set. |
2469 | */ | 2489 | */ |
2470 | port->flags &= ~UPF_DEAD; | 2490 | uport->flags &= ~UPF_DEAD; |
2471 | 2491 | ||
2472 | out: | 2492 | out: |
2473 | mutex_unlock(&state->mutex); | 2493 | mutex_unlock(&port->mutex); |
2474 | mutex_unlock(&port_mutex); | 2494 | mutex_unlock(&port_mutex); |
2475 | 2495 | ||
2476 | return ret; | 2496 | return ret; |
@@ -2479,22 +2499,22 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) | |||
2479 | /** | 2499 | /** |
2480 | * uart_remove_one_port - detach a driver defined port structure | 2500 | * uart_remove_one_port - detach a driver defined port structure |
2481 | * @drv: pointer to the uart low level driver structure for this port | 2501 | * @drv: pointer to the uart low level driver structure for this port |
2482 | * @port: uart port structure for this port | 2502 | * @uport: uart port structure for this port |
2483 | * | 2503 | * |
2484 | * This unhooks (and hangs up) the specified port structure from the | 2504 | * This unhooks (and hangs up) the specified port structure from the |
2485 | * core driver. No further calls will be made to the low-level code | 2505 | * core driver. No further calls will be made to the low-level code |
2486 | * for this port. | 2506 | * for this port. |
2487 | */ | 2507 | */ |
2488 | int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port) | 2508 | int uart_remove_one_port(struct uart_driver *drv, struct uart_port *uport) |
2489 | { | 2509 | { |
2490 | struct uart_state *state = drv->state + port->line; | 2510 | struct uart_state *state = drv->state + uport->line; |
2491 | struct uart_info *info; | 2511 | struct tty_port *port = &state->port; |
2492 | 2512 | ||
2493 | BUG_ON(in_interrupt()); | 2513 | BUG_ON(in_interrupt()); |
2494 | 2514 | ||
2495 | if (state->port != port) | 2515 | if (state->uart_port != uport) |
2496 | printk(KERN_ALERT "Removing wrong port: %p != %p\n", | 2516 | printk(KERN_ALERT "Removing wrong port: %p != %p\n", |
2497 | state->port, port); | 2517 | state->uart_port, uport); |
2498 | 2518 | ||
2499 | mutex_lock(&port_mutex); | 2519 | mutex_lock(&port_mutex); |
2500 | 2520 | ||
@@ -2502,37 +2522,35 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port) | |||
2502 | * Mark the port "dead" - this prevents any opens from | 2522 | * Mark the port "dead" - this prevents any opens from |
2503 | * succeeding while we shut down the port. | 2523 | * succeeding while we shut down the port. |
2504 | */ | 2524 | */ |
2505 | mutex_lock(&state->mutex); | 2525 | mutex_lock(&port->mutex); |
2506 | port->flags |= UPF_DEAD; | 2526 | uport->flags |= UPF_DEAD; |
2507 | mutex_unlock(&state->mutex); | 2527 | mutex_unlock(&port->mutex); |
2508 | 2528 | ||
2509 | /* | 2529 | /* |
2510 | * Remove the devices from the tty layer | 2530 | * Remove the devices from the tty layer |
2511 | */ | 2531 | */ |
2512 | tty_unregister_device(drv->tty_driver, port->line); | 2532 | tty_unregister_device(drv->tty_driver, uport->line); |
2513 | 2533 | ||
2514 | info = &state->info; | 2534 | if (port->tty) |
2515 | if (info && info->port.tty) | 2535 | tty_vhangup(port->tty); |
2516 | tty_vhangup(info->port.tty); | ||
2517 | 2536 | ||
2518 | /* | 2537 | /* |
2519 | * Free the port IO and memory resources, if any. | 2538 | * Free the port IO and memory resources, if any. |
2520 | */ | 2539 | */ |
2521 | if (port->type != PORT_UNKNOWN) | 2540 | if (uport->type != PORT_UNKNOWN) |
2522 | port->ops->release_port(port); | 2541 | uport->ops->release_port(uport); |
2523 | 2542 | ||
2524 | /* | 2543 | /* |
2525 | * Indicate that there isn't a port here anymore. | 2544 | * Indicate that there isn't a port here anymore. |
2526 | */ | 2545 | */ |
2527 | port->type = PORT_UNKNOWN; | 2546 | uport->type = PORT_UNKNOWN; |
2528 | 2547 | ||
2529 | /* | 2548 | /* |
2530 | * Kill the tasklet, and free resources. | 2549 | * Kill the tasklet, and free resources. |
2531 | */ | 2550 | */ |
2532 | if (info) | 2551 | tasklet_kill(&state->tlet); |
2533 | tasklet_kill(&info->tlet); | ||
2534 | 2552 | ||
2535 | state->port = NULL; | 2553 | state->uart_port = NULL; |
2536 | mutex_unlock(&port_mutex); | 2554 | mutex_unlock(&port_mutex); |
2537 | 2555 | ||
2538 | return 0; | 2556 | return 0; |
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index ed4648b556c7..a3bb49031a7f 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c | |||
@@ -884,6 +884,7 @@ static struct pcmcia_device_id serial_ids[] = { | |||
884 | PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0xa555, "SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- pre update */ | 884 | PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0xa555, "SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- pre update */ |
885 | PCMCIA_DEVICE_CIS_MANF_CARD(0x013f, 0xa555, "SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- post update */ | 885 | PCMCIA_DEVICE_CIS_MANF_CARD(0x013f, 0xa555, "SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- post update */ |
886 | PCMCIA_DEVICE_CIS_PROD_ID12("MultiTech", "PCMCIA 56K DataFax", 0x842047ee, 0xc2efcf03, "cis/MT5634ZLX.cis"), | 886 | PCMCIA_DEVICE_CIS_PROD_ID12("MultiTech", "PCMCIA 56K DataFax", 0x842047ee, 0xc2efcf03, "cis/MT5634ZLX.cis"), |
887 | PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-2", 0x96913a85, 0x27ab5437, "COMpad2.cis"), | ||
887 | PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "COMpad4.cis"), | 888 | PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "COMpad4.cis"), |
888 | PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"), | 889 | PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"), |
889 | PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "cis/RS-COM-2P.cis"), | 890 | PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "cis/RS-COM-2P.cis"), |
diff --git a/drivers/serial/serial_ks8695.c b/drivers/serial/serial_ks8695.c index 52db5cc3f900..2e71bbc04dac 100644 --- a/drivers/serial/serial_ks8695.c +++ b/drivers/serial/serial_ks8695.c | |||
@@ -154,7 +154,7 @@ static void ks8695uart_disable_ms(struct uart_port *port) | |||
154 | static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id) | 154 | static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id) |
155 | { | 155 | { |
156 | struct uart_port *port = dev_id; | 156 | struct uart_port *port = dev_id; |
157 | struct tty_struct *tty = port->info->port.tty; | 157 | struct tty_struct *tty = port->state->port.tty; |
158 | unsigned int status, ch, lsr, flg, max_count = 256; | 158 | unsigned int status, ch, lsr, flg, max_count = 256; |
159 | 159 | ||
160 | status = UART_GET_LSR(port); /* clears pending LSR interrupts */ | 160 | status = UART_GET_LSR(port); /* clears pending LSR interrupts */ |
@@ -210,7 +210,7 @@ ignore_char: | |||
210 | static irqreturn_t ks8695uart_tx_chars(int irq, void *dev_id) | 210 | static irqreturn_t ks8695uart_tx_chars(int irq, void *dev_id) |
211 | { | 211 | { |
212 | struct uart_port *port = dev_id; | 212 | struct uart_port *port = dev_id; |
213 | struct circ_buf *xmit = &port->info->xmit; | 213 | struct circ_buf *xmit = &port->state->xmit; |
214 | unsigned int count; | 214 | unsigned int count; |
215 | 215 | ||
216 | if (port->x_char) { | 216 | if (port->x_char) { |
@@ -266,7 +266,7 @@ static irqreturn_t ks8695uart_modem_status(int irq, void *dev_id) | |||
266 | if (status & URMS_URTERI) | 266 | if (status & URMS_URTERI) |
267 | port->icount.rng++; | 267 | port->icount.rng++; |
268 | 268 | ||
269 | wake_up_interruptible(&port->info->delta_msr_wait); | 269 | wake_up_interruptible(&port->state->port.delta_msr_wait); |
270 | 270 | ||
271 | return IRQ_HANDLED; | 271 | return IRQ_HANDLED; |
272 | } | 272 | } |
diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c index a7bf024a8286..ea744707c4d6 100644 --- a/drivers/serial/serial_lh7a40x.c +++ b/drivers/serial/serial_lh7a40x.c | |||
@@ -138,7 +138,7 @@ static void lh7a40xuart_enable_ms (struct uart_port* port) | |||
138 | 138 | ||
139 | static void lh7a40xuart_rx_chars (struct uart_port* port) | 139 | static void lh7a40xuart_rx_chars (struct uart_port* port) |
140 | { | 140 | { |
141 | struct tty_struct* tty = port->info->port.tty; | 141 | struct tty_struct* tty = port->state->port.tty; |
142 | int cbRxMax = 256; /* (Gross) limit on receive */ | 142 | int cbRxMax = 256; /* (Gross) limit on receive */ |
143 | unsigned int data; /* Received data and status */ | 143 | unsigned int data; /* Received data and status */ |
144 | unsigned int flag; | 144 | unsigned int flag; |
@@ -184,7 +184,7 @@ static void lh7a40xuart_rx_chars (struct uart_port* port) | |||
184 | 184 | ||
185 | static void lh7a40xuart_tx_chars (struct uart_port* port) | 185 | static void lh7a40xuart_tx_chars (struct uart_port* port) |
186 | { | 186 | { |
187 | struct circ_buf* xmit = &port->info->xmit; | 187 | struct circ_buf* xmit = &port->state->xmit; |
188 | int cbTxMax = port->fifosize; | 188 | int cbTxMax = port->fifosize; |
189 | 189 | ||
190 | if (port->x_char) { | 190 | if (port->x_char) { |
@@ -241,7 +241,7 @@ static void lh7a40xuart_modem_status (struct uart_port* port) | |||
241 | if (delta & CTS) | 241 | if (delta & CTS) |
242 | uart_handle_cts_change (port, status & CTS); | 242 | uart_handle_cts_change (port, status & CTS); |
243 | 243 | ||
244 | wake_up_interruptible (&port->info->delta_msr_wait); | 244 | wake_up_interruptible (&port->state->port.delta_msr_wait); |
245 | } | 245 | } |
246 | 246 | ||
247 | static irqreturn_t lh7a40xuart_int (int irq, void* dev_id) | 247 | static irqreturn_t lh7a40xuart_int (int irq, void* dev_id) |
diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c index 54dd16d66a4b..0f7cf4c453e6 100644 --- a/drivers/serial/serial_txx9.c +++ b/drivers/serial/serial_txx9.c | |||
@@ -272,7 +272,7 @@ static void serial_txx9_initialize(struct uart_port *port) | |||
272 | static inline void | 272 | static inline void |
273 | receive_chars(struct uart_txx9_port *up, unsigned int *status) | 273 | receive_chars(struct uart_txx9_port *up, unsigned int *status) |
274 | { | 274 | { |
275 | struct tty_struct *tty = up->port.info->port.tty; | 275 | struct tty_struct *tty = up->port.state->port.tty; |
276 | unsigned char ch; | 276 | unsigned char ch; |
277 | unsigned int disr = *status; | 277 | unsigned int disr = *status; |
278 | int max_count = 256; | 278 | int max_count = 256; |
@@ -348,7 +348,7 @@ receive_chars(struct uart_txx9_port *up, unsigned int *status) | |||
348 | 348 | ||
349 | static inline void transmit_chars(struct uart_txx9_port *up) | 349 | static inline void transmit_chars(struct uart_txx9_port *up) |
350 | { | 350 | { |
351 | struct circ_buf *xmit = &up->port.info->xmit; | 351 | struct circ_buf *xmit = &up->port.state->xmit; |
352 | int count; | 352 | int count; |
353 | 353 | ||
354 | if (up->port.x_char) { | 354 | if (up->port.x_char) { |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 8e2feb563347..85119fb7cb50 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -272,7 +272,8 @@ static inline void sci_init_pins(struct uart_port *port, unsigned int cflag) | |||
272 | __raw_writew(data, PSCR); | 272 | __raw_writew(data, PSCR); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ | 275 | #elif defined(CONFIG_CPU_SUBTYPE_SH7757) || \ |
276 | defined(CONFIG_CPU_SUBTYPE_SH7763) || \ | ||
276 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ | 277 | defined(CONFIG_CPU_SUBTYPE_SH7780) || \ |
277 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ | 278 | defined(CONFIG_CPU_SUBTYPE_SH7785) || \ |
278 | defined(CONFIG_CPU_SUBTYPE_SH7786) || \ | 279 | defined(CONFIG_CPU_SUBTYPE_SH7786) || \ |
@@ -360,7 +361,7 @@ static inline int sci_rxroom(struct uart_port *port) | |||
360 | 361 | ||
361 | static void sci_transmit_chars(struct uart_port *port) | 362 | static void sci_transmit_chars(struct uart_port *port) |
362 | { | 363 | { |
363 | struct circ_buf *xmit = &port->info->xmit; | 364 | struct circ_buf *xmit = &port->state->xmit; |
364 | unsigned int stopped = uart_tx_stopped(port); | 365 | unsigned int stopped = uart_tx_stopped(port); |
365 | unsigned short status; | 366 | unsigned short status; |
366 | unsigned short ctrl; | 367 | unsigned short ctrl; |
@@ -425,7 +426,7 @@ static void sci_transmit_chars(struct uart_port *port) | |||
425 | static inline void sci_receive_chars(struct uart_port *port) | 426 | static inline void sci_receive_chars(struct uart_port *port) |
426 | { | 427 | { |
427 | struct sci_port *sci_port = to_sci_port(port); | 428 | struct sci_port *sci_port = to_sci_port(port); |
428 | struct tty_struct *tty = port->info->port.tty; | 429 | struct tty_struct *tty = port->state->port.tty; |
429 | int i, count, copied = 0; | 430 | int i, count, copied = 0; |
430 | unsigned short status; | 431 | unsigned short status; |
431 | unsigned char flag; | 432 | unsigned char flag; |
@@ -545,7 +546,7 @@ static inline int sci_handle_errors(struct uart_port *port) | |||
545 | { | 546 | { |
546 | int copied = 0; | 547 | int copied = 0; |
547 | unsigned short status = sci_in(port, SCxSR); | 548 | unsigned short status = sci_in(port, SCxSR); |
548 | struct tty_struct *tty = port->info->port.tty; | 549 | struct tty_struct *tty = port->state->port.tty; |
549 | 550 | ||
550 | if (status & SCxSR_ORER(port)) { | 551 | if (status & SCxSR_ORER(port)) { |
551 | /* overrun error */ | 552 | /* overrun error */ |
@@ -599,7 +600,7 @@ static inline int sci_handle_errors(struct uart_port *port) | |||
599 | 600 | ||
600 | static inline int sci_handle_fifo_overrun(struct uart_port *port) | 601 | static inline int sci_handle_fifo_overrun(struct uart_port *port) |
601 | { | 602 | { |
602 | struct tty_struct *tty = port->info->port.tty; | 603 | struct tty_struct *tty = port->state->port.tty; |
603 | int copied = 0; | 604 | int copied = 0; |
604 | 605 | ||
605 | if (port->type != PORT_SCIF) | 606 | if (port->type != PORT_SCIF) |
@@ -622,7 +623,7 @@ static inline int sci_handle_breaks(struct uart_port *port) | |||
622 | { | 623 | { |
623 | int copied = 0; | 624 | int copied = 0; |
624 | unsigned short status = sci_in(port, SCxSR); | 625 | unsigned short status = sci_in(port, SCxSR); |
625 | struct tty_struct *tty = port->info->port.tty; | 626 | struct tty_struct *tty = port->state->port.tty; |
626 | struct sci_port *s = to_sci_port(port); | 627 | struct sci_port *s = to_sci_port(port); |
627 | 628 | ||
628 | if (uart_handle_break(port)) | 629 | if (uart_handle_break(port)) |
@@ -662,10 +663,11 @@ static irqreturn_t sci_rx_interrupt(int irq, void *port) | |||
662 | static irqreturn_t sci_tx_interrupt(int irq, void *ptr) | 663 | static irqreturn_t sci_tx_interrupt(int irq, void *ptr) |
663 | { | 664 | { |
664 | struct uart_port *port = ptr; | 665 | struct uart_port *port = ptr; |
666 | unsigned long flags; | ||
665 | 667 | ||
666 | spin_lock_irq(&port->lock); | 668 | spin_lock_irqsave(&port->lock, flags); |
667 | sci_transmit_chars(port); | 669 | sci_transmit_chars(port); |
668 | spin_unlock_irq(&port->lock); | 670 | spin_unlock_irqrestore(&port->lock, flags); |
669 | 671 | ||
670 | return IRQ_HANDLED; | 672 | return IRQ_HANDLED; |
671 | } | 673 | } |
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index 38072c15b845..3e2fcf93b42e 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h | |||
@@ -112,6 +112,13 @@ | |||
112 | #elif defined(CONFIG_H8S2678) | 112 | #elif defined(CONFIG_H8S2678) |
113 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ | 113 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ |
114 | # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) | 114 | # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) |
115 | #elif defined(CONFIG_CPU_SUBTYPE_SH7757) | ||
116 | # define SCSPTR0 0xfe4b0020 | ||
117 | # define SCSPTR1 0xfe4b0020 | ||
118 | # define SCSPTR2 0xfe4b0020 | ||
119 | # define SCIF_ORER 0x0001 | ||
120 | # define SCSCR_INIT(port) 0x38 | ||
121 | # define SCIF_ONLY | ||
115 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) | 122 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) |
116 | # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ | 123 | # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ |
117 | # define SCSPTR1 0xffe08024 /* 16 bit SCIF */ | 124 | # define SCSPTR1 0xffe08024 /* 16 bit SCIF */ |
@@ -562,6 +569,16 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
562 | return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */ | 569 | return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */ |
563 | return 1; | 570 | return 1; |
564 | } | 571 | } |
572 | #elif defined(CONFIG_CPU_SUBTYPE_SH7757) | ||
573 | static inline int sci_rxd_in(struct uart_port *port) | ||
574 | { | ||
575 | if (port->mapbase == 0xfe4b0000) | ||
576 | return ctrl_inw(SCSPTR0) & 0x0001 ? 1 : 0; | ||
577 | if (port->mapbase == 0xfe4c0000) | ||
578 | return ctrl_inw(SCSPTR1) & 0x0001 ? 1 : 0; | ||
579 | if (port->mapbase == 0xfe4d0000) | ||
580 | return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; | ||
581 | } | ||
565 | #elif defined(CONFIG_CPU_SUBTYPE_SH7760) | 582 | #elif defined(CONFIG_CPU_SUBTYPE_SH7760) |
566 | static inline int sci_rxd_in(struct uart_port *port) | 583 | static inline int sci_rxd_in(struct uart_port *port) |
567 | { | 584 | { |
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index d5276c012f78..9794e0cd3dcc 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c | |||
@@ -469,9 +469,9 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags) | |||
469 | return; | 469 | return; |
470 | } | 470 | } |
471 | 471 | ||
472 | if (port->sc_port.info) { | 472 | if (port->sc_port.state) { |
473 | /* The serial_core stuffs are initilized, use them */ | 473 | /* The serial_core stuffs are initilized, use them */ |
474 | tty = port->sc_port.info->port.tty; | 474 | tty = port->sc_port.state->port.tty; |
475 | } | 475 | } |
476 | else { | 476 | else { |
477 | /* Not registered yet - can't pass to tty layer. */ | 477 | /* Not registered yet - can't pass to tty layer. */ |
@@ -550,9 +550,9 @@ static void sn_transmit_chars(struct sn_cons_port *port, int raw) | |||
550 | 550 | ||
551 | BUG_ON(!port->sc_is_asynch); | 551 | BUG_ON(!port->sc_is_asynch); |
552 | 552 | ||
553 | if (port->sc_port.info) { | 553 | if (port->sc_port.state) { |
554 | /* We're initilized, using serial core infrastructure */ | 554 | /* We're initilized, using serial core infrastructure */ |
555 | xmit = &port->sc_port.info->xmit; | 555 | xmit = &port->sc_port.state->xmit; |
556 | } else { | 556 | } else { |
557 | /* Probably sn_sal_switch_to_asynch has been run but serial core isn't | 557 | /* Probably sn_sal_switch_to_asynch has been run but serial core isn't |
558 | * initilized yet. Just return. Writes are going through | 558 | * initilized yet. Just return. Writes are going through |
@@ -927,7 +927,7 @@ sn_sal_console_write(struct console *co, const char *s, unsigned count) | |||
927 | /* We can't look at the xmit buffer if we're not registered with serial core | 927 | /* We can't look at the xmit buffer if we're not registered with serial core |
928 | * yet. So only do the fancy recovery after registering | 928 | * yet. So only do the fancy recovery after registering |
929 | */ | 929 | */ |
930 | if (!port->sc_port.info) { | 930 | if (!port->sc_port.state) { |
931 | /* Not yet registered with serial core - simple case */ | 931 | /* Not yet registered with serial core - simple case */ |
932 | puts_raw_fixed(port->sc_ops->sal_puts_raw, s, count); | 932 | puts_raw_fixed(port->sc_ops->sal_puts_raw, s, count); |
933 | return; | 933 | return; |
@@ -936,8 +936,8 @@ sn_sal_console_write(struct console *co, const char *s, unsigned count) | |||
936 | /* somebody really wants this output, might be an | 936 | /* somebody really wants this output, might be an |
937 | * oops, kdb, panic, etc. make sure they get it. */ | 937 | * oops, kdb, panic, etc. make sure they get it. */ |
938 | if (spin_is_locked(&port->sc_port.lock)) { | 938 | if (spin_is_locked(&port->sc_port.lock)) { |
939 | int lhead = port->sc_port.info->xmit.head; | 939 | int lhead = port->sc_port.state->xmit.head; |
940 | int ltail = port->sc_port.info->xmit.tail; | 940 | int ltail = port->sc_port.state->xmit.tail; |
941 | int counter, got_lock = 0; | 941 | int counter, got_lock = 0; |
942 | 942 | ||
943 | /* | 943 | /* |
@@ -962,13 +962,13 @@ sn_sal_console_write(struct console *co, const char *s, unsigned count) | |||
962 | break; | 962 | break; |
963 | } else { | 963 | } else { |
964 | /* still locked */ | 964 | /* still locked */ |
965 | if ((lhead != port->sc_port.info->xmit.head) | 965 | if ((lhead != port->sc_port.state->xmit.head) |
966 | || (ltail != | 966 | || (ltail != |
967 | port->sc_port.info->xmit.tail)) { | 967 | port->sc_port.state->xmit.tail)) { |
968 | lhead = | 968 | lhead = |
969 | port->sc_port.info->xmit.head; | 969 | port->sc_port.state->xmit.head; |
970 | ltail = | 970 | ltail = |
971 | port->sc_port.info->xmit.tail; | 971 | port->sc_port.state->xmit.tail; |
972 | counter = 0; | 972 | counter = 0; |
973 | } | 973 | } |
974 | } | 974 | } |
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c index 1df5325faab2..d548652dee50 100644 --- a/drivers/serial/sunhv.c +++ b/drivers/serial/sunhv.c | |||
@@ -184,8 +184,8 @@ static struct tty_struct *receive_chars(struct uart_port *port) | |||
184 | { | 184 | { |
185 | struct tty_struct *tty = NULL; | 185 | struct tty_struct *tty = NULL; |
186 | 186 | ||
187 | if (port->info != NULL) /* Unopened serial console */ | 187 | if (port->state != NULL) /* Unopened serial console */ |
188 | tty = port->info->port.tty; | 188 | tty = port->state->port.tty; |
189 | 189 | ||
190 | if (sunhv_ops->receive_chars(port, tty)) | 190 | if (sunhv_ops->receive_chars(port, tty)) |
191 | sun_do_break(); | 191 | sun_do_break(); |
@@ -197,10 +197,10 @@ static void transmit_chars(struct uart_port *port) | |||
197 | { | 197 | { |
198 | struct circ_buf *xmit; | 198 | struct circ_buf *xmit; |
199 | 199 | ||
200 | if (!port->info) | 200 | if (!port->state) |
201 | return; | 201 | return; |
202 | 202 | ||
203 | xmit = &port->info->xmit; | 203 | xmit = &port->state->xmit; |
204 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) | 204 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) |
205 | return; | 205 | return; |
206 | 206 | ||
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 0355efe115d9..d1ad34128635 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c | |||
@@ -117,8 +117,8 @@ receive_chars(struct uart_sunsab_port *up, | |||
117 | int count = 0; | 117 | int count = 0; |
118 | int i; | 118 | int i; |
119 | 119 | ||
120 | if (up->port.info != NULL) /* Unopened serial console */ | 120 | if (up->port.state != NULL) /* Unopened serial console */ |
121 | tty = up->port.info->port.tty; | 121 | tty = up->port.state->port.tty; |
122 | 122 | ||
123 | /* Read number of BYTES (Character + Status) available. */ | 123 | /* Read number of BYTES (Character + Status) available. */ |
124 | if (stat->sreg.isr0 & SAB82532_ISR0_RPF) { | 124 | if (stat->sreg.isr0 & SAB82532_ISR0_RPF) { |
@@ -229,7 +229,7 @@ static void sunsab_tx_idle(struct uart_sunsab_port *); | |||
229 | static void transmit_chars(struct uart_sunsab_port *up, | 229 | static void transmit_chars(struct uart_sunsab_port *up, |
230 | union sab82532_irq_status *stat) | 230 | union sab82532_irq_status *stat) |
231 | { | 231 | { |
232 | struct circ_buf *xmit = &up->port.info->xmit; | 232 | struct circ_buf *xmit = &up->port.state->xmit; |
233 | int i; | 233 | int i; |
234 | 234 | ||
235 | if (stat->sreg.isr1 & SAB82532_ISR1_ALLS) { | 235 | if (stat->sreg.isr1 & SAB82532_ISR1_ALLS) { |
@@ -297,7 +297,7 @@ static void check_status(struct uart_sunsab_port *up, | |||
297 | up->port.icount.dsr++; | 297 | up->port.icount.dsr++; |
298 | } | 298 | } |
299 | 299 | ||
300 | wake_up_interruptible(&up->port.info->delta_msr_wait); | 300 | wake_up_interruptible(&up->port.state->port.delta_msr_wait); |
301 | } | 301 | } |
302 | 302 | ||
303 | static irqreturn_t sunsab_interrupt(int irq, void *dev_id) | 303 | static irqreturn_t sunsab_interrupt(int irq, void *dev_id) |
@@ -429,7 +429,7 @@ static void sunsab_tx_idle(struct uart_sunsab_port *up) | |||
429 | static void sunsab_start_tx(struct uart_port *port) | 429 | static void sunsab_start_tx(struct uart_port *port) |
430 | { | 430 | { |
431 | struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; | 431 | struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; |
432 | struct circ_buf *xmit = &up->port.info->xmit; | 432 | struct circ_buf *xmit = &up->port.state->xmit; |
433 | int i; | 433 | int i; |
434 | 434 | ||
435 | up->interrupt_mask1 &= ~(SAB82532_IMR1_ALLS|SAB82532_IMR1_XPR); | 435 | up->interrupt_mask1 &= ~(SAB82532_IMR1_ALLS|SAB82532_IMR1_XPR); |
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 47c6837850b1..68d262b15749 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
@@ -311,7 +311,7 @@ static void sunsu_enable_ms(struct uart_port *port) | |||
311 | static struct tty_struct * | 311 | static struct tty_struct * |
312 | receive_chars(struct uart_sunsu_port *up, unsigned char *status) | 312 | receive_chars(struct uart_sunsu_port *up, unsigned char *status) |
313 | { | 313 | { |
314 | struct tty_struct *tty = up->port.info->port.tty; | 314 | struct tty_struct *tty = up->port.state->port.tty; |
315 | unsigned char ch, flag; | 315 | unsigned char ch, flag; |
316 | int max_count = 256; | 316 | int max_count = 256; |
317 | int saw_console_brk = 0; | 317 | int saw_console_brk = 0; |
@@ -389,7 +389,7 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status) | |||
389 | 389 | ||
390 | static void transmit_chars(struct uart_sunsu_port *up) | 390 | static void transmit_chars(struct uart_sunsu_port *up) |
391 | { | 391 | { |
392 | struct circ_buf *xmit = &up->port.info->xmit; | 392 | struct circ_buf *xmit = &up->port.state->xmit; |
393 | int count; | 393 | int count; |
394 | 394 | ||
395 | if (up->port.x_char) { | 395 | if (up->port.x_char) { |
@@ -441,7 +441,7 @@ static void check_modem_status(struct uart_sunsu_port *up) | |||
441 | if (status & UART_MSR_DCTS) | 441 | if (status & UART_MSR_DCTS) |
442 | uart_handle_cts_change(&up->port, status & UART_MSR_CTS); | 442 | uart_handle_cts_change(&up->port, status & UART_MSR_CTS); |
443 | 443 | ||
444 | wake_up_interruptible(&up->port.info->delta_msr_wait); | 444 | wake_up_interruptible(&up->port.state->port.delta_msr_wait); |
445 | } | 445 | } |
446 | 446 | ||
447 | static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id) | 447 | static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id) |
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index e09d3cebb4fb..ef693ae22e7f 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c | |||
@@ -328,9 +328,9 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up, | |||
328 | unsigned char ch, r1, flag; | 328 | unsigned char ch, r1, flag; |
329 | 329 | ||
330 | tty = NULL; | 330 | tty = NULL; |
331 | if (up->port.info != NULL && /* Unopened serial console */ | 331 | if (up->port.state != NULL && /* Unopened serial console */ |
332 | up->port.info->port.tty != NULL) /* Keyboard || mouse */ | 332 | up->port.state->port.tty != NULL) /* Keyboard || mouse */ |
333 | tty = up->port.info->port.tty; | 333 | tty = up->port.state->port.tty; |
334 | 334 | ||
335 | for (;;) { | 335 | for (;;) { |
336 | 336 | ||
@@ -451,7 +451,7 @@ static void sunzilog_status_handle(struct uart_sunzilog_port *up, | |||
451 | uart_handle_cts_change(&up->port, | 451 | uart_handle_cts_change(&up->port, |
452 | (status & CTS)); | 452 | (status & CTS)); |
453 | 453 | ||
454 | wake_up_interruptible(&up->port.info->delta_msr_wait); | 454 | wake_up_interruptible(&up->port.state->port.delta_msr_wait); |
455 | } | 455 | } |
456 | 456 | ||
457 | up->prev_status = status; | 457 | up->prev_status = status; |
@@ -501,9 +501,9 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up, | |||
501 | return; | 501 | return; |
502 | } | 502 | } |
503 | 503 | ||
504 | if (up->port.info == NULL) | 504 | if (up->port.state == NULL) |
505 | goto ack_tx_int; | 505 | goto ack_tx_int; |
506 | xmit = &up->port.info->xmit; | 506 | xmit = &up->port.state->xmit; |
507 | if (uart_circ_empty(xmit)) | 507 | if (uart_circ_empty(xmit)) |
508 | goto ack_tx_int; | 508 | goto ack_tx_int; |
509 | 509 | ||
@@ -705,7 +705,7 @@ static void sunzilog_start_tx(struct uart_port *port) | |||
705 | port->icount.tx++; | 705 | port->icount.tx++; |
706 | port->x_char = 0; | 706 | port->x_char = 0; |
707 | } else { | 707 | } else { |
708 | struct circ_buf *xmit = &port->info->xmit; | 708 | struct circ_buf *xmit = &port->state->xmit; |
709 | 709 | ||
710 | writeb(xmit->buf[xmit->tail], &channel->data); | 710 | writeb(xmit->buf[xmit->tail], &channel->data); |
711 | ZSDELAY(); | 711 | ZSDELAY(); |
diff --git a/drivers/serial/timbuart.c b/drivers/serial/timbuart.c index 063a313b755c..34b31da01d09 100644 --- a/drivers/serial/timbuart.c +++ b/drivers/serial/timbuart.c | |||
@@ -77,7 +77,7 @@ static void timbuart_flush_buffer(struct uart_port *port) | |||
77 | 77 | ||
78 | static void timbuart_rx_chars(struct uart_port *port) | 78 | static void timbuart_rx_chars(struct uart_port *port) |
79 | { | 79 | { |
80 | struct tty_struct *tty = port->info->port.tty; | 80 | struct tty_struct *tty = port->state->port.tty; |
81 | 81 | ||
82 | while (ioread32(port->membase + TIMBUART_ISR) & RXDP) { | 82 | while (ioread32(port->membase + TIMBUART_ISR) & RXDP) { |
83 | u8 ch = ioread8(port->membase + TIMBUART_RXFIFO); | 83 | u8 ch = ioread8(port->membase + TIMBUART_RXFIFO); |
@@ -86,7 +86,7 @@ static void timbuart_rx_chars(struct uart_port *port) | |||
86 | } | 86 | } |
87 | 87 | ||
88 | spin_unlock(&port->lock); | 88 | spin_unlock(&port->lock); |
89 | tty_flip_buffer_push(port->info->port.tty); | 89 | tty_flip_buffer_push(port->state->port.tty); |
90 | spin_lock(&port->lock); | 90 | spin_lock(&port->lock); |
91 | 91 | ||
92 | dev_dbg(port->dev, "%s - total read %d bytes\n", | 92 | dev_dbg(port->dev, "%s - total read %d bytes\n", |
@@ -95,7 +95,7 @@ static void timbuart_rx_chars(struct uart_port *port) | |||
95 | 95 | ||
96 | static void timbuart_tx_chars(struct uart_port *port) | 96 | static void timbuart_tx_chars(struct uart_port *port) |
97 | { | 97 | { |
98 | struct circ_buf *xmit = &port->info->xmit; | 98 | struct circ_buf *xmit = &port->state->xmit; |
99 | 99 | ||
100 | while (!(ioread32(port->membase + TIMBUART_ISR) & TXBF) && | 100 | while (!(ioread32(port->membase + TIMBUART_ISR) & TXBF) && |
101 | !uart_circ_empty(xmit)) { | 101 | !uart_circ_empty(xmit)) { |
@@ -118,7 +118,7 @@ static void timbuart_handle_tx_port(struct uart_port *port, u32 isr, u32 *ier) | |||
118 | { | 118 | { |
119 | struct timbuart_port *uart = | 119 | struct timbuart_port *uart = |
120 | container_of(port, struct timbuart_port, port); | 120 | container_of(port, struct timbuart_port, port); |
121 | struct circ_buf *xmit = &port->info->xmit; | 121 | struct circ_buf *xmit = &port->state->xmit; |
122 | 122 | ||
123 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) | 123 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) |
124 | return; | 124 | return; |
@@ -231,7 +231,7 @@ static void timbuart_mctrl_check(struct uart_port *port, u32 isr, u32 *ier) | |||
231 | iowrite32(CTS_DELTA, port->membase + TIMBUART_ISR); | 231 | iowrite32(CTS_DELTA, port->membase + TIMBUART_ISR); |
232 | cts = timbuart_get_mctrl(port); | 232 | cts = timbuart_get_mctrl(port); |
233 | uart_handle_cts_change(port, cts & TIOCM_CTS); | 233 | uart_handle_cts_change(port, cts & TIOCM_CTS); |
234 | wake_up_interruptible(&port->info->delta_msr_wait); | 234 | wake_up_interruptible(&port->state->port.delta_msr_wait); |
235 | } | 235 | } |
236 | 236 | ||
237 | *ier |= CTS_DELTA; | 237 | *ier |= CTS_DELTA; |
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index 3317148a4b93..377f2712289e 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c | |||
@@ -75,7 +75,7 @@ static struct uart_port ulite_ports[ULITE_NR_UARTS]; | |||
75 | 75 | ||
76 | static int ulite_receive(struct uart_port *port, int stat) | 76 | static int ulite_receive(struct uart_port *port, int stat) |
77 | { | 77 | { |
78 | struct tty_struct *tty = port->info->port.tty; | 78 | struct tty_struct *tty = port->state->port.tty; |
79 | unsigned char ch = 0; | 79 | unsigned char ch = 0; |
80 | char flag = TTY_NORMAL; | 80 | char flag = TTY_NORMAL; |
81 | 81 | ||
@@ -125,7 +125,7 @@ static int ulite_receive(struct uart_port *port, int stat) | |||
125 | 125 | ||
126 | static int ulite_transmit(struct uart_port *port, int stat) | 126 | static int ulite_transmit(struct uart_port *port, int stat) |
127 | { | 127 | { |
128 | struct circ_buf *xmit = &port->info->xmit; | 128 | struct circ_buf *xmit = &port->state->xmit; |
129 | 129 | ||
130 | if (stat & ULITE_STATUS_TXFULL) | 130 | if (stat & ULITE_STATUS_TXFULL) |
131 | return 0; | 131 | return 0; |
@@ -154,17 +154,22 @@ static int ulite_transmit(struct uart_port *port, int stat) | |||
154 | static irqreturn_t ulite_isr(int irq, void *dev_id) | 154 | static irqreturn_t ulite_isr(int irq, void *dev_id) |
155 | { | 155 | { |
156 | struct uart_port *port = dev_id; | 156 | struct uart_port *port = dev_id; |
157 | int busy; | 157 | int busy, n = 0; |
158 | 158 | ||
159 | do { | 159 | do { |
160 | int stat = readb(port->membase + ULITE_STATUS); | 160 | int stat = readb(port->membase + ULITE_STATUS); |
161 | busy = ulite_receive(port, stat); | 161 | busy = ulite_receive(port, stat); |
162 | busy |= ulite_transmit(port, stat); | 162 | busy |= ulite_transmit(port, stat); |
163 | n++; | ||
163 | } while (busy); | 164 | } while (busy); |
164 | 165 | ||
165 | tty_flip_buffer_push(port->info->port.tty); | 166 | /* work done? */ |
166 | 167 | if (n > 1) { | |
167 | return IRQ_HANDLED; | 168 | tty_flip_buffer_push(port->state->port.tty); |
169 | return IRQ_HANDLED; | ||
170 | } else { | ||
171 | return IRQ_NONE; | ||
172 | } | ||
168 | } | 173 | } |
169 | 174 | ||
170 | static unsigned int ulite_tx_empty(struct uart_port *port) | 175 | static unsigned int ulite_tx_empty(struct uart_port *port) |
@@ -221,7 +226,7 @@ static int ulite_startup(struct uart_port *port) | |||
221 | int ret; | 226 | int ret; |
222 | 227 | ||
223 | ret = request_irq(port->irq, ulite_isr, | 228 | ret = request_irq(port->irq, ulite_isr, |
224 | IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "uartlite", port); | 229 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, "uartlite", port); |
225 | if (ret) | 230 | if (ret) |
226 | return ret; | 231 | return ret; |
227 | 232 | ||
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c index e945e780b5c9..0c08f286a2ef 100644 --- a/drivers/serial/ucc_uart.c +++ b/drivers/serial/ucc_uart.c | |||
@@ -327,7 +327,7 @@ static int qe_uart_tx_pump(struct uart_qe_port *qe_port) | |||
327 | unsigned char *p; | 327 | unsigned char *p; |
328 | unsigned int count; | 328 | unsigned int count; |
329 | struct uart_port *port = &qe_port->port; | 329 | struct uart_port *port = &qe_port->port; |
330 | struct circ_buf *xmit = &port->info->xmit; | 330 | struct circ_buf *xmit = &port->state->xmit; |
331 | 331 | ||
332 | bdp = qe_port->rx_cur; | 332 | bdp = qe_port->rx_cur; |
333 | 333 | ||
@@ -466,7 +466,7 @@ static void qe_uart_int_rx(struct uart_qe_port *qe_port) | |||
466 | int i; | 466 | int i; |
467 | unsigned char ch, *cp; | 467 | unsigned char ch, *cp; |
468 | struct uart_port *port = &qe_port->port; | 468 | struct uart_port *port = &qe_port->port; |
469 | struct tty_struct *tty = port->info->port.tty; | 469 | struct tty_struct *tty = port->state->port.tty; |
470 | struct qe_bd *bdp; | 470 | struct qe_bd *bdp; |
471 | u16 status; | 471 | u16 status; |
472 | unsigned int flg; | 472 | unsigned int flg; |
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c index dac550e57c29..3beb6ab4fa68 100644 --- a/drivers/serial/vr41xx_siu.c +++ b/drivers/serial/vr41xx_siu.c | |||
@@ -318,7 +318,7 @@ static inline void receive_chars(struct uart_port *port, uint8_t *status) | |||
318 | char flag; | 318 | char flag; |
319 | int max_count = RX_MAX_COUNT; | 319 | int max_count = RX_MAX_COUNT; |
320 | 320 | ||
321 | tty = port->info->port.tty; | 321 | tty = port->state->port.tty; |
322 | lsr = *status; | 322 | lsr = *status; |
323 | 323 | ||
324 | do { | 324 | do { |
@@ -386,7 +386,7 @@ static inline void check_modem_status(struct uart_port *port) | |||
386 | if (msr & UART_MSR_DCTS) | 386 | if (msr & UART_MSR_DCTS) |
387 | uart_handle_cts_change(port, msr & UART_MSR_CTS); | 387 | uart_handle_cts_change(port, msr & UART_MSR_CTS); |
388 | 388 | ||
389 | wake_up_interruptible(&port->info->delta_msr_wait); | 389 | wake_up_interruptible(&port->state->port.delta_msr_wait); |
390 | } | 390 | } |
391 | 391 | ||
392 | static inline void transmit_chars(struct uart_port *port) | 392 | static inline void transmit_chars(struct uart_port *port) |
@@ -394,7 +394,7 @@ static inline void transmit_chars(struct uart_port *port) | |||
394 | struct circ_buf *xmit; | 394 | struct circ_buf *xmit; |
395 | int max_count = TX_MAX_COUNT; | 395 | int max_count = TX_MAX_COUNT; |
396 | 396 | ||
397 | xmit = &port->info->xmit; | 397 | xmit = &port->state->xmit; |
398 | 398 | ||
399 | if (port->x_char) { | 399 | if (port->x_char) { |
400 | siu_write(port, UART_TX, port->x_char); | 400 | siu_write(port, UART_TX, port->x_char); |
diff --git a/drivers/serial/zs.c b/drivers/serial/zs.c index d8c2809b1ab6..1a7fd3e70315 100644 --- a/drivers/serial/zs.c +++ b/drivers/serial/zs.c | |||
@@ -602,12 +602,12 @@ static void zs_receive_chars(struct zs_port *zport) | |||
602 | uart_insert_char(uport, status, Rx_OVR, ch, flag); | 602 | uart_insert_char(uport, status, Rx_OVR, ch, flag); |
603 | } | 603 | } |
604 | 604 | ||
605 | tty_flip_buffer_push(uport->info->port.tty); | 605 | tty_flip_buffer_push(uport->state->port.tty); |
606 | } | 606 | } |
607 | 607 | ||
608 | static void zs_raw_transmit_chars(struct zs_port *zport) | 608 | static void zs_raw_transmit_chars(struct zs_port *zport) |
609 | { | 609 | { |
610 | struct circ_buf *xmit = &zport->port.info->xmit; | 610 | struct circ_buf *xmit = &zport->port.state->xmit; |
611 | 611 | ||
612 | /* XON/XOFF chars. */ | 612 | /* XON/XOFF chars. */ |
613 | if (zport->port.x_char) { | 613 | if (zport->port.x_char) { |
@@ -686,7 +686,7 @@ static void zs_status_handle(struct zs_port *zport, struct zs_port *zport_a) | |||
686 | uport->icount.rng++; | 686 | uport->icount.rng++; |
687 | 687 | ||
688 | if (delta) | 688 | if (delta) |
689 | wake_up_interruptible(&uport->info->delta_msr_wait); | 689 | wake_up_interruptible(&uport->state->port.delta_msr_wait); |
690 | 690 | ||
691 | spin_lock(&scc->zlock); | 691 | spin_lock(&scc->zlock); |
692 | } | 692 | } |