diff options
Diffstat (limited to 'drivers/tty/serial/crisv10.c')
| -rw-r--r-- | drivers/tty/serial/crisv10.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c index 80b6b1b1f725..35ee6a2c6877 100644 --- a/drivers/tty/serial/crisv10.c +++ b/drivers/tty/serial/crisv10.c | |||
| @@ -955,7 +955,7 @@ static const struct control_pins e100_modem_pins[NR_PORTS] = | |||
| 955 | /* Calculate the chartime depending on baudrate, numbor of bits etc. */ | 955 | /* Calculate the chartime depending on baudrate, numbor of bits etc. */ |
| 956 | static void update_char_time(struct e100_serial * info) | 956 | static void update_char_time(struct e100_serial * info) |
| 957 | { | 957 | { |
| 958 | tcflag_t cflags = info->port.tty->termios->c_cflag; | 958 | tcflag_t cflags = info->port.tty->termios.c_cflag; |
| 959 | int bits; | 959 | int bits; |
| 960 | 960 | ||
| 961 | /* calc. number of bits / data byte */ | 961 | /* calc. number of bits / data byte */ |
| @@ -1473,7 +1473,7 @@ rs_stop(struct tty_struct *tty) | |||
| 1473 | xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, | 1473 | xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, |
| 1474 | STOP_CHAR(info->port.tty)); | 1474 | STOP_CHAR(info->port.tty)); |
| 1475 | xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, stop); | 1475 | xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, stop); |
| 1476 | if (tty->termios->c_iflag & IXON ) { | 1476 | if (tty->termios.c_iflag & IXON ) { |
| 1477 | xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); | 1477 | xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); |
| 1478 | } | 1478 | } |
| 1479 | 1479 | ||
| @@ -1496,7 +1496,7 @@ rs_start(struct tty_struct *tty) | |||
| 1496 | info->xmit.tail,SERIAL_XMIT_SIZE))); | 1496 | info->xmit.tail,SERIAL_XMIT_SIZE))); |
| 1497 | xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(tty)); | 1497 | xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(tty)); |
| 1498 | xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable); | 1498 | xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable); |
| 1499 | if (tty->termios->c_iflag & IXON ) { | 1499 | if (tty->termios.c_iflag & IXON ) { |
| 1500 | xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); | 1500 | xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); |
| 1501 | } | 1501 | } |
| 1502 | 1502 | ||
| @@ -2929,7 +2929,7 @@ shutdown(struct e100_serial * info) | |||
| 2929 | descr[i].buf = 0; | 2929 | descr[i].buf = 0; |
| 2930 | } | 2930 | } |
| 2931 | 2931 | ||
| 2932 | if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL)) { | 2932 | if (!info->port.tty || (info->port.tty->termios.c_cflag & HUPCL)) { |
| 2933 | /* hang up DTR and RTS if HUPCL is enabled */ | 2933 | /* hang up DTR and RTS if HUPCL is enabled */ |
| 2934 | e100_dtr(info, 0); | 2934 | e100_dtr(info, 0); |
| 2935 | e100_rts(info, 0); /* could check CRTSCTS before doing this */ | 2935 | e100_rts(info, 0); /* could check CRTSCTS before doing this */ |
| @@ -2953,12 +2953,12 @@ change_speed(struct e100_serial *info) | |||
| 2953 | unsigned long flags; | 2953 | unsigned long flags; |
| 2954 | /* first some safety checks */ | 2954 | /* first some safety checks */ |
| 2955 | 2955 | ||
| 2956 | if (!info->port.tty || !info->port.tty->termios) | 2956 | if (!info->port.tty) |
| 2957 | return; | 2957 | return; |
| 2958 | if (!info->ioport) | 2958 | if (!info->ioport) |
| 2959 | return; | 2959 | return; |
| 2960 | 2960 | ||
| 2961 | cflag = info->port.tty->termios->c_cflag; | 2961 | cflag = info->port.tty->termios.c_cflag; |
| 2962 | 2962 | ||
| 2963 | /* possibly, the tx/rx should be disabled first to do this safely */ | 2963 | /* possibly, the tx/rx should be disabled first to do this safely */ |
| 2964 | 2964 | ||
| @@ -3088,7 +3088,7 @@ change_speed(struct e100_serial *info) | |||
| 3088 | info->ioport[REG_REC_CTRL] = info->rx_ctrl; | 3088 | info->ioport[REG_REC_CTRL] = info->rx_ctrl; |
| 3089 | xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty)); | 3089 | xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty)); |
| 3090 | xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable); | 3090 | xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable); |
| 3091 | if (info->port.tty->termios->c_iflag & IXON ) { | 3091 | if (info->port.tty->termios.c_iflag & IXON ) { |
| 3092 | DFLOW(DEBUG_LOG(info->line, "FLOW XOFF enabled 0x%02X\n", | 3092 | DFLOW(DEBUG_LOG(info->line, "FLOW XOFF enabled 0x%02X\n", |
| 3093 | STOP_CHAR(info->port.tty))); | 3093 | STOP_CHAR(info->port.tty))); |
| 3094 | xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); | 3094 | xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); |
| @@ -3355,7 +3355,7 @@ rs_throttle(struct tty_struct * tty) | |||
| 3355 | DFLOW(DEBUG_LOG(info->line,"rs_throttle %lu\n", tty->ldisc.chars_in_buffer(tty))); | 3355 | DFLOW(DEBUG_LOG(info->line,"rs_throttle %lu\n", tty->ldisc.chars_in_buffer(tty))); |
| 3356 | 3356 | ||
| 3357 | /* Do RTS before XOFF since XOFF might take some time */ | 3357 | /* Do RTS before XOFF since XOFF might take some time */ |
| 3358 | if (tty->termios->c_cflag & CRTSCTS) { | 3358 | if (tty->termios.c_cflag & CRTSCTS) { |
| 3359 | /* Turn off RTS line */ | 3359 | /* Turn off RTS line */ |
| 3360 | e100_rts(info, 0); | 3360 | e100_rts(info, 0); |
| 3361 | } | 3361 | } |
| @@ -3377,7 +3377,7 @@ rs_unthrottle(struct tty_struct * tty) | |||
| 3377 | DFLOW(DEBUG_LOG(info->line,"rs_unthrottle ldisc %d\n", tty->ldisc.chars_in_buffer(tty))); | 3377 | DFLOW(DEBUG_LOG(info->line,"rs_unthrottle ldisc %d\n", tty->ldisc.chars_in_buffer(tty))); |
| 3378 | DFLOW(DEBUG_LOG(info->line,"rs_unthrottle flip.count: %i\n", tty->flip.count)); | 3378 | DFLOW(DEBUG_LOG(info->line,"rs_unthrottle flip.count: %i\n", tty->flip.count)); |
| 3379 | /* Do RTS before XOFF since XOFF might take some time */ | 3379 | /* Do RTS before XOFF since XOFF might take some time */ |
| 3380 | if (tty->termios->c_cflag & CRTSCTS) { | 3380 | if (tty->termios.c_cflag & CRTSCTS) { |
| 3381 | /* Assert RTS line */ | 3381 | /* Assert RTS line */ |
| 3382 | e100_rts(info, 1); | 3382 | e100_rts(info, 1); |
| 3383 | } | 3383 | } |
| @@ -3748,7 +3748,7 @@ rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) | |||
| 3748 | 3748 | ||
| 3749 | /* Handle turning off CRTSCTS */ | 3749 | /* Handle turning off CRTSCTS */ |
| 3750 | if ((old_termios->c_cflag & CRTSCTS) && | 3750 | if ((old_termios->c_cflag & CRTSCTS) && |
| 3751 | !(tty->termios->c_cflag & CRTSCTS)) { | 3751 | !(tty->termios.c_cflag & CRTSCTS)) { |
| 3752 | tty->hw_stopped = 0; | 3752 | tty->hw_stopped = 0; |
| 3753 | rs_start(tty); | 3753 | rs_start(tty); |
| 3754 | } | 3754 | } |
| @@ -3815,7 +3815,7 @@ rs_close(struct tty_struct *tty, struct file * filp) | |||
| 3815 | * separate termios for callout and dialin. | 3815 | * separate termios for callout and dialin. |
| 3816 | */ | 3816 | */ |
| 3817 | if (info->flags & ASYNC_NORMAL_ACTIVE) | 3817 | if (info->flags & ASYNC_NORMAL_ACTIVE) |
| 3818 | info->normal_termios = *tty->termios; | 3818 | info->normal_termios = tty->termios; |
| 3819 | /* | 3819 | /* |
| 3820 | * Now we wait for the transmit buffer to clear; and we notify | 3820 | * Now we wait for the transmit buffer to clear; and we notify |
| 3821 | * the line discipline to only process XON/XOFF characters. | 3821 | * the line discipline to only process XON/XOFF characters. |
| @@ -3976,7 +3976,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp, | |||
| 3976 | */ | 3976 | */ |
| 3977 | if (tty_hung_up_p(filp) || | 3977 | if (tty_hung_up_p(filp) || |
| 3978 | (info->flags & ASYNC_CLOSING)) { | 3978 | (info->flags & ASYNC_CLOSING)) { |
| 3979 | wait_event_interruptible_tty(info->close_wait, | 3979 | wait_event_interruptible_tty(tty, info->close_wait, |
| 3980 | !(info->flags & ASYNC_CLOSING)); | 3980 | !(info->flags & ASYNC_CLOSING)); |
| 3981 | #ifdef SERIAL_DO_RESTART | 3981 | #ifdef SERIAL_DO_RESTART |
| 3982 | if (info->flags & ASYNC_HUP_NOTIFY) | 3982 | if (info->flags & ASYNC_HUP_NOTIFY) |
| @@ -3998,7 +3998,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp, | |||
| 3998 | return 0; | 3998 | return 0; |
| 3999 | } | 3999 | } |
| 4000 | 4000 | ||
| 4001 | if (tty->termios->c_cflag & CLOCAL) { | 4001 | if (tty->termios.c_cflag & CLOCAL) { |
| 4002 | do_clocal = 1; | 4002 | do_clocal = 1; |
| 4003 | } | 4003 | } |
| 4004 | 4004 | ||
| @@ -4052,9 +4052,9 @@ block_til_ready(struct tty_struct *tty, struct file * filp, | |||
| 4052 | printk("block_til_ready blocking: ttyS%d, count = %d\n", | 4052 | printk("block_til_ready blocking: ttyS%d, count = %d\n", |
| 4053 | info->line, info->count); | 4053 | info->line, info->count); |
| 4054 | #endif | 4054 | #endif |
| 4055 | tty_unlock(); | 4055 | tty_unlock(tty); |
| 4056 | schedule(); | 4056 | schedule(); |
| 4057 | tty_lock(); | 4057 | tty_lock(tty); |
| 4058 | } | 4058 | } |
| 4059 | set_current_state(TASK_RUNNING); | 4059 | set_current_state(TASK_RUNNING); |
| 4060 | remove_wait_queue(&info->open_wait, &wait); | 4060 | remove_wait_queue(&info->open_wait, &wait); |
| @@ -4115,7 +4115,7 @@ rs_open(struct tty_struct *tty, struct file * filp) | |||
| 4115 | */ | 4115 | */ |
| 4116 | if (tty_hung_up_p(filp) || | 4116 | if (tty_hung_up_p(filp) || |
| 4117 | (info->flags & ASYNC_CLOSING)) { | 4117 | (info->flags & ASYNC_CLOSING)) { |
| 4118 | wait_event_interruptible_tty(info->close_wait, | 4118 | wait_event_interruptible_tty(tty, info->close_wait, |
| 4119 | !(info->flags & ASYNC_CLOSING)); | 4119 | !(info->flags & ASYNC_CLOSING)); |
| 4120 | #ifdef SERIAL_DO_RESTART | 4120 | #ifdef SERIAL_DO_RESTART |
| 4121 | return ((info->flags & ASYNC_HUP_NOTIFY) ? | 4121 | return ((info->flags & ASYNC_HUP_NOTIFY) ? |
| @@ -4219,7 +4219,7 @@ rs_open(struct tty_struct *tty, struct file * filp) | |||
| 4219 | } | 4219 | } |
| 4220 | 4220 | ||
| 4221 | if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { | 4221 | if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { |
| 4222 | *tty->termios = info->normal_termios; | 4222 | tty->termios = info->normal_termios; |
| 4223 | change_speed(info); | 4223 | change_speed(info); |
| 4224 | } | 4224 | } |
| 4225 | 4225 | ||
| @@ -4443,14 +4443,12 @@ static int __init rs_init(void) | |||
| 4443 | B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */ | 4443 | B115200 | CS8 | CREAD | HUPCL | CLOCAL; /* is normally B9600 default... */ |
| 4444 | driver->init_termios.c_ispeed = 115200; | 4444 | driver->init_termios.c_ispeed = 115200; |
| 4445 | driver->init_termios.c_ospeed = 115200; | 4445 | driver->init_termios.c_ospeed = 115200; |
| 4446 | driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; | 4446 | driver->flags = TTY_DRIVER_REAL_RAW; |
| 4447 | 4447 | ||
| 4448 | tty_set_operations(driver, &rs_ops); | 4448 | tty_set_operations(driver, &rs_ops); |
| 4449 | serial_driver = driver; | 4449 | serial_driver = driver; |
| 4450 | if (tty_register_driver(driver)) | ||
| 4451 | panic("Couldn't register serial driver\n"); | ||
| 4452 | /* do some initializing for the separate ports */ | ||
| 4453 | 4450 | ||
| 4451 | /* do some initializing for the separate ports */ | ||
| 4454 | for (i = 0, info = rs_table; i < NR_PORTS; i++,info++) { | 4452 | for (i = 0, info = rs_table; i < NR_PORTS; i++,info++) { |
| 4455 | if (info->enabled) { | 4453 | if (info->enabled) { |
| 4456 | if (cris_request_io_interface(info->io_if, | 4454 | if (cris_request_io_interface(info->io_if, |
| @@ -4502,7 +4500,12 @@ static int __init rs_init(void) | |||
| 4502 | printk(KERN_INFO "%s%d at %p is a builtin UART with DMA\n", | 4500 | printk(KERN_INFO "%s%d at %p is a builtin UART with DMA\n", |
| 4503 | serial_driver->name, info->line, info->ioport); | 4501 | serial_driver->name, info->line, info->ioport); |
| 4504 | } | 4502 | } |
| 4503 | tty_port_link_device(&info->port, driver, i); | ||
| 4505 | } | 4504 | } |
| 4505 | |||
| 4506 | if (tty_register_driver(driver)) | ||
| 4507 | panic("Couldn't register serial driver\n"); | ||
| 4508 | |||
| 4506 | #ifdef CONFIG_ETRAX_FAST_TIMER | 4509 | #ifdef CONFIG_ETRAX_FAST_TIMER |
| 4507 | #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER | 4510 | #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER |
| 4508 | memset(fast_timers, 0, sizeof(fast_timers)); | 4511 | memset(fast_timers, 0, sizeof(fast_timers)); |
