diff options
author | Alan Cox <alan@redhat.com> | 2008-07-16 16:55:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:12:36 -0400 |
commit | 4982d6b37a5ccebe6c2af79970c7a15c1939243a (patch) | |
tree | e1d0a1c2f3d57943c5d3e25ed1921c8062431667 /drivers | |
parent | 52d417388d154f68f8ab753de03b1fba1814de81 (diff) |
esp: use tty_port
Switch esp to use the new tty_port structures
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/esp.c | 272 |
1 files changed, 136 insertions, 136 deletions
diff --git a/drivers/char/esp.c b/drivers/char/esp.c index 84840ba13ff0..2eaf09f93e3d 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c | |||
@@ -128,9 +128,9 @@ static struct tty_driver *esp_driver; | |||
128 | 128 | ||
129 | #if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT) | 129 | #if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT) |
130 | #define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \ | 130 | #define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n", \ |
131 | tty->name, info->flags, \ | 131 | tty->name, info->port.flags, \ |
132 | serial_driver.refcount, \ | 132 | serial_driver.refcount, \ |
133 | info->count, tty->count, s) | 133 | info->port.count, tty->count, s) |
134 | #else | 134 | #else |
135 | #define DBG_CNT(s) | 135 | #define DBG_CNT(s) |
136 | #endif | 136 | #endif |
@@ -172,13 +172,13 @@ static inline int serial_paranoia_check(struct esp_struct *info, | |||
172 | 172 | ||
173 | static inline unsigned int serial_in(struct esp_struct *info, int offset) | 173 | static inline unsigned int serial_in(struct esp_struct *info, int offset) |
174 | { | 174 | { |
175 | return inb(info->port + offset); | 175 | return inb(info->io_port + offset); |
176 | } | 176 | } |
177 | 177 | ||
178 | static inline void serial_out(struct esp_struct *info, int offset, | 178 | static inline void serial_out(struct esp_struct *info, int offset, |
179 | unsigned char value) | 179 | unsigned char value) |
180 | { | 180 | { |
181 | outb(value, info->port+offset); | 181 | outb(value, info->io_port+offset); |
182 | } | 182 | } |
183 | 183 | ||
184 | /* | 184 | /* |
@@ -273,7 +273,7 @@ static inline void release_pio_buffer(struct esp_pio_buffer *buf) | |||
273 | 273 | ||
274 | static inline void receive_chars_pio(struct esp_struct *info, int num_bytes) | 274 | static inline void receive_chars_pio(struct esp_struct *info, int num_bytes) |
275 | { | 275 | { |
276 | struct tty_struct *tty = info->tty; | 276 | struct tty_struct *tty = info->port.tty; |
277 | int i; | 277 | int i; |
278 | struct esp_pio_buffer *pio_buf; | 278 | struct esp_pio_buffer *pio_buf; |
279 | struct esp_pio_buffer *err_buf; | 279 | struct esp_pio_buffer *err_buf; |
@@ -295,7 +295,7 @@ static inline void receive_chars_pio(struct esp_struct *info, int num_bytes) | |||
295 | 295 | ||
296 | for (i = 0; i < num_bytes - 1; i += 2) { | 296 | for (i = 0; i < num_bytes - 1; i += 2) { |
297 | *((unsigned short *)(pio_buf->data + i)) = | 297 | *((unsigned short *)(pio_buf->data + i)) = |
298 | inw(info->port + UART_ESI_RX); | 298 | inw(info->io_port + UART_ESI_RX); |
299 | err_buf->data[i] = serial_in(info, UART_ESI_RWS); | 299 | err_buf->data[i] = serial_in(info, UART_ESI_RWS); |
300 | err_buf->data[i + 1] = (err_buf->data[i] >> 3) & status_mask; | 300 | err_buf->data[i + 1] = (err_buf->data[i] >> 3) & status_mask; |
301 | err_buf->data[i] &= status_mask; | 301 | err_buf->data[i] &= status_mask; |
@@ -308,7 +308,7 @@ static inline void receive_chars_pio(struct esp_struct *info, int num_bytes) | |||
308 | } | 308 | } |
309 | 309 | ||
310 | /* make sure everything is still ok since interrupts were enabled */ | 310 | /* make sure everything is still ok since interrupts were enabled */ |
311 | tty = info->tty; | 311 | tty = info->port.tty; |
312 | 312 | ||
313 | if (!tty) { | 313 | if (!tty) { |
314 | release_pio_buffer(pio_buf); | 314 | release_pio_buffer(pio_buf); |
@@ -325,7 +325,7 @@ static inline void receive_chars_pio(struct esp_struct *info, int num_bytes) | |||
325 | 325 | ||
326 | if (err_buf->data[i] & 0x04) { | 326 | if (err_buf->data[i] & 0x04) { |
327 | flag = TTY_BREAK; | 327 | flag = TTY_BREAK; |
328 | if (info->flags & ASYNC_SAK) | 328 | if (info->port.flags & ASYNC_SAK) |
329 | do_SAK(tty); | 329 | do_SAK(tty); |
330 | } else if (err_buf->data[i] & 0x02) | 330 | } else if (err_buf->data[i] & 0x02) |
331 | flag = TTY_FRAME; | 331 | flag = TTY_FRAME; |
@@ -370,7 +370,7 @@ static void receive_chars_dma(struct esp_struct *info, int num_bytes) | |||
370 | static inline void receive_chars_dma_done(struct esp_struct *info, | 370 | static inline void receive_chars_dma_done(struct esp_struct *info, |
371 | int status) | 371 | int status) |
372 | { | 372 | { |
373 | struct tty_struct *tty = info->tty; | 373 | struct tty_struct *tty = info->port.tty; |
374 | int num_bytes; | 374 | int num_bytes; |
375 | unsigned long flags; | 375 | unsigned long flags; |
376 | 376 | ||
@@ -396,7 +396,7 @@ static inline void receive_chars_dma_done(struct esp_struct *info, | |||
396 | if (status & 0x10) { | 396 | if (status & 0x10) { |
397 | statflag = TTY_BREAK; | 397 | statflag = TTY_BREAK; |
398 | (info->icount.brk)++; | 398 | (info->icount.brk)++; |
399 | if (info->flags & ASYNC_SAK) | 399 | if (info->port.flags & ASYNC_SAK) |
400 | do_SAK(tty); | 400 | do_SAK(tty); |
401 | } else if (status & 0x08) { | 401 | } else if (status & 0x08) { |
402 | statflag = TTY_FRAME; | 402 | statflag = TTY_FRAME; |
@@ -451,7 +451,7 @@ static inline void transmit_chars_pio(struct esp_struct *info, | |||
451 | 451 | ||
452 | for (i = 0; i < space_avail - 1; i += 2) { | 452 | for (i = 0; i < space_avail - 1; i += 2) { |
453 | outw(*((unsigned short *)(pio_buf->data + i)), | 453 | outw(*((unsigned short *)(pio_buf->data + i)), |
454 | info->port + UART_ESI_TX); | 454 | info->io_port + UART_ESI_TX); |
455 | } | 455 | } |
456 | 456 | ||
457 | if (space_avail & 0x0001) | 457 | if (space_avail & 0x0001) |
@@ -470,8 +470,8 @@ static inline void transmit_chars_pio(struct esp_struct *info, | |||
470 | } | 470 | } |
471 | 471 | ||
472 | if (info->xmit_cnt < WAKEUP_CHARS) { | 472 | if (info->xmit_cnt < WAKEUP_CHARS) { |
473 | if (info->tty) | 473 | if (info->port.tty) |
474 | tty_wakeup(info->tty); | 474 | tty_wakeup(info->port.tty); |
475 | 475 | ||
476 | #ifdef SERIAL_DEBUG_INTR | 476 | #ifdef SERIAL_DEBUG_INTR |
477 | printk("THRE..."); | 477 | printk("THRE..."); |
@@ -507,8 +507,8 @@ static inline void transmit_chars_dma(struct esp_struct *info, int num_bytes) | |||
507 | info->xmit_tail = (info->xmit_tail + dma_bytes) & (ESP_XMIT_SIZE - 1); | 507 | info->xmit_tail = (info->xmit_tail + dma_bytes) & (ESP_XMIT_SIZE - 1); |
508 | 508 | ||
509 | if (info->xmit_cnt < WAKEUP_CHARS) { | 509 | if (info->xmit_cnt < WAKEUP_CHARS) { |
510 | if (info->tty) | 510 | if (info->port.tty) |
511 | tty_wakeup(info->tty); | 511 | tty_wakeup(info->port.tty); |
512 | 512 | ||
513 | #ifdef SERIAL_DEBUG_INTR | 513 | #ifdef SERIAL_DEBUG_INTR |
514 | printk("THRE..."); | 514 | printk("THRE..."); |
@@ -575,18 +575,18 @@ static void check_modem_status(struct esp_struct *info) | |||
575 | wake_up_interruptible(&info->delta_msr_wait); | 575 | wake_up_interruptible(&info->delta_msr_wait); |
576 | } | 576 | } |
577 | 577 | ||
578 | if ((info->flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) { | 578 | if ((info->port.flags & ASYNC_CHECK_CD) && (status & UART_MSR_DDCD)) { |
579 | #if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR)) | 579 | #if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR)) |
580 | printk("ttys%d CD now %s...", info->line, | 580 | printk("ttys%d CD now %s...", info->line, |
581 | (status & UART_MSR_DCD) ? "on" : "off"); | 581 | (status & UART_MSR_DCD) ? "on" : "off"); |
582 | #endif | 582 | #endif |
583 | if (status & UART_MSR_DCD) | 583 | if (status & UART_MSR_DCD) |
584 | wake_up_interruptible(&info->open_wait); | 584 | wake_up_interruptible(&info->port.open_wait); |
585 | else { | 585 | else { |
586 | #ifdef SERIAL_DEBUG_OPEN | 586 | #ifdef SERIAL_DEBUG_OPEN |
587 | printk("scheduling hangup..."); | 587 | printk("scheduling hangup..."); |
588 | #endif | 588 | #endif |
589 | tty_hangup(info->tty); | 589 | tty_hangup(info->port.tty); |
590 | } | 590 | } |
591 | } | 591 | } |
592 | } | 592 | } |
@@ -609,7 +609,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) | |||
609 | 609 | ||
610 | spin_lock(&info->lock); | 610 | spin_lock(&info->lock); |
611 | 611 | ||
612 | if (!info->tty) { | 612 | if (!info->port.tty) { |
613 | spin_unlock(&info->lock); | 613 | spin_unlock(&info->lock); |
614 | return IRQ_NONE; | 614 | return IRQ_NONE; |
615 | } | 615 | } |
@@ -647,7 +647,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) | |||
647 | num_bytes = serial_in(info, UART_ESI_STAT1) << 8; | 647 | num_bytes = serial_in(info, UART_ESI_STAT1) << 8; |
648 | num_bytes |= serial_in(info, UART_ESI_STAT2); | 648 | num_bytes |= serial_in(info, UART_ESI_STAT2); |
649 | 649 | ||
650 | num_bytes = tty_buffer_request_room(info->tty, num_bytes); | 650 | num_bytes = tty_buffer_request_room(info->port.tty, num_bytes); |
651 | 651 | ||
652 | if (num_bytes) { | 652 | if (num_bytes) { |
653 | if (dma_bytes || | 653 | if (dma_bytes || |
@@ -661,7 +661,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) | |||
661 | 661 | ||
662 | if (!(info->stat_flags & (ESP_STAT_DMA_RX | ESP_STAT_DMA_TX)) && | 662 | if (!(info->stat_flags & (ESP_STAT_DMA_RX | ESP_STAT_DMA_TX)) && |
663 | (scratch & 0x02) && (info->IER & UART_IER_THRI)) { | 663 | (scratch & 0x02) && (info->IER & UART_IER_THRI)) { |
664 | if ((info->xmit_cnt <= 0) || info->tty->stopped) { | 664 | if ((info->xmit_cnt <= 0) || info->port.tty->stopped) { |
665 | info->IER &= ~UART_IER_THRI; | 665 | info->IER &= ~UART_IER_THRI; |
666 | serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); | 666 | serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); |
667 | serial_out(info, UART_ESI_CMD2, info->IER); | 667 | serial_out(info, UART_ESI_CMD2, info->IER); |
@@ -782,7 +782,7 @@ static int startup(struct esp_struct *info) | |||
782 | 782 | ||
783 | spin_lock_irqsave(&info->lock, flags); | 783 | spin_lock_irqsave(&info->lock, flags); |
784 | 784 | ||
785 | if (info->flags & ASYNC_INITIALIZED) | 785 | if (info->port.flags & ASYNC_INITIALIZED) |
786 | goto out; | 786 | goto out; |
787 | 787 | ||
788 | if (!info->xmit_buf) { | 788 | if (!info->xmit_buf) { |
@@ -806,7 +806,7 @@ static int startup(struct esp_struct *info) | |||
806 | num_chars |= serial_in(info, UART_ESI_STAT2); | 806 | num_chars |= serial_in(info, UART_ESI_STAT2); |
807 | 807 | ||
808 | while (num_chars > 1) { | 808 | while (num_chars > 1) { |
809 | inw(info->port + UART_ESI_RX); | 809 | inw(info->io_port + UART_ESI_RX); |
810 | num_chars -= 2; | 810 | num_chars -= 2; |
811 | } | 811 | } |
812 | 812 | ||
@@ -834,9 +834,9 @@ static int startup(struct esp_struct *info) | |||
834 | 834 | ||
835 | if (retval) { | 835 | if (retval) { |
836 | if (capable(CAP_SYS_ADMIN)) { | 836 | if (capable(CAP_SYS_ADMIN)) { |
837 | if (info->tty) | 837 | if (info->port.tty) |
838 | set_bit(TTY_IO_ERROR, | 838 | set_bit(TTY_IO_ERROR, |
839 | &info->tty->flags); | 839 | &info->port.tty->flags); |
840 | retval = 0; | 840 | retval = 0; |
841 | } | 841 | } |
842 | goto out_unlocked; | 842 | goto out_unlocked; |
@@ -874,30 +874,30 @@ static int startup(struct esp_struct *info) | |||
874 | serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); | 874 | serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); |
875 | serial_out(info, UART_ESI_CMD2, info->IER); | 875 | serial_out(info, UART_ESI_CMD2, info->IER); |
876 | 876 | ||
877 | if (info->tty) | 877 | if (info->port.tty) |
878 | clear_bit(TTY_IO_ERROR, &info->tty->flags); | 878 | clear_bit(TTY_IO_ERROR, &info->port.tty->flags); |
879 | info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; | 879 | info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; |
880 | spin_unlock_irqrestore(&info->lock, flags); | 880 | spin_unlock_irqrestore(&info->lock, flags); |
881 | 881 | ||
882 | /* | 882 | /* |
883 | * Set up the tty->alt_speed kludge | 883 | * Set up the tty->alt_speed kludge |
884 | */ | 884 | */ |
885 | if (info->tty) { | 885 | if (info->port.tty) { |
886 | if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) | 886 | if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) |
887 | info->tty->alt_speed = 57600; | 887 | info->port.tty->alt_speed = 57600; |
888 | if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) | 888 | if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) |
889 | info->tty->alt_speed = 115200; | 889 | info->port.tty->alt_speed = 115200; |
890 | if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) | 890 | if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) |
891 | info->tty->alt_speed = 230400; | 891 | info->port.tty->alt_speed = 230400; |
892 | if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) | 892 | if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) |
893 | info->tty->alt_speed = 460800; | 893 | info->port.tty->alt_speed = 460800; |
894 | } | 894 | } |
895 | 895 | ||
896 | /* | 896 | /* |
897 | * set the speed of the serial port | 897 | * set the speed of the serial port |
898 | */ | 898 | */ |
899 | change_speed(info); | 899 | change_speed(info); |
900 | info->flags |= ASYNC_INITIALIZED; | 900 | info->port.flags |= ASYNC_INITIALIZED; |
901 | return 0; | 901 | return 0; |
902 | 902 | ||
903 | out: | 903 | out: |
@@ -914,7 +914,7 @@ static void shutdown(struct esp_struct *info) | |||
914 | { | 914 | { |
915 | unsigned long flags, f; | 915 | unsigned long flags, f; |
916 | 916 | ||
917 | if (!(info->flags & ASYNC_INITIALIZED)) | 917 | if (!(info->port.flags & ASYNC_INITIALIZED)) |
918 | return; | 918 | return; |
919 | 919 | ||
920 | #ifdef SERIAL_DEBUG_OPEN | 920 | #ifdef SERIAL_DEBUG_OPEN |
@@ -951,7 +951,7 @@ static void shutdown(struct esp_struct *info) | |||
951 | 951 | ||
952 | while (current_port) { | 952 | while (current_port) { |
953 | if ((current_port != info) && | 953 | if ((current_port != info) && |
954 | (current_port->flags & ASYNC_INITIALIZED)) | 954 | (current_port->port.flags & ASYNC_INITIALIZED)) |
955 | break; | 955 | break; |
956 | 956 | ||
957 | current_port = current_port->next_port; | 957 | current_port = current_port->next_port; |
@@ -974,7 +974,7 @@ static void shutdown(struct esp_struct *info) | |||
974 | serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); | 974 | serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); |
975 | serial_out(info, UART_ESI_CMD2, 0x00); | 975 | serial_out(info, UART_ESI_CMD2, 0x00); |
976 | 976 | ||
977 | if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) | 977 | if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL)) |
978 | info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS); | 978 | info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS); |
979 | 979 | ||
980 | info->MCR &= ~UART_MCR_OUT2; | 980 | info->MCR &= ~UART_MCR_OUT2; |
@@ -982,10 +982,10 @@ static void shutdown(struct esp_struct *info) | |||
982 | serial_out(info, UART_ESI_CMD2, UART_MCR); | 982 | serial_out(info, UART_ESI_CMD2, UART_MCR); |
983 | serial_out(info, UART_ESI_CMD2, info->MCR); | 983 | serial_out(info, UART_ESI_CMD2, info->MCR); |
984 | 984 | ||
985 | if (info->tty) | 985 | if (info->port.tty) |
986 | set_bit(TTY_IO_ERROR, &info->tty->flags); | 986 | set_bit(TTY_IO_ERROR, &info->port.tty->flags); |
987 | 987 | ||
988 | info->flags &= ~ASYNC_INITIALIZED; | 988 | info->port.flags &= ~ASYNC_INITIALIZED; |
989 | spin_unlock_irqrestore(&info->lock, flags); | 989 | spin_unlock_irqrestore(&info->lock, flags); |
990 | } | 990 | } |
991 | 991 | ||
@@ -1002,10 +1002,10 @@ static void change_speed(struct esp_struct *info) | |||
1002 | unsigned char flow1 = 0, flow2 = 0; | 1002 | unsigned char flow1 = 0, flow2 = 0; |
1003 | unsigned long flags; | 1003 | unsigned long flags; |
1004 | 1004 | ||
1005 | if (!info->tty || !info->tty->termios) | 1005 | if (!info->port.tty || !info->port.tty->termios) |
1006 | return; | 1006 | return; |
1007 | cflag = info->tty->termios->c_cflag; | 1007 | cflag = info->port.tty->termios->c_cflag; |
1008 | port = info->port; | 1008 | port = info->io_port; |
1009 | 1009 | ||
1010 | /* byte size and parity */ | 1010 | /* byte size and parity */ |
1011 | switch (cflag & CSIZE) { | 1011 | switch (cflag & CSIZE) { |
@@ -1029,9 +1029,9 @@ static void change_speed(struct esp_struct *info) | |||
1029 | if (cflag & CMSPAR) | 1029 | if (cflag & CMSPAR) |
1030 | cval |= UART_LCR_SPAR; | 1030 | cval |= UART_LCR_SPAR; |
1031 | #endif | 1031 | #endif |
1032 | baud = tty_get_baud_rate(info->tty); | 1032 | baud = tty_get_baud_rate(info->port.tty); |
1033 | if (baud == 38400 && | 1033 | if (baud == 38400 && |
1034 | ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) | 1034 | ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) |
1035 | quot = info->custom_divisor; | 1035 | quot = info->custom_divisor; |
1036 | else { | 1036 | else { |
1037 | if (baud == 134) /* Special case since 134 is really 134.5 */ | 1037 | if (baud == 134) /* Special case since 134 is really 134.5 */ |
@@ -1046,49 +1046,49 @@ static void change_speed(struct esp_struct *info) | |||
1046 | if (baud) { | 1046 | if (baud) { |
1047 | /* Actual rate */ | 1047 | /* Actual rate */ |
1048 | baud = BASE_BAUD/quot; | 1048 | baud = BASE_BAUD/quot; |
1049 | tty_encode_baud_rate(info->tty, baud, baud); | 1049 | tty_encode_baud_rate(info->port.tty, baud, baud); |
1050 | } | 1050 | } |
1051 | info->timeout = ((1024 * HZ * bits * quot) / BASE_BAUD) + (HZ / 50); | 1051 | info->timeout = ((1024 * HZ * bits * quot) / BASE_BAUD) + (HZ / 50); |
1052 | 1052 | ||
1053 | /* CTS flow control flag and modem status interrupts */ | 1053 | /* CTS flow control flag and modem status interrupts */ |
1054 | /* info->IER &= ~UART_IER_MSI; */ | 1054 | /* info->IER &= ~UART_IER_MSI; */ |
1055 | if (cflag & CRTSCTS) { | 1055 | if (cflag & CRTSCTS) { |
1056 | info->flags |= ASYNC_CTS_FLOW; | 1056 | info->port.flags |= ASYNC_CTS_FLOW; |
1057 | /* info->IER |= UART_IER_MSI; */ | 1057 | /* info->IER |= UART_IER_MSI; */ |
1058 | flow1 = 0x04; | 1058 | flow1 = 0x04; |
1059 | flow2 = 0x10; | 1059 | flow2 = 0x10; |
1060 | } else | 1060 | } else |
1061 | info->flags &= ~ASYNC_CTS_FLOW; | 1061 | info->port.flags &= ~ASYNC_CTS_FLOW; |
1062 | if (cflag & CLOCAL) | 1062 | if (cflag & CLOCAL) |
1063 | info->flags &= ~ASYNC_CHECK_CD; | 1063 | info->port.flags &= ~ASYNC_CHECK_CD; |
1064 | else | 1064 | else |
1065 | info->flags |= ASYNC_CHECK_CD; | 1065 | info->port.flags |= ASYNC_CHECK_CD; |
1066 | 1066 | ||
1067 | /* | 1067 | /* |
1068 | * Set up parity check flag | 1068 | * Set up parity check flag |
1069 | */ | 1069 | */ |
1070 | info->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; | 1070 | info->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR; |
1071 | if (I_INPCK(info->tty)) | 1071 | if (I_INPCK(info->port.tty)) |
1072 | info->read_status_mask |= UART_LSR_FE | UART_LSR_PE; | 1072 | info->read_status_mask |= UART_LSR_FE | UART_LSR_PE; |
1073 | if (I_BRKINT(info->tty) || I_PARMRK(info->tty)) | 1073 | if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty)) |
1074 | info->read_status_mask |= UART_LSR_BI; | 1074 | info->read_status_mask |= UART_LSR_BI; |
1075 | 1075 | ||
1076 | info->ignore_status_mask = 0; | 1076 | info->ignore_status_mask = 0; |
1077 | #if 0 | 1077 | #if 0 |
1078 | /* This should be safe, but for some broken bits of hardware... */ | 1078 | /* This should be safe, but for some broken bits of hardware... */ |
1079 | if (I_IGNPAR(info->tty)) { | 1079 | if (I_IGNPAR(info->port.tty)) { |
1080 | info->ignore_status_mask |= UART_LSR_PE | UART_LSR_FE; | 1080 | info->ignore_status_mask |= UART_LSR_PE | UART_LSR_FE; |
1081 | info->read_status_mask |= UART_LSR_PE | UART_LSR_FE; | 1081 | info->read_status_mask |= UART_LSR_PE | UART_LSR_FE; |
1082 | } | 1082 | } |
1083 | #endif | 1083 | #endif |
1084 | if (I_IGNBRK(info->tty)) { | 1084 | if (I_IGNBRK(info->port.tty)) { |
1085 | info->ignore_status_mask |= UART_LSR_BI; | 1085 | info->ignore_status_mask |= UART_LSR_BI; |
1086 | info->read_status_mask |= UART_LSR_BI; | 1086 | info->read_status_mask |= UART_LSR_BI; |
1087 | /* | 1087 | /* |
1088 | * If we're ignore parity and break indicators, ignore | 1088 | * If we're ignore parity and break indicators, ignore |
1089 | * overruns too. (For real raw support). | 1089 | * overruns too. (For real raw support). |
1090 | */ | 1090 | */ |
1091 | if (I_IGNPAR(info->tty)) { | 1091 | if (I_IGNPAR(info->port.tty)) { |
1092 | info->ignore_status_mask |= UART_LSR_OE | \ | 1092 | info->ignore_status_mask |= UART_LSR_OE | \ |
1093 | UART_LSR_PE | UART_LSR_FE; | 1093 | UART_LSR_PE | UART_LSR_FE; |
1094 | info->read_status_mask |= UART_LSR_OE | \ | 1094 | info->read_status_mask |= UART_LSR_OE | \ |
@@ -1096,7 +1096,7 @@ static void change_speed(struct esp_struct *info) | |||
1096 | } | 1096 | } |
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | if (I_IXOFF(info->tty)) | 1099 | if (I_IXOFF(info->port.tty)) |
1100 | flow1 |= 0x81; | 1100 | flow1 |= 0x81; |
1101 | 1101 | ||
1102 | spin_lock_irqsave(&info->lock, flags); | 1102 | spin_lock_irqsave(&info->lock, flags); |
@@ -1116,10 +1116,10 @@ static void change_speed(struct esp_struct *info) | |||
1116 | serial_out(info, UART_ESI_CMD2, flow2); | 1116 | serial_out(info, UART_ESI_CMD2, flow2); |
1117 | 1117 | ||
1118 | /* set flow control characters (XON/XOFF only) */ | 1118 | /* set flow control characters (XON/XOFF only) */ |
1119 | if (I_IXOFF(info->tty)) { | 1119 | if (I_IXOFF(info->port.tty)) { |
1120 | serial_out(info, UART_ESI_CMD1, ESI_SET_FLOW_CHARS); | 1120 | serial_out(info, UART_ESI_CMD1, ESI_SET_FLOW_CHARS); |
1121 | serial_out(info, UART_ESI_CMD2, START_CHAR(info->tty)); | 1121 | serial_out(info, UART_ESI_CMD2, START_CHAR(info->port.tty)); |
1122 | serial_out(info, UART_ESI_CMD2, STOP_CHAR(info->tty)); | 1122 | serial_out(info, UART_ESI_CMD2, STOP_CHAR(info->port.tty)); |
1123 | serial_out(info, UART_ESI_CMD2, 0x10); | 1123 | serial_out(info, UART_ESI_CMD2, 0x10); |
1124 | serial_out(info, UART_ESI_CMD2, 0x21); | 1124 | serial_out(info, UART_ESI_CMD2, 0x21); |
1125 | switch (cflag & CSIZE) { | 1125 | switch (cflag & CSIZE) { |
@@ -1355,9 +1355,9 @@ static int get_serial_info(struct esp_struct *info, | |||
1355 | memset(&tmp, 0, sizeof(tmp)); | 1355 | memset(&tmp, 0, sizeof(tmp)); |
1356 | tmp.type = PORT_16550A; | 1356 | tmp.type = PORT_16550A; |
1357 | tmp.line = info->line; | 1357 | tmp.line = info->line; |
1358 | tmp.port = info->port; | 1358 | tmp.port = info->io_port; |
1359 | tmp.irq = info->irq; | 1359 | tmp.irq = info->irq; |
1360 | tmp.flags = info->flags; | 1360 | tmp.flags = info->port.flags; |
1361 | tmp.xmit_fifo_size = 1024; | 1361 | tmp.xmit_fifo_size = 1024; |
1362 | tmp.baud_base = BASE_BAUD; | 1362 | tmp.baud_base = BASE_BAUD; |
1363 | tmp.close_delay = info->close_delay; | 1363 | tmp.close_delay = info->close_delay; |
@@ -1407,7 +1407,7 @@ static int set_serial_info(struct esp_struct *info, | |||
1407 | 1407 | ||
1408 | if ((new_serial.type != PORT_16550A) || | 1408 | if ((new_serial.type != PORT_16550A) || |
1409 | (new_serial.hub6) || | 1409 | (new_serial.hub6) || |
1410 | (info->port != new_serial.port) || | 1410 | (info->io_port != new_serial.port) || |
1411 | (new_serial.baud_base != BASE_BAUD) || | 1411 | (new_serial.baud_base != BASE_BAUD) || |
1412 | (new_serial.irq > 15) || | 1412 | (new_serial.irq > 15) || |
1413 | (new_serial.irq < 2) || | 1413 | (new_serial.irq < 2) || |
@@ -1425,9 +1425,9 @@ static int set_serial_info(struct esp_struct *info, | |||
1425 | if (change_irq || | 1425 | if (change_irq || |
1426 | (new_serial.close_delay != info->close_delay) || | 1426 | (new_serial.close_delay != info->close_delay) || |
1427 | ((new_serial.flags & ~ASYNC_USR_MASK) != | 1427 | ((new_serial.flags & ~ASYNC_USR_MASK) != |
1428 | (info->flags & ~ASYNC_USR_MASK))) | 1428 | (info->port.flags & ~ASYNC_USR_MASK))) |
1429 | return -EPERM; | 1429 | return -EPERM; |
1430 | info->flags = ((info->flags & ~ASYNC_USR_MASK) | | 1430 | info->port.flags = ((info->port.flags & ~ASYNC_USR_MASK) | |
1431 | (new_serial.flags & ASYNC_USR_MASK)); | 1431 | (new_serial.flags & ASYNC_USR_MASK)); |
1432 | info->custom_divisor = new_serial.custom_divisor; | 1432 | info->custom_divisor = new_serial.custom_divisor; |
1433 | } else { | 1433 | } else { |
@@ -1441,9 +1441,9 @@ static int set_serial_info(struct esp_struct *info, | |||
1441 | if ((current_async->line >= info->line) && | 1441 | if ((current_async->line >= info->line) && |
1442 | (current_async->line < (info->line + 8))) { | 1442 | (current_async->line < (info->line + 8))) { |
1443 | if (current_async == info) { | 1443 | if (current_async == info) { |
1444 | if (current_async->count > 1) | 1444 | if (current_async->port.count > 1) |
1445 | return -EBUSY; | 1445 | return -EBUSY; |
1446 | } else if (current_async->count) | 1446 | } else if (current_async->port.count) |
1447 | return -EBUSY; | 1447 | return -EBUSY; |
1448 | } | 1448 | } |
1449 | 1449 | ||
@@ -1456,7 +1456,7 @@ static int set_serial_info(struct esp_struct *info, | |||
1456 | * At this point, we start making changes..... | 1456 | * At this point, we start making changes..... |
1457 | */ | 1457 | */ |
1458 | 1458 | ||
1459 | info->flags = ((info->flags & ~ASYNC_FLAGS) | | 1459 | info->port.flags = ((info->port.flags & ~ASYNC_FLAGS) | |
1460 | (new_serial.flags & ASYNC_FLAGS)); | 1460 | (new_serial.flags & ASYNC_FLAGS)); |
1461 | info->custom_divisor = new_serial.custom_divisor; | 1461 | info->custom_divisor = new_serial.custom_divisor; |
1462 | info->close_delay = new_serial.close_delay * HZ/100; | 1462 | info->close_delay = new_serial.close_delay * HZ/100; |
@@ -1487,18 +1487,18 @@ static int set_serial_info(struct esp_struct *info, | |||
1487 | } | 1487 | } |
1488 | } | 1488 | } |
1489 | 1489 | ||
1490 | if (info->flags & ASYNC_INITIALIZED) { | 1490 | if (info->port.flags & ASYNC_INITIALIZED) { |
1491 | if (((old_info.flags & ASYNC_SPD_MASK) != | 1491 | if (((old_info.port.flags & ASYNC_SPD_MASK) != |
1492 | (info->flags & ASYNC_SPD_MASK)) || | 1492 | (info->port.flags & ASYNC_SPD_MASK)) || |
1493 | (old_info.custom_divisor != info->custom_divisor)) { | 1493 | (old_info.custom_divisor != info->custom_divisor)) { |
1494 | if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) | 1494 | if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) |
1495 | info->tty->alt_speed = 57600; | 1495 | info->port.tty->alt_speed = 57600; |
1496 | if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) | 1496 | if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) |
1497 | info->tty->alt_speed = 115200; | 1497 | info->port.tty->alt_speed = 115200; |
1498 | if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) | 1498 | if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) |
1499 | info->tty->alt_speed = 230400; | 1499 | info->port.tty->alt_speed = 230400; |
1500 | if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) | 1500 | if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) |
1501 | info->tty->alt_speed = 460800; | 1501 | info->port.tty->alt_speed = 460800; |
1502 | change_speed(info); | 1502 | change_speed(info); |
1503 | } | 1503 | } |
1504 | } else | 1504 | } else |
@@ -1554,9 +1554,9 @@ static int set_esp_config(struct esp_struct *info, | |||
1554 | 1554 | ||
1555 | while (current_async) { | 1555 | while (current_async) { |
1556 | if (current_async == info) { | 1556 | if (current_async == info) { |
1557 | if (current_async->count > 1) | 1557 | if (current_async->port.count > 1) |
1558 | return -EBUSY; | 1558 | return -EBUSY; |
1559 | } else if (current_async->count) | 1559 | } else if (current_async->port.count) |
1560 | return -EBUSY; | 1560 | return -EBUSY; |
1561 | 1561 | ||
1562 | current_async = current_async->next_port; | 1562 | current_async = current_async->next_port; |
@@ -1578,7 +1578,7 @@ static int set_esp_config(struct esp_struct *info, | |||
1578 | spin_unlock_irqrestore(&info->lock, flags); | 1578 | spin_unlock_irqrestore(&info->lock, flags); |
1579 | } else { | 1579 | } else { |
1580 | /* DMA mode to PIO mode only */ | 1580 | /* DMA mode to PIO mode only */ |
1581 | if (info->count > 1) | 1581 | if (info->port.count > 1) |
1582 | return -EBUSY; | 1582 | return -EBUSY; |
1583 | 1583 | ||
1584 | shutdown(info); | 1584 | shutdown(info); |
@@ -1634,7 +1634,7 @@ static int set_esp_config(struct esp_struct *info, | |||
1634 | spin_unlock_irqrestore(&info->lock, flags); | 1634 | spin_unlock_irqrestore(&info->lock, flags); |
1635 | } | 1635 | } |
1636 | 1636 | ||
1637 | if (!(info->flags & ASYNC_INITIALIZED)) | 1637 | if (!(info->port.flags & ASYNC_INITIALIZED)) |
1638 | retval = startup(info); | 1638 | retval = startup(info); |
1639 | 1639 | ||
1640 | return retval; | 1640 | return retval; |
@@ -1917,9 +1917,9 @@ static void rs_close(struct tty_struct *tty, struct file *filp) | |||
1917 | 1917 | ||
1918 | #ifdef SERIAL_DEBUG_OPEN | 1918 | #ifdef SERIAL_DEBUG_OPEN |
1919 | printk(KERN_DEBUG "rs_close ttys%d, count = %d\n", | 1919 | printk(KERN_DEBUG "rs_close ttys%d, count = %d\n", |
1920 | info->line, info->count); | 1920 | info->line, info->port.count); |
1921 | #endif | 1921 | #endif |
1922 | if (tty->count == 1 && info->count != 1) { | 1922 | if (tty->count == 1 && info->port.count != 1) { |
1923 | /* | 1923 | /* |
1924 | * Uh, oh. tty->count is 1, which means that the tty | 1924 | * Uh, oh. tty->count is 1, which means that the tty |
1925 | * structure will be freed. Info->count should always | 1925 | * structure will be freed. Info->count should always |
@@ -1927,19 +1927,19 @@ static void rs_close(struct tty_struct *tty, struct file *filp) | |||
1927 | * one, we've got real problems, since it means the | 1927 | * one, we've got real problems, since it means the |
1928 | * serial port won't be shutdown. | 1928 | * serial port won't be shutdown. |
1929 | */ | 1929 | */ |
1930 | printk(KERN_DEBUG "rs_close: bad serial port count; tty->count is 1, info->count is %d\n", info->count); | 1930 | printk(KERN_DEBUG "rs_close: bad serial port count; tty->count is 1, info->port.count is %d\n", info->port.count); |
1931 | info->count = 1; | 1931 | info->port.count = 1; |
1932 | } | 1932 | } |
1933 | if (--info->count < 0) { | 1933 | if (--info->port.count < 0) { |
1934 | printk(KERN_ERR "rs_close: bad serial port count for ttys%d: %d\n", | 1934 | printk(KERN_ERR "rs_close: bad serial port count for ttys%d: %d\n", |
1935 | info->line, info->count); | 1935 | info->line, info->port.count); |
1936 | info->count = 0; | 1936 | info->port.count = 0; |
1937 | } | 1937 | } |
1938 | if (info->count) { | 1938 | if (info->port.count) { |
1939 | DBG_CNT("before DEC-2"); | 1939 | DBG_CNT("before DEC-2"); |
1940 | goto out; | 1940 | goto out; |
1941 | } | 1941 | } |
1942 | info->flags |= ASYNC_CLOSING; | 1942 | info->port.flags |= ASYNC_CLOSING; |
1943 | 1943 | ||
1944 | spin_unlock_irqrestore(&info->lock, flags); | 1944 | spin_unlock_irqrestore(&info->lock, flags); |
1945 | /* | 1945 | /* |
@@ -1958,7 +1958,7 @@ static void rs_close(struct tty_struct *tty, struct file *filp) | |||
1958 | /* info->IER &= ~UART_IER_RLSI; */ | 1958 | /* info->IER &= ~UART_IER_RLSI; */ |
1959 | info->IER &= ~UART_IER_RDI; | 1959 | info->IER &= ~UART_IER_RDI; |
1960 | info->read_status_mask &= ~UART_LSR_DR; | 1960 | info->read_status_mask &= ~UART_LSR_DR; |
1961 | if (info->flags & ASYNC_INITIALIZED) { | 1961 | if (info->port.flags & ASYNC_INITIALIZED) { |
1962 | 1962 | ||
1963 | spin_lock_irqsave(&info->lock, flags); | 1963 | spin_lock_irqsave(&info->lock, flags); |
1964 | serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); | 1964 | serial_out(info, UART_ESI_CMD1, ESI_SET_SRV_MASK); |
@@ -1981,15 +1981,15 @@ static void rs_close(struct tty_struct *tty, struct file *filp) | |||
1981 | rs_flush_buffer(tty); | 1981 | rs_flush_buffer(tty); |
1982 | tty_ldisc_flush(tty); | 1982 | tty_ldisc_flush(tty); |
1983 | tty->closing = 0; | 1983 | tty->closing = 0; |
1984 | info->tty = NULL; | 1984 | info->port.tty = NULL; |
1985 | 1985 | ||
1986 | if (info->blocked_open) { | 1986 | if (info->port.blocked_open) { |
1987 | if (info->close_delay) | 1987 | if (info->close_delay) |
1988 | msleep_interruptible(jiffies_to_msecs(info->close_delay)); | 1988 | msleep_interruptible(jiffies_to_msecs(info->close_delay)); |
1989 | wake_up_interruptible(&info->open_wait); | 1989 | wake_up_interruptible(&info->port.open_wait); |
1990 | } | 1990 | } |
1991 | info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); | 1991 | info->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); |
1992 | wake_up_interruptible(&info->close_wait); | 1992 | wake_up_interruptible(&info->port.close_wait); |
1993 | return; | 1993 | return; |
1994 | 1994 | ||
1995 | out: | 1995 | out: |
@@ -2047,10 +2047,10 @@ static void esp_hangup(struct tty_struct *tty) | |||
2047 | 2047 | ||
2048 | rs_flush_buffer(tty); | 2048 | rs_flush_buffer(tty); |
2049 | shutdown(info); | 2049 | shutdown(info); |
2050 | info->count = 0; | 2050 | info->port.count = 0; |
2051 | info->flags &= ~ASYNC_NORMAL_ACTIVE; | 2051 | info->port.flags &= ~ASYNC_NORMAL_ACTIVE; |
2052 | info->tty = NULL; | 2052 | info->port.tty = NULL; |
2053 | wake_up_interruptible(&info->open_wait); | 2053 | wake_up_interruptible(&info->port.open_wait); |
2054 | } | 2054 | } |
2055 | 2055 | ||
2056 | /* | 2056 | /* |
@@ -2071,11 +2071,11 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
2071 | * until it's done, and then try again. | 2071 | * until it's done, and then try again. |
2072 | */ | 2072 | */ |
2073 | if (tty_hung_up_p(filp) || | 2073 | if (tty_hung_up_p(filp) || |
2074 | (info->flags & ASYNC_CLOSING)) { | 2074 | (info->port.flags & ASYNC_CLOSING)) { |
2075 | if (info->flags & ASYNC_CLOSING) | 2075 | if (info->port.flags & ASYNC_CLOSING) |
2076 | interruptible_sleep_on(&info->close_wait); | 2076 | interruptible_sleep_on(&info->port.close_wait); |
2077 | #ifdef SERIAL_DO_RESTART | 2077 | #ifdef SERIAL_DO_RESTART |
2078 | if (info->flags & ASYNC_HUP_NOTIFY) | 2078 | if (info->port.flags & ASYNC_HUP_NOTIFY) |
2079 | return -EAGAIN; | 2079 | return -EAGAIN; |
2080 | else | 2080 | else |
2081 | return -ERESTARTSYS; | 2081 | return -ERESTARTSYS; |
@@ -2090,7 +2090,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
2090 | */ | 2090 | */ |
2091 | if ((filp->f_flags & O_NONBLOCK) || | 2091 | if ((filp->f_flags & O_NONBLOCK) || |
2092 | (tty->flags & (1 << TTY_IO_ERROR))) { | 2092 | (tty->flags & (1 << TTY_IO_ERROR))) { |
2093 | info->flags |= ASYNC_NORMAL_ACTIVE; | 2093 | info->port.flags |= ASYNC_NORMAL_ACTIVE; |
2094 | return 0; | 2094 | return 0; |
2095 | } | 2095 | } |
2096 | 2096 | ||
@@ -2100,20 +2100,20 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
2100 | /* | 2100 | /* |
2101 | * Block waiting for the carrier detect and the line to become | 2101 | * Block waiting for the carrier detect and the line to become |
2102 | * free (i.e., not in use by the callout). While we are in | 2102 | * free (i.e., not in use by the callout). While we are in |
2103 | * this loop, info->count is dropped by one, so that | 2103 | * this loop, info->port.count is dropped by one, so that |
2104 | * rs_close() knows when to free things. We restore it upon | 2104 | * rs_close() knows when to free things. We restore it upon |
2105 | * exit, either normal or abnormal. | 2105 | * exit, either normal or abnormal. |
2106 | */ | 2106 | */ |
2107 | retval = 0; | 2107 | retval = 0; |
2108 | add_wait_queue(&info->open_wait, &wait); | 2108 | add_wait_queue(&info->port.open_wait, &wait); |
2109 | #ifdef SERIAL_DEBUG_OPEN | 2109 | #ifdef SERIAL_DEBUG_OPEN |
2110 | printk(KERN_DEBUG "block_til_ready before block: ttys%d, count = %d\n", | 2110 | printk(KERN_DEBUG "block_til_ready before block: ttys%d, count = %d\n", |
2111 | info->line, info->count); | 2111 | info->line, info->port.count); |
2112 | #endif | 2112 | #endif |
2113 | spin_lock_irqsave(&info->lock, flags); | 2113 | spin_lock_irqsave(&info->lock, flags); |
2114 | if (!tty_hung_up_p(filp)) | 2114 | if (!tty_hung_up_p(filp)) |
2115 | info->count--; | 2115 | info->port.count--; |
2116 | info->blocked_open++; | 2116 | info->port.blocked_open++; |
2117 | while (1) { | 2117 | while (1) { |
2118 | if ((tty->termios->c_cflag & CBAUD)) { | 2118 | if ((tty->termios->c_cflag & CBAUD)) { |
2119 | unsigned int scratch; | 2119 | unsigned int scratch; |
@@ -2128,9 +2128,9 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
2128 | } | 2128 | } |
2129 | set_current_state(TASK_INTERRUPTIBLE); | 2129 | set_current_state(TASK_INTERRUPTIBLE); |
2130 | if (tty_hung_up_p(filp) || | 2130 | if (tty_hung_up_p(filp) || |
2131 | !(info->flags & ASYNC_INITIALIZED)) { | 2131 | !(info->port.flags & ASYNC_INITIALIZED)) { |
2132 | #ifdef SERIAL_DO_RESTART | 2132 | #ifdef SERIAL_DO_RESTART |
2133 | if (info->flags & ASYNC_HUP_NOTIFY) | 2133 | if (info->port.flags & ASYNC_HUP_NOTIFY) |
2134 | retval = -EAGAIN; | 2134 | retval = -EAGAIN; |
2135 | else | 2135 | else |
2136 | retval = -ERESTARTSYS; | 2136 | retval = -ERESTARTSYS; |
@@ -2144,7 +2144,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
2144 | if (serial_in(info, UART_ESI_STAT2) & UART_MSR_DCD) | 2144 | if (serial_in(info, UART_ESI_STAT2) & UART_MSR_DCD) |
2145 | do_clocal = 1; | 2145 | do_clocal = 1; |
2146 | 2146 | ||
2147 | if (!(info->flags & ASYNC_CLOSING) && | 2147 | if (!(info->port.flags & ASYNC_CLOSING) && |
2148 | (do_clocal)) | 2148 | (do_clocal)) |
2149 | break; | 2149 | break; |
2150 | if (signal_pending(current)) { | 2150 | if (signal_pending(current)) { |
@@ -2153,25 +2153,25 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
2153 | } | 2153 | } |
2154 | #ifdef SERIAL_DEBUG_OPEN | 2154 | #ifdef SERIAL_DEBUG_OPEN |
2155 | printk(KERN_DEBUG "block_til_ready blocking: ttys%d, count = %d\n", | 2155 | printk(KERN_DEBUG "block_til_ready blocking: ttys%d, count = %d\n", |
2156 | info->line, info->count); | 2156 | info->line, info->port.count); |
2157 | #endif | 2157 | #endif |
2158 | spin_unlock_irqrestore(&info->lock, flags); | 2158 | spin_unlock_irqrestore(&info->lock, flags); |
2159 | schedule(); | 2159 | schedule(); |
2160 | spin_lock_irqsave(&info->lock, flags); | 2160 | spin_lock_irqsave(&info->lock, flags); |
2161 | } | 2161 | } |
2162 | set_current_state(TASK_RUNNING); | 2162 | set_current_state(TASK_RUNNING); |
2163 | remove_wait_queue(&info->open_wait, &wait); | 2163 | remove_wait_queue(&info->port.open_wait, &wait); |
2164 | if (!tty_hung_up_p(filp)) | 2164 | if (!tty_hung_up_p(filp)) |
2165 | info->count++; | 2165 | info->port.count++; |
2166 | info->blocked_open--; | 2166 | info->port.blocked_open--; |
2167 | spin_unlock_irqrestore(&info->lock, flags); | 2167 | spin_unlock_irqrestore(&info->lock, flags); |
2168 | #ifdef SERIAL_DEBUG_OPEN | 2168 | #ifdef SERIAL_DEBUG_OPEN |
2169 | printk(KERN_DEBUG "block_til_ready after blocking: ttys%d, count = %d\n", | 2169 | printk(KERN_DEBUG "block_til_ready after blocking: ttys%d, count = %d\n", |
2170 | info->line, info->count); | 2170 | info->line, info->port.count); |
2171 | #endif | 2171 | #endif |
2172 | if (retval) | 2172 | if (retval) |
2173 | return retval; | 2173 | return retval; |
2174 | info->flags |= ASYNC_NORMAL_ACTIVE; | 2174 | info->port.flags |= ASYNC_NORMAL_ACTIVE; |
2175 | return 0; | 2175 | return 0; |
2176 | } | 2176 | } |
2177 | 2177 | ||
@@ -2204,12 +2204,12 @@ static int esp_open(struct tty_struct *tty, struct file *filp) | |||
2204 | } | 2204 | } |
2205 | 2205 | ||
2206 | #ifdef SERIAL_DEBUG_OPEN | 2206 | #ifdef SERIAL_DEBUG_OPEN |
2207 | printk(KERN_DEBUG "esp_open %s, count = %d\n", tty->name, info->count); | 2207 | printk(KERN_DEBUG "esp_open %s, count = %d\n", tty->name, info->port.count); |
2208 | #endif | 2208 | #endif |
2209 | spin_lock_irqsave(&info->lock, flags); | 2209 | spin_lock_irqsave(&info->lock, flags); |
2210 | info->count++; | 2210 | info->port.count++; |
2211 | tty->driver_data = info; | 2211 | tty->driver_data = info; |
2212 | info->tty = tty; | 2212 | info->port.tty = tty; |
2213 | 2213 | ||
2214 | spin_unlock_irqrestore(&info->lock, flags); | 2214 | spin_unlock_irqrestore(&info->lock, flags); |
2215 | 2215 | ||
@@ -2263,7 +2263,7 @@ static int autoconfig(struct esp_struct *info) | |||
2263 | int port_detected = 0; | 2263 | int port_detected = 0; |
2264 | unsigned long flags; | 2264 | unsigned long flags; |
2265 | 2265 | ||
2266 | if (!request_region(info->port, REGION_SIZE, "esp serial")) | 2266 | if (!request_region(info->io_port, REGION_SIZE, "esp serial")) |
2267 | return -EIO; | 2267 | return -EIO; |
2268 | 2268 | ||
2269 | spin_lock_irqsave(&info->lock, flags); | 2269 | spin_lock_irqsave(&info->lock, flags); |
@@ -2300,7 +2300,7 @@ static int autoconfig(struct esp_struct *info) | |||
2300 | } | 2300 | } |
2301 | } | 2301 | } |
2302 | if (!port_detected) | 2302 | if (!port_detected) |
2303 | release_region(info->port, REGION_SIZE); | 2303 | release_region(info->io_port, REGION_SIZE); |
2304 | 2304 | ||
2305 | spin_unlock_irqrestore(&info->lock, flags); | 2305 | spin_unlock_irqrestore(&info->lock, flags); |
2306 | return (port_detected); | 2306 | return (port_detected); |
@@ -2414,7 +2414,7 @@ static int __init espserial_init(void) | |||
2414 | offset = 0; | 2414 | offset = 0; |
2415 | 2415 | ||
2416 | do { | 2416 | do { |
2417 | info->port = esp[i] + offset; | 2417 | info->io_port = esp[i] + offset; |
2418 | info->irq = irq[i]; | 2418 | info->irq = irq[i]; |
2419 | info->line = (i * 8) + (offset / 8); | 2419 | info->line = (i * 8) + (offset / 8); |
2420 | 2420 | ||
@@ -2425,9 +2425,9 @@ static int __init espserial_init(void) | |||
2425 | } | 2425 | } |
2426 | 2426 | ||
2427 | info->custom_divisor = (divisor[i] >> (offset / 2)) & 0xf; | 2427 | info->custom_divisor = (divisor[i] >> (offset / 2)) & 0xf; |
2428 | info->flags = STD_COM_FLAGS; | 2428 | info->port.flags = STD_COM_FLAGS; |
2429 | if (info->custom_divisor) | 2429 | if (info->custom_divisor) |
2430 | info->flags |= ASYNC_SPD_CUST; | 2430 | info->port.flags |= ASYNC_SPD_CUST; |
2431 | info->magic = ESP_MAGIC; | 2431 | info->magic = ESP_MAGIC; |
2432 | info->close_delay = 5*HZ/10; | 2432 | info->close_delay = 5*HZ/10; |
2433 | info->closing_wait = 30*HZ; | 2433 | info->closing_wait = 30*HZ; |
@@ -2436,13 +2436,13 @@ static int __init espserial_init(void) | |||
2436 | info->config.flow_off = flow_off; | 2436 | info->config.flow_off = flow_off; |
2437 | info->config.pio_threshold = pio_threshold; | 2437 | info->config.pio_threshold = pio_threshold; |
2438 | info->next_port = ports; | 2438 | info->next_port = ports; |
2439 | init_waitqueue_head(&info->open_wait); | 2439 | init_waitqueue_head(&info->port.open_wait); |
2440 | init_waitqueue_head(&info->close_wait); | 2440 | init_waitqueue_head(&info->port.close_wait); |
2441 | init_waitqueue_head(&info->delta_msr_wait); | 2441 | init_waitqueue_head(&info->delta_msr_wait); |
2442 | init_waitqueue_head(&info->break_wait); | 2442 | init_waitqueue_head(&info->break_wait); |
2443 | ports = info; | 2443 | ports = info; |
2444 | printk(KERN_INFO "ttyP%d at 0x%04x (irq = %d) is an ESP ", | 2444 | printk(KERN_INFO "ttyP%d at 0x%04x (irq = %d) is an ESP ", |
2445 | info->line, info->port, info->irq); | 2445 | info->line, info->io_port, info->irq); |
2446 | 2446 | ||
2447 | if (info->line % 8) { | 2447 | if (info->line % 8) { |
2448 | printk("secondary port\n"); | 2448 | printk("secondary port\n"); |
@@ -2498,8 +2498,8 @@ static void __exit espserial_exit(void) | |||
2498 | put_tty_driver(esp_driver); | 2498 | put_tty_driver(esp_driver); |
2499 | 2499 | ||
2500 | while (ports) { | 2500 | while (ports) { |
2501 | if (ports->port) | 2501 | if (ports->io_port) |
2502 | release_region(ports->port, REGION_SIZE); | 2502 | release_region(ports->io_port, REGION_SIZE); |
2503 | temp_async = ports->next_port; | 2503 | temp_async = ports->next_port; |
2504 | kfree(ports); | 2504 | kfree(ports); |
2505 | ports = temp_async; | 2505 | ports = temp_async; |