aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/crisv10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/crisv10.c')
-rw-r--r--drivers/serial/crisv10.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index 31f172397af3..c856905bb3bd 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -3724,6 +3724,17 @@ rs_ioctl(struct tty_struct *tty, struct file * file,
3724 return e100_enable_rs485(tty, &rs485data); 3724 return e100_enable_rs485(tty, &rs485data);
3725 } 3725 }
3726 3726
3727 case TIOCGRS485:
3728 {
3729 struct serial_rs485 *rs485data =
3730 &(((struct e100_serial *)tty->driver_data)->rs485);
3731 /* This is the ioctl to get RS485 data from user-space */
3732 if (copy_to_user((struct serial_rs485 *) arg,
3733 rs485data,
3734 sizeof(serial_rs485)))
3735 return -EFAULT;
3736 break;
3737 }
3727 3738
3728 case TIOCSERWRRS485: 3739 case TIOCSERWRRS485:
3729 { 3740 {
@@ -3924,7 +3935,6 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
3924 * Check R_DMA_CHx_STATUS bit 0-6=number of available bytes in FIFO 3935 * Check R_DMA_CHx_STATUS bit 0-6=number of available bytes in FIFO
3925 * R_DMA_CHx_HWSW bit 31-16=nbr of bytes left in DMA buffer (0=64k) 3936 * R_DMA_CHx_HWSW bit 31-16=nbr of bytes left in DMA buffer (0=64k)
3926 */ 3937 */
3927 lock_kernel();
3928 orig_jiffies = jiffies; 3938 orig_jiffies = jiffies;
3929 while (info->xmit.head != info->xmit.tail || /* More in send queue */ 3939 while (info->xmit.head != info->xmit.tail || /* More in send queue */
3930 (*info->ostatusadr & 0x007f) || /* more in FIFO */ 3940 (*info->ostatusadr & 0x007f) || /* more in FIFO */
@@ -3941,7 +3951,6 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
3941 curr_time_usec - info->last_tx_active_usec; 3951 curr_time_usec - info->last_tx_active_usec;
3942 } 3952 }
3943 set_current_state(TASK_RUNNING); 3953 set_current_state(TASK_RUNNING);
3944 unlock_kernel();
3945} 3954}
3946 3955
3947/* 3956/*
@@ -3981,7 +3990,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
3981 */ 3990 */
3982 if (tty_hung_up_p(filp) || 3991 if (tty_hung_up_p(filp) ||
3983 (info->flags & ASYNC_CLOSING)) { 3992 (info->flags & ASYNC_CLOSING)) {
3984 wait_event_interruptible(info->close_wait, 3993 wait_event_interruptible_tty(info->close_wait,
3985 !(info->flags & ASYNC_CLOSING)); 3994 !(info->flags & ASYNC_CLOSING));
3986#ifdef SERIAL_DO_RESTART 3995#ifdef SERIAL_DO_RESTART
3987 if (info->flags & ASYNC_HUP_NOTIFY) 3996 if (info->flags & ASYNC_HUP_NOTIFY)
@@ -4057,7 +4066,9 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
4057 printk("block_til_ready blocking: ttyS%d, count = %d\n", 4066 printk("block_til_ready blocking: ttyS%d, count = %d\n",
4058 info->line, info->count); 4067 info->line, info->count);
4059#endif 4068#endif
4069 tty_unlock();
4060 schedule(); 4070 schedule();
4071 tty_lock();
4061 } 4072 }
4062 set_current_state(TASK_RUNNING); 4073 set_current_state(TASK_RUNNING);
4063 remove_wait_queue(&info->open_wait, &wait); 4074 remove_wait_queue(&info->open_wait, &wait);
@@ -4139,7 +4150,7 @@ rs_open(struct tty_struct *tty, struct file * filp)
4139 */ 4150 */
4140 if (tty_hung_up_p(filp) || 4151 if (tty_hung_up_p(filp) ||
4141 (info->flags & ASYNC_CLOSING)) { 4152 (info->flags & ASYNC_CLOSING)) {
4142 wait_event_interruptible(info->close_wait, 4153 wait_event_interruptible_tty(info->close_wait,
4143 !(info->flags & ASYNC_CLOSING)); 4154 !(info->flags & ASYNC_CLOSING));
4144#ifdef SERIAL_DO_RESTART 4155#ifdef SERIAL_DO_RESTART
4145 return ((info->flags & ASYNC_HUP_NOTIFY) ? 4156 return ((info->flags & ASYNC_HUP_NOTIFY) ?
@@ -4522,8 +4533,8 @@ static int __init rs_init(void)
4522 INIT_WORK(&info->work, do_softint); 4533 INIT_WORK(&info->work, do_softint);
4523 4534
4524 if (info->enabled) { 4535 if (info->enabled) {
4525 printk(KERN_INFO "%s%d at 0x%x is a builtin UART with DMA\n", 4536 printk(KERN_INFO "%s%d at %p is a builtin UART with DMA\n",
4526 serial_driver->name, info->line, (unsigned int)info->ioport); 4537 serial_driver->name, info->line, info->ioport);
4527 } 4538 }
4528 } 4539 }
4529#ifdef CONFIG_ETRAX_FAST_TIMER 4540#ifdef CONFIG_ETRAX_FAST_TIMER