diff options
Diffstat (limited to 'drivers/char/vme_scc.c')
| -rw-r--r-- | drivers/char/vme_scc.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c index 69c5afe97f19..1718b3c481db 100644 --- a/drivers/char/vme_scc.c +++ b/drivers/char/vme_scc.c | |||
| @@ -183,8 +183,8 @@ static void scc_init_portstructs(void) | |||
| 183 | #ifdef NEW_WRITE_LOCKING | 183 | #ifdef NEW_WRITE_LOCKING |
| 184 | port->gs.port_write_mutex = MUTEX; | 184 | port->gs.port_write_mutex = MUTEX; |
| 185 | #endif | 185 | #endif |
| 186 | init_waitqueue_head(&port->gs.open_wait); | 186 | init_waitqueue_head(&port->gs.port.open_wait); |
| 187 | init_waitqueue_head(&port->gs.close_wait); | 187 | init_waitqueue_head(&port->gs.port.close_wait); |
| 188 | } | 188 | } |
| 189 | } | 189 | } |
| 190 | 190 | ||
| @@ -422,7 +422,7 @@ static irqreturn_t scc_rx_int(int irq, void *data) | |||
| 422 | { | 422 | { |
| 423 | unsigned char ch; | 423 | unsigned char ch; |
| 424 | struct scc_port *port = data; | 424 | struct scc_port *port = data; |
| 425 | struct tty_struct *tty = port->gs.tty; | 425 | struct tty_struct *tty = port->gs.port.tty; |
| 426 | SCC_ACCESS_INIT(port); | 426 | SCC_ACCESS_INIT(port); |
| 427 | 427 | ||
| 428 | ch = SCCread_NB(RX_DATA_REG); | 428 | ch = SCCread_NB(RX_DATA_REG); |
| @@ -453,7 +453,7 @@ static irqreturn_t scc_rx_int(int irq, void *data) | |||
| 453 | static irqreturn_t scc_spcond_int(int irq, void *data) | 453 | static irqreturn_t scc_spcond_int(int irq, void *data) |
| 454 | { | 454 | { |
| 455 | struct scc_port *port = data; | 455 | struct scc_port *port = data; |
| 456 | struct tty_struct *tty = port->gs.tty; | 456 | struct tty_struct *tty = port->gs.port.tty; |
| 457 | unsigned char stat, ch, err; | 457 | unsigned char stat, ch, err; |
| 458 | int int_pending_mask = port->channel == CHANNEL_A ? | 458 | int int_pending_mask = port->channel == CHANNEL_A ? |
| 459 | IPR_A_RX : IPR_B_RX; | 459 | IPR_A_RX : IPR_B_RX; |
| @@ -500,7 +500,7 @@ static irqreturn_t scc_tx_int(int irq, void *data) | |||
| 500 | struct scc_port *port = data; | 500 | struct scc_port *port = data; |
| 501 | SCC_ACCESS_INIT(port); | 501 | SCC_ACCESS_INIT(port); |
| 502 | 502 | ||
| 503 | if (!port->gs.tty) { | 503 | if (!port->gs.port.tty) { |
| 504 | printk(KERN_WARNING "scc_tx_int with NULL tty!\n"); | 504 | printk(KERN_WARNING "scc_tx_int with NULL tty!\n"); |
| 505 | SCCmod (INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0); | 505 | SCCmod (INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0); |
| 506 | SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET); | 506 | SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET); |
| @@ -512,8 +512,9 @@ static irqreturn_t scc_tx_int(int irq, void *data) | |||
| 512 | SCCwrite(TX_DATA_REG, port->x_char); | 512 | SCCwrite(TX_DATA_REG, port->x_char); |
| 513 | port->x_char = 0; | 513 | port->x_char = 0; |
| 514 | } | 514 | } |
| 515 | else if ((port->gs.xmit_cnt <= 0) || port->gs.tty->stopped || | 515 | else if ((port->gs.xmit_cnt <= 0) || |
| 516 | port->gs.tty->hw_stopped) | 516 | port->gs.port.tty->stopped || |
| 517 | port->gs.port.tty->hw_stopped) | ||
| 517 | break; | 518 | break; |
| 518 | else { | 519 | else { |
| 519 | SCCwrite(TX_DATA_REG, port->gs.xmit_buf[port->gs.xmit_tail++]); | 520 | SCCwrite(TX_DATA_REG, port->gs.xmit_buf[port->gs.xmit_tail++]); |
| @@ -522,15 +523,15 @@ static irqreturn_t scc_tx_int(int irq, void *data) | |||
| 522 | break; | 523 | break; |
| 523 | } | 524 | } |
| 524 | } | 525 | } |
| 525 | if ((port->gs.xmit_cnt <= 0) || port->gs.tty->stopped || | 526 | if ((port->gs.xmit_cnt <= 0) || port->gs.port.tty->stopped || |
| 526 | port->gs.tty->hw_stopped) { | 527 | port->gs.port.tty->hw_stopped) { |
| 527 | /* disable tx interrupts */ | 528 | /* disable tx interrupts */ |
| 528 | SCCmod (INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0); | 529 | SCCmod (INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0); |
| 529 | SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET); /* disable tx_int on next tx underrun? */ | 530 | SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET); /* disable tx_int on next tx underrun? */ |
| 530 | port->gs.flags &= ~GS_TX_INTEN; | 531 | port->gs.port.flags &= ~GS_TX_INTEN; |
| 531 | } | 532 | } |
| 532 | if (port->gs.tty && port->gs.xmit_cnt <= port->gs.wakeup_chars) | 533 | if (port->gs.port.tty && port->gs.xmit_cnt <= port->gs.wakeup_chars) |
| 533 | tty_wakeup(port->gs.tty); | 534 | tty_wakeup(port->gs.port.tty); |
| 534 | 535 | ||
| 535 | SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET); | 536 | SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET); |
| 536 | return IRQ_HANDLED; | 537 | return IRQ_HANDLED; |
| @@ -550,14 +551,14 @@ static irqreturn_t scc_stat_int(int irq, void *data) | |||
| 550 | 551 | ||
| 551 | if (changed & SR_DCD) { | 552 | if (changed & SR_DCD) { |
| 552 | port->c_dcd = !!(sr & SR_DCD); | 553 | port->c_dcd = !!(sr & SR_DCD); |
| 553 | if (!(port->gs.flags & ASYNC_CHECK_CD)) | 554 | if (!(port->gs.port.flags & ASYNC_CHECK_CD)) |
| 554 | ; /* Don't report DCD changes */ | 555 | ; /* Don't report DCD changes */ |
| 555 | else if (port->c_dcd) { | 556 | else if (port->c_dcd) { |
| 556 | wake_up_interruptible(&port->gs.open_wait); | 557 | wake_up_interruptible(&port->gs.port.open_wait); |
| 557 | } | 558 | } |
| 558 | else { | 559 | else { |
| 559 | if (port->gs.tty) | 560 | if (port->gs.port.tty) |
| 560 | tty_hangup (port->gs.tty); | 561 | tty_hangup (port->gs.port.tty); |
| 561 | } | 562 | } |
| 562 | } | 563 | } |
| 563 | SCCwrite(COMMAND_REG, CR_EXTSTAT_RESET); | 564 | SCCwrite(COMMAND_REG, CR_EXTSTAT_RESET); |
| @@ -578,7 +579,7 @@ static void scc_disable_tx_interrupts(void *ptr) | |||
| 578 | 579 | ||
| 579 | local_irq_save(flags); | 580 | local_irq_save(flags); |
| 580 | SCCmod(INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0); | 581 | SCCmod(INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0); |
| 581 | port->gs.flags &= ~GS_TX_INTEN; | 582 | port->gs.port.flags &= ~GS_TX_INTEN; |
| 582 | local_irq_restore(flags); | 583 | local_irq_restore(flags); |
| 583 | } | 584 | } |
| 584 | 585 | ||
| @@ -636,8 +637,8 @@ static void scc_shutdown_port(void *ptr) | |||
| 636 | { | 637 | { |
| 637 | struct scc_port *port = ptr; | 638 | struct scc_port *port = ptr; |
| 638 | 639 | ||
| 639 | port->gs.flags &= ~ GS_ACTIVE; | 640 | port->gs.port.flags &= ~ GS_ACTIVE; |
| 640 | if (port->gs.tty && port->gs.tty->termios->c_cflag & HUPCL) { | 641 | if (port->gs.port.tty && port->gs.port.tty->termios->c_cflag & HUPCL) { |
| 641 | scc_setsignals (port, 0, 0); | 642 | scc_setsignals (port, 0, 0); |
| 642 | } | 643 | } |
| 643 | } | 644 | } |
| @@ -652,14 +653,14 @@ static int scc_set_real_termios (void *ptr) | |||
| 652 | struct scc_port *port = ptr; | 653 | struct scc_port *port = ptr; |
| 653 | SCC_ACCESS_INIT(port); | 654 | SCC_ACCESS_INIT(port); |
| 654 | 655 | ||
| 655 | if (!port->gs.tty || !port->gs.tty->termios) return 0; | 656 | if (!port->gs.port.tty || !port->gs.port.tty->termios) return 0; |
| 656 | 657 | ||
| 657 | channel = port->channel; | 658 | channel = port->channel; |
| 658 | 659 | ||
| 659 | if (channel == CHANNEL_A) | 660 | if (channel == CHANNEL_A) |
| 660 | return 0; /* Settings controlled by boot PROM */ | 661 | return 0; /* Settings controlled by boot PROM */ |
| 661 | 662 | ||
| 662 | cflag = port->gs.tty->termios->c_cflag; | 663 | cflag = port->gs.port.tty->termios->c_cflag; |
| 663 | baud = port->gs.baud; | 664 | baud = port->gs.baud; |
| 664 | chsize = (cflag & CSIZE) >> 4; | 665 | chsize = (cflag & CSIZE) >> 4; |
| 665 | 666 | ||
| @@ -678,9 +679,9 @@ static int scc_set_real_termios (void *ptr) | |||
| 678 | } | 679 | } |
| 679 | 680 | ||
| 680 | if (cflag & CLOCAL) | 681 | if (cflag & CLOCAL) |
| 681 | port->gs.flags &= ~ASYNC_CHECK_CD; | 682 | port->gs.port.flags &= ~ASYNC_CHECK_CD; |
| 682 | else | 683 | else |
| 683 | port->gs.flags |= ASYNC_CHECK_CD; | 684 | port->gs.port.flags |= ASYNC_CHECK_CD; |
| 684 | 685 | ||
| 685 | #ifdef CONFIG_MVME147_SCC | 686 | #ifdef CONFIG_MVME147_SCC |
| 686 | if (MACH_IS_MVME147) | 687 | if (MACH_IS_MVME147) |
| @@ -856,7 +857,7 @@ static int scc_open (struct tty_struct * tty, struct file * filp) | |||
| 856 | { COMMAND_REG, CR_EXTSTAT_RESET }, | 857 | { COMMAND_REG, CR_EXTSTAT_RESET }, |
| 857 | }; | 858 | }; |
| 858 | #endif | 859 | #endif |
| 859 | if (!(port->gs.flags & ASYNC_INITIALIZED)) { | 860 | if (!(port->gs.port.flags & ASYNC_INITIALIZED)) { |
| 860 | local_irq_save(flags); | 861 | local_irq_save(flags); |
| 861 | #if defined(CONFIG_MVME147_SCC) || defined(CONFIG_MVME162_SCC) | 862 | #if defined(CONFIG_MVME147_SCC) || defined(CONFIG_MVME162_SCC) |
| 862 | if (MACH_IS_MVME147 || MACH_IS_MVME16x) { | 863 | if (MACH_IS_MVME147 || MACH_IS_MVME16x) { |
| @@ -880,18 +881,18 @@ static int scc_open (struct tty_struct * tty, struct file * filp) | |||
| 880 | } | 881 | } |
| 881 | 882 | ||
| 882 | tty->driver_data = port; | 883 | tty->driver_data = port; |
| 883 | port->gs.tty = tty; | 884 | port->gs.port.tty = tty; |
| 884 | port->gs.count++; | 885 | port->gs.port.count++; |
| 885 | retval = gs_init_port(&port->gs); | 886 | retval = gs_init_port(&port->gs); |
| 886 | if (retval) { | 887 | if (retval) { |
| 887 | port->gs.count--; | 888 | port->gs.port.count--; |
| 888 | return retval; | 889 | return retval; |
| 889 | } | 890 | } |
| 890 | port->gs.flags |= GS_ACTIVE; | 891 | port->gs.port.flags |= GS_ACTIVE; |
| 891 | retval = gs_block_til_ready(port, filp); | 892 | retval = gs_block_til_ready(port, filp); |
| 892 | 893 | ||
| 893 | if (retval) { | 894 | if (retval) { |
| 894 | port->gs.count--; | 895 | port->gs.port.count--; |
| 895 | return retval; | 896 | return retval; |
| 896 | } | 897 | } |
| 897 | 898 | ||
