Commit 21bed701 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

tty: make rocketport use standard port->flags

We need to this ready for using the standard helpers
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c1314a49
...@@ -499,7 +499,7 @@ static void rp_handle_port(struct r_port *info) ...@@ -499,7 +499,7 @@ static void rp_handle_port(struct r_port *info)
if (!info) if (!info)
return; return;
if ((info->flags & ASYNC_INITIALIZED) == 0) { if ((info->port.flags & ASYNC_INITIALIZED) == 0) {
printk(KERN_WARNING "rp: WARNING: rp_handle_port called with " printk(KERN_WARNING "rp: WARNING: rp_handle_port called with "
"info->flags & NOT_INIT\n"); "info->flags & NOT_INIT\n");
return; return;
...@@ -892,11 +892,11 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -892,11 +892,11 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
* until it's done, and then try again. * until it's done, and then try again.
*/ */
if (tty_hung_up_p(filp)) if (tty_hung_up_p(filp))
return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); return ((info->port.flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
if (info->flags & ASYNC_CLOSING) { if (info->flags & ASYNC_CLOSING) {
if (wait_for_completion_interruptible(&info->close_wait)) if (wait_for_completion_interruptible(&info->close_wait))
return -ERESTARTSYS; return -ERESTARTSYS;
return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); return ((info->port.flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
} }
/* /*
...@@ -904,7 +904,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -904,7 +904,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
* then make the check up front and then exit. * then make the check up front and then exit.
*/ */
if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) { if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) {
info->flags |= ASYNC_NORMAL_ACTIVE; info->port.flags |= ASYNC_NORMAL_ACTIVE;
return 0; return 0;
} }
if (tty->termios->c_cflag & CLOCAL) if (tty->termios->c_cflag & CLOCAL)
...@@ -923,7 +923,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -923,7 +923,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
#ifdef ROCKET_DISABLE_SIMUSAGE #ifdef ROCKET_DISABLE_SIMUSAGE
info->flags |= ASYNC_NORMAL_ACTIVE; info->port.flags |= ASYNC_NORMAL_ACTIVE;
#else #else
if (!tty_hung_up_p(filp)) { if (!tty_hung_up_p(filp)) {
extra_count = 1; extra_count = 1;
...@@ -938,14 +938,14 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -938,14 +938,14 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
if (tty->termios->c_cflag & CBAUD) if (tty->termios->c_cflag & CBAUD)
tty_port_raise_dtr_rts(port); tty_port_raise_dtr_rts(port);
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
if (tty_hung_up_p(filp) || !(info->flags & ASYNC_INITIALIZED)) { if (tty_hung_up_p(filp) || !(info->port.flags & ASYNC_INITIALIZED)) {
if (info->flags & ASYNC_HUP_NOTIFY) if (info->port.flags & ASYNC_HUP_NOTIFY)
retval = -EAGAIN; retval = -EAGAIN;
else else
retval = -ERESTARTSYS; retval = -ERESTARTSYS;
break; break;
} }
if (!(info->flags & ASYNC_CLOSING) && if (!(info->port.flags & ASYNC_CLOSING) &&
(do_clocal || tty_port_carrier_raised(port))) (do_clocal || tty_port_carrier_raised(port)))
break; break;
if (signal_pending(current)) { if (signal_pending(current)) {
...@@ -954,7 +954,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -954,7 +954,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
} }
#ifdef ROCKET_DEBUG_OPEN #ifdef ROCKET_DEBUG_OPEN
printk(KERN_INFO "block_til_ready blocking: ttyR%d, count = %d, flags=0x%0x\n", printk(KERN_INFO "block_til_ready blocking: ttyR%d, count = %d, flags=0x%0x\n",
info->line, port->count, info->flags); info->line, port->count, info->port.flags);
#endif #endif
schedule(); /* Don't hold spinlock here, will hang PC */ schedule(); /* Don't hold spinlock here, will hang PC */
} }
...@@ -975,7 +975,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -975,7 +975,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
#endif #endif
if (retval) if (retval)
return retval; return retval;
info->flags |= ASYNC_NORMAL_ACTIVE; info->port.flags |= ASYNC_NORMAL_ACTIVE;
return 0; return 0;
} }
...@@ -998,12 +998,12 @@ static int rp_open(struct tty_struct *tty, struct file *filp) ...@@ -998,12 +998,12 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
if (!page) if (!page)
return -ENOMEM; return -ENOMEM;
if (info->flags & ASYNC_CLOSING) { if (info->port.flags & ASYNC_CLOSING) {
retval = wait_for_completion_interruptible(&info->close_wait); retval = wait_for_completion_interruptible(&info->close_wait);
free_page(page); free_page(page);
if (retval) if (retval)
return retval; return retval;
return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); return ((info->port.flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS);
} }
/* /*
...@@ -1032,7 +1032,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp) ...@@ -1032,7 +1032,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
/* /*
* Info->count is now 1; so it's safe to sleep now. * Info->count is now 1; so it's safe to sleep now.
*/ */
if ((info->flags & ASYNC_INITIALIZED) == 0) { if ((info->port.flags & ASYNC_INITIALIZED) == 0) {
cp = &info->channel; cp = &info->channel;
sSetRxTrigger(cp, TRIG_1); sSetRxTrigger(cp, TRIG_1);
if (sGetChanStatus(cp) & CD_ACT) if (sGetChanStatus(cp) & CD_ACT)
...@@ -1056,7 +1056,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp) ...@@ -1056,7 +1056,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
sEnRxFIFO(cp); sEnRxFIFO(cp);
sEnTransmit(cp); sEnTransmit(cp);
info->flags |= ASYNC_INITIALIZED; info->port.flags |= ASYNC_INITIALIZED;
/* /*
* Set up the tty->alt_speed kludge * Set up the tty->alt_speed kludge
...@@ -1132,7 +1132,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp) ...@@ -1132,7 +1132,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
return; return;
} }
info->flags |= ASYNC_CLOSING; info->port.flags |= ASYNC_CLOSING;
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
cp = &info->channel; cp = &info->channel;
...@@ -1193,7 +1193,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp) ...@@ -1193,7 +1193,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
info->xmit_buf = NULL; info->xmit_buf = NULL;
} }
} }
info->flags &= ~(ASYNC_INITIALIZED | ASYNC_CLOSING | ASYNC_NORMAL_ACTIVE); info->port.flags &= ~(ASYNC_INITIALIZED | ASYNC_CLOSING | ASYNC_NORMAL_ACTIVE);
tty->closing = 0; tty->closing = 0;
complete_all(&info->close_wait); complete_all(&info->close_wait);
atomic_dec(&rp_num_ports_open); atomic_dec(&rp_num_ports_open);
...@@ -1650,14 +1650,14 @@ static void rp_hangup(struct tty_struct *tty) ...@@ -1650,14 +1650,14 @@ static void rp_hangup(struct tty_struct *tty)
printk(KERN_INFO "rp_hangup of ttyR%d...\n", info->line); printk(KERN_INFO "rp_hangup of ttyR%d...\n", info->line);
#endif #endif
rp_flush_buffer(tty); rp_flush_buffer(tty);
if (info->flags & ASYNC_CLOSING) if (info->port.flags & ASYNC_CLOSING)
return; return;
if (info->port.count) if (info->port.count)
atomic_dec(&rp_num_ports_open); atomic_dec(&rp_num_ports_open);
clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]); clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]);
info->port.count = 0; info->port.count = 0;
info->flags &= ~ASYNC_NORMAL_ACTIVE; info->port.flags &= ~ASYNC_NORMAL_ACTIVE;
info->port.tty = NULL; info->port.tty = NULL;
cp = &info->channel; cp = &info->channel;
...@@ -1667,7 +1667,7 @@ static void rp_hangup(struct tty_struct *tty) ...@@ -1667,7 +1667,7 @@ static void rp_hangup(struct tty_struct *tty)
sDisCTSFlowCtl(cp); sDisCTSFlowCtl(cp);
sDisTxSoftFlowCtl(cp); sDisTxSoftFlowCtl(cp);
sClrTxXOFF(cp); sClrTxXOFF(cp);
info->flags &= ~ASYNC_INITIALIZED; info->port.flags &= ~ASYNC_INITIALIZED;
wake_up_interruptible(&info->port.open_wait); wake_up_interruptible(&info->port.open_wait);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment