diff options
author | Alan Cox <alan@redhat.com> | 2008-07-16 16:57:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:12:38 -0400 |
commit | 44b7d1b37f786c61d0e382b6f72f605f73de284b (patch) | |
tree | 2ac150e99311cde2e841bb6c80ac9d2800c8aff7 /drivers/char/cyclades.c | |
parent | 593573bc55c9e1999b9679da4e477c0220a6fbbd (diff) |
tty: add more tty_port fields
Move more bits into the tty_port structure
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/cyclades.c')
-rw-r--r-- | drivers/char/cyclades.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 0144b19d1036..e991dc85f2fb 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c | |||
@@ -2677,8 +2677,8 @@ static void cy_close(struct tty_struct *tty, struct file *filp) | |||
2677 | */ | 2677 | */ |
2678 | tty->closing = 1; | 2678 | tty->closing = 1; |
2679 | spin_unlock_irqrestore(&card->card_lock, flags); | 2679 | spin_unlock_irqrestore(&card->card_lock, flags); |
2680 | if (info->closing_wait != CY_CLOSING_WAIT_NONE) | 2680 | if (info->port.closing_wait != CY_CLOSING_WAIT_NONE) |
2681 | tty_wait_until_sent(tty, info->closing_wait); | 2681 | tty_wait_until_sent(tty, info->port.closing_wait); |
2682 | 2682 | ||
2683 | spin_lock_irqsave(&card->card_lock, flags); | 2683 | spin_lock_irqsave(&card->card_lock, flags); |
2684 | 2684 | ||
@@ -2734,9 +2734,9 @@ static void cy_close(struct tty_struct *tty, struct file *filp) | |||
2734 | info->port.tty = NULL; | 2734 | info->port.tty = NULL; |
2735 | if (info->port.blocked_open) { | 2735 | if (info->port.blocked_open) { |
2736 | spin_unlock_irqrestore(&card->card_lock, flags); | 2736 | spin_unlock_irqrestore(&card->card_lock, flags); |
2737 | if (info->close_delay) { | 2737 | if (info->port.close_delay) { |
2738 | msleep_interruptible(jiffies_to_msecs | 2738 | msleep_interruptible(jiffies_to_msecs |
2739 | (info->close_delay)); | 2739 | (info->port.close_delay)); |
2740 | } | 2740 | } |
2741 | wake_up_interruptible(&info->port.open_wait); | 2741 | wake_up_interruptible(&info->port.open_wait); |
2742 | spin_lock_irqsave(&card->card_lock, flags); | 2742 | spin_lock_irqsave(&card->card_lock, flags); |
@@ -3382,8 +3382,8 @@ get_serial_info(struct cyclades_port *info, | |||
3382 | cinfo->first_line; | 3382 | cinfo->first_line; |
3383 | tmp.irq = cinfo->irq; | 3383 | tmp.irq = cinfo->irq; |
3384 | tmp.flags = info->port.flags; | 3384 | tmp.flags = info->port.flags; |
3385 | tmp.close_delay = info->close_delay; | 3385 | tmp.close_delay = info->port.close_delay; |
3386 | tmp.closing_wait = info->closing_wait; | 3386 | tmp.closing_wait = info->port.closing_wait; |
3387 | tmp.baud_base = info->baud; | 3387 | tmp.baud_base = info->baud; |
3388 | tmp.custom_divisor = info->custom_divisor; | 3388 | tmp.custom_divisor = info->custom_divisor; |
3389 | tmp.hub6 = 0; /*!!! */ | 3389 | tmp.hub6 = 0; /*!!! */ |
@@ -3402,7 +3402,7 @@ set_serial_info(struct cyclades_port *info, | |||
3402 | old_info = *info; | 3402 | old_info = *info; |
3403 | 3403 | ||
3404 | if (!capable(CAP_SYS_ADMIN)) { | 3404 | if (!capable(CAP_SYS_ADMIN)) { |
3405 | if (new_serial.close_delay != info->close_delay || | 3405 | if (new_serial.close_delay != info->port.close_delay || |
3406 | new_serial.baud_base != info->baud || | 3406 | new_serial.baud_base != info->baud || |
3407 | (new_serial.flags & ASYNC_FLAGS & | 3407 | (new_serial.flags & ASYNC_FLAGS & |
3408 | ~ASYNC_USR_MASK) != | 3408 | ~ASYNC_USR_MASK) != |
@@ -3424,8 +3424,8 @@ set_serial_info(struct cyclades_port *info, | |||
3424 | info->custom_divisor = new_serial.custom_divisor; | 3424 | info->custom_divisor = new_serial.custom_divisor; |
3425 | info->port.flags = (info->port.flags & ~ASYNC_FLAGS) | | 3425 | info->port.flags = (info->port.flags & ~ASYNC_FLAGS) | |
3426 | (new_serial.flags & ASYNC_FLAGS); | 3426 | (new_serial.flags & ASYNC_FLAGS); |
3427 | info->close_delay = new_serial.close_delay * HZ / 100; | 3427 | info->port.close_delay = new_serial.close_delay * HZ / 100; |
3428 | info->closing_wait = new_serial.closing_wait * HZ / 100; | 3428 | info->port.closing_wait = new_serial.closing_wait * HZ / 100; |
3429 | 3429 | ||
3430 | check_and_exit: | 3430 | check_and_exit: |
3431 | if (info->port.flags & ASYNC_INITIALIZED) { | 3431 | if (info->port.flags & ASYNC_INITIALIZED) { |
@@ -3971,11 +3971,11 @@ cy_ioctl(struct tty_struct *tty, struct file *file, | |||
3971 | break; | 3971 | break; |
3972 | #endif /* CONFIG_CYZ_INTR */ | 3972 | #endif /* CONFIG_CYZ_INTR */ |
3973 | case CYSETWAIT: | 3973 | case CYSETWAIT: |
3974 | info->closing_wait = (unsigned short)arg * HZ / 100; | 3974 | info->port.closing_wait = (unsigned short)arg * HZ / 100; |
3975 | ret_val = 0; | 3975 | ret_val = 0; |
3976 | break; | 3976 | break; |
3977 | case CYGETWAIT: | 3977 | case CYGETWAIT: |
3978 | ret_val = info->closing_wait / (HZ / 100); | 3978 | ret_val = info->port.closing_wait / (HZ / 100); |
3979 | break; | 3979 | break; |
3980 | case TIOCGSERIAL: | 3980 | case TIOCGSERIAL: |
3981 | ret_val = get_serial_info(info, argp); | 3981 | ret_val = get_serial_info(info, argp); |
@@ -4376,13 +4376,13 @@ static int __devinit cy_init_card(struct cyclades_card *cinfo) | |||
4376 | for (port = cinfo->first_line; port < cinfo->first_line + nports; | 4376 | for (port = cinfo->first_line; port < cinfo->first_line + nports; |
4377 | port++) { | 4377 | port++) { |
4378 | info = &cinfo->ports[port - cinfo->first_line]; | 4378 | info = &cinfo->ports[port - cinfo->first_line]; |
4379 | tty_port_init(&info->port); | ||
4379 | info->magic = CYCLADES_MAGIC; | 4380 | info->magic = CYCLADES_MAGIC; |
4380 | info->card = cinfo; | 4381 | info->card = cinfo; |
4381 | info->line = port; | 4382 | info->line = port; |
4382 | info->closing_wait = CLOSING_WAIT_DELAY; | ||
4383 | info->close_delay = 5 * HZ / 10; | ||
4384 | 4383 | ||
4385 | tty_port_init(&info->port); | 4384 | info->port.closing_wait = CLOSING_WAIT_DELAY; |
4385 | info->port.close_delay = 5 * HZ / 10; | ||
4386 | info->port.flags = STD_COM_FLAGS; | 4386 | info->port.flags = STD_COM_FLAGS; |
4387 | init_completion(&info->shutdown_wait); | 4387 | init_completion(&info->shutdown_wait); |
4388 | init_waitqueue_head(&info->delta_msr_wait); | 4388 | init_waitqueue_head(&info->delta_msr_wait); |