Commit f8ae4764 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

stallion: use tty_port

Switch the stallion driver to use the tty_port structure
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b1d1619b
...@@ -613,17 +613,17 @@ static void stl_cd_change(struct stlport *portp) ...@@ -613,17 +613,17 @@ static void stl_cd_change(struct stlport *portp)
{ {
unsigned int oldsigs = portp->sigs; unsigned int oldsigs = portp->sigs;
if (!portp->tty) if (!portp->port.tty)
return; return;
portp->sigs = stl_getsignals(portp); portp->sigs = stl_getsignals(portp);
if ((portp->sigs & TIOCM_CD) && ((oldsigs & TIOCM_CD) == 0)) if ((portp->sigs & TIOCM_CD) && ((oldsigs & TIOCM_CD) == 0))
wake_up_interruptible(&portp->open_wait); wake_up_interruptible(&portp->port.open_wait);
if ((oldsigs & TIOCM_CD) && ((portp->sigs & TIOCM_CD) == 0)) if ((oldsigs & TIOCM_CD) && ((portp->sigs & TIOCM_CD) == 0))
if (portp->flags & ASYNC_CHECK_CD) if (portp->port.flags & ASYNC_CHECK_CD)
tty_hangup(portp->tty); tty_hangup(portp->port.tty);
} }
/* /*
...@@ -734,11 +734,11 @@ static int stl_open(struct tty_struct *tty, struct file *filp) ...@@ -734,11 +734,11 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
* On the first open of the device setup the port hardware, and * On the first open of the device setup the port hardware, and
* initialize the per port data structure. * initialize the per port data structure.
*/ */
portp->tty = tty; portp->port.tty = tty;
tty->driver_data = portp; tty->driver_data = portp;
portp->refcount++; portp->port.count++;
if ((portp->flags & ASYNC_INITIALIZED) == 0) { if ((portp->port.flags & ASYNC_INITIALIZED) == 0) {
if (!portp->tx.buf) { if (!portp->tx.buf) {
portp->tx.buf = kmalloc(STL_TXBUFSIZE, GFP_KERNEL); portp->tx.buf = kmalloc(STL_TXBUFSIZE, GFP_KERNEL);
if (!portp->tx.buf) if (!portp->tx.buf)
...@@ -752,7 +752,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp) ...@@ -752,7 +752,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
stl_enablerxtx(portp, 1, 1); stl_enablerxtx(portp, 1, 1);
stl_startrxtx(portp, 1, 0); stl_startrxtx(portp, 1, 0);
clear_bit(TTY_IO_ERROR, &tty->flags); clear_bit(TTY_IO_ERROR, &tty->flags);
portp->flags |= ASYNC_INITIALIZED; portp->port.flags |= ASYNC_INITIALIZED;
} }
/* /*
...@@ -761,9 +761,9 @@ static int stl_open(struct tty_struct *tty, struct file *filp) ...@@ -761,9 +761,9 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
* The sleep here does not need interrupt protection since the wakeup * The sleep here does not need interrupt protection since the wakeup
* for it is done with the same context. * for it is done with the same context.
*/ */
if (portp->flags & ASYNC_CLOSING) { if (portp->port.flags & ASYNC_CLOSING) {
interruptible_sleep_on(&portp->close_wait); interruptible_sleep_on(&portp->port.close_wait);
if (portp->flags & ASYNC_HUP_NOTIFY) if (portp->port.flags & ASYNC_HUP_NOTIFY)
return -EAGAIN; return -EAGAIN;
return -ERESTARTSYS; return -ERESTARTSYS;
} }
...@@ -777,7 +777,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp) ...@@ -777,7 +777,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
if ((rc = stl_waitcarrier(portp, filp)) != 0) if ((rc = stl_waitcarrier(portp, filp)) != 0)
return rc; return rc;
portp->flags |= ASYNC_NORMAL_ACTIVE; portp->port.flags |= ASYNC_NORMAL_ACTIVE;
return 0; return 0;
} }
...@@ -801,25 +801,25 @@ static int stl_waitcarrier(struct stlport *portp, struct file *filp) ...@@ -801,25 +801,25 @@ static int stl_waitcarrier(struct stlport *portp, struct file *filp)
spin_lock_irqsave(&stallion_lock, flags); spin_lock_irqsave(&stallion_lock, flags);
if (portp->tty->termios->c_cflag & CLOCAL) if (portp->port.tty->termios->c_cflag & CLOCAL)
doclocal++; doclocal++;
portp->openwaitcnt++; portp->openwaitcnt++;
if (! tty_hung_up_p(filp)) if (! tty_hung_up_p(filp))
portp->refcount--; portp->port.count--;
for (;;) { for (;;) {
/* Takes brd_lock internally */ /* Takes brd_lock internally */
stl_setsignals(portp, 1, 1); stl_setsignals(portp, 1, 1);
if (tty_hung_up_p(filp) || if (tty_hung_up_p(filp) ||
((portp->flags & ASYNC_INITIALIZED) == 0)) { ((portp->port.flags & ASYNC_INITIALIZED) == 0)) {
if (portp->flags & ASYNC_HUP_NOTIFY) if (portp->port.flags & ASYNC_HUP_NOTIFY)
rc = -EBUSY; rc = -EBUSY;
else else
rc = -ERESTARTSYS; rc = -ERESTARTSYS;
break; break;
} }
if (((portp->flags & ASYNC_CLOSING) == 0) && if (((portp->port.flags & ASYNC_CLOSING) == 0) &&
(doclocal || (portp->sigs & TIOCM_CD))) (doclocal || (portp->sigs & TIOCM_CD)))
break; break;
if (signal_pending(current)) { if (signal_pending(current)) {
...@@ -827,11 +827,11 @@ static int stl_waitcarrier(struct stlport *portp, struct file *filp) ...@@ -827,11 +827,11 @@ static int stl_waitcarrier(struct stlport *portp, struct file *filp)
break; break;
} }
/* FIXME */ /* FIXME */
interruptible_sleep_on(&portp->open_wait); interruptible_sleep_on(&portp->port.open_wait);
} }
if (! tty_hung_up_p(filp)) if (! tty_hung_up_p(filp))
portp->refcount++; portp->port.count++;
portp->openwaitcnt--; portp->openwaitcnt--;
spin_unlock_irqrestore(&stallion_lock, flags); spin_unlock_irqrestore(&stallion_lock, flags);
...@@ -904,15 +904,15 @@ static void stl_close(struct tty_struct *tty, struct file *filp) ...@@ -904,15 +904,15 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
spin_unlock_irqrestore(&stallion_lock, flags); spin_unlock_irqrestore(&stallion_lock, flags);
return; return;
} }
if ((tty->count == 1) && (portp->refcount != 1)) if ((tty->count == 1) && (portp->port.count != 1))
portp->refcount = 1; portp->port.count = 1;
if (portp->refcount-- > 1) { if (portp->port.count-- > 1) {
spin_unlock_irqrestore(&stallion_lock, flags); spin_unlock_irqrestore(&stallion_lock, flags);
return; return;
} }
portp->refcount = 0; portp->port.count = 0;
portp->flags |= ASYNC_CLOSING; portp->port.flags |= ASYNC_CLOSING;
/* /*
* May want to wait for any data to drain before closing. The BUSY * May want to wait for any data to drain before closing. The BUSY
...@@ -930,7 +930,7 @@ static void stl_close(struct tty_struct *tty, struct file *filp) ...@@ -930,7 +930,7 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
spin_lock_irqsave(&stallion_lock, flags); spin_lock_irqsave(&stallion_lock, flags);
portp->flags &= ~ASYNC_INITIALIZED; portp->port.flags &= ~ASYNC_INITIALIZED;
spin_unlock_irqrestore(&stallion_lock, flags); spin_unlock_irqrestore(&stallion_lock, flags);
stl_disableintrs(portp); stl_disableintrs(portp);
...@@ -949,16 +949,16 @@ static void stl_close(struct tty_struct *tty, struct file *filp) ...@@ -949,16 +949,16 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
tty_ldisc_flush(tty); tty_ldisc_flush(tty);
tty->closing = 0; tty->closing = 0;
portp->tty = NULL; portp->port.tty = NULL;
if (portp->openwaitcnt) { if (portp->openwaitcnt) {
if (portp->close_delay) if (portp->close_delay)
msleep_interruptible(jiffies_to_msecs(portp->close_delay)); msleep_interruptible(jiffies_to_msecs(portp->close_delay));
wake_up_interruptible(&portp->open_wait); wake_up_interruptible(&portp->port.open_wait);
} }
portp->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); portp->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
wake_up_interruptible(&portp->close_wait); wake_up_interruptible(&portp->port.close_wait);
} }
/*****************************************************************************/ /*****************************************************************************/
...@@ -1153,7 +1153,7 @@ static int stl_getserial(struct stlport *portp, struct serial_struct __user *sp) ...@@ -1153,7 +1153,7 @@ static int stl_getserial(struct stlport *portp, struct serial_struct __user *sp)
memset(&sio, 0, sizeof(struct serial_struct)); memset(&sio, 0, sizeof(struct serial_struct));
sio.line = portp->portnr; sio.line = portp->portnr;
sio.port = portp->ioaddr; sio.port = portp->ioaddr;
sio.flags = portp->flags; sio.flags = portp->port.flags;
sio.baud_base = portp->baud_base; sio.baud_base = portp->baud_base;
sio.close_delay = portp->close_delay; sio.close_delay = portp->close_delay;
sio.closing_wait = portp->closing_wait; sio.closing_wait = portp->closing_wait;
...@@ -1194,17 +1194,17 @@ static int stl_setserial(struct stlport *portp, struct serial_struct __user *sp) ...@@ -1194,17 +1194,17 @@ static int stl_setserial(struct stlport *portp, struct serial_struct __user *sp)
if ((sio.baud_base != portp->baud_base) || if ((sio.baud_base != portp->baud_base) ||
(sio.close_delay != portp->close_delay) || (sio.close_delay != portp->close_delay) ||
((sio.flags & ~ASYNC_USR_MASK) != ((sio.flags & ~ASYNC_USR_MASK) !=
(portp->flags & ~ASYNC_USR_MASK))) (portp->port.flags & ~ASYNC_USR_MASK)))
return -EPERM; return -EPERM;
} }
portp->flags = (portp->flags & ~ASYNC_USR_MASK) | portp->port.flags = (portp->port.flags & ~ASYNC_USR_MASK) |
(sio.flags & ASYNC_USR_MASK); (sio.flags & ASYNC_USR_MASK);
portp->baud_base = sio.baud_base; portp->baud_base = sio.baud_base;
portp->close_delay = sio.close_delay; portp->close_delay = sio.close_delay;
portp->closing_wait = sio.closing_wait; portp->closing_wait = sio.closing_wait;
portp->custom_divisor = sio.custom_divisor; portp->custom_divisor = sio.custom_divisor;
stl_setport(portp, portp->tty->termios); stl_setport(portp, portp->port.tty->termios);
return 0; return 0;
} }
...@@ -1353,7 +1353,7 @@ static void stl_settermios(struct tty_struct *tty, struct ktermios *old) ...@@ -1353,7 +1353,7 @@ static void stl_settermios(struct tty_struct *tty, struct ktermios *old)
stl_start(tty); stl_start(tty);
} }
if (((old->c_cflag & CLOCAL) == 0) && (tiosp->c_cflag & CLOCAL)) if (((old->c_cflag & CLOCAL) == 0) && (tiosp->c_cflag & CLOCAL))
wake_up_interruptible(&portp->open_wait); wake_up_interruptible(&portp->port.open_wait);
} }
/*****************************************************************************/ /*****************************************************************************/
...@@ -1438,7 +1438,7 @@ static void stl_hangup(struct tty_struct *tty) ...@@ -1438,7 +1438,7 @@ static void stl_hangup(struct tty_struct *tty)
if (portp == NULL) if (portp == NULL)
return; return;
portp->flags &= ~ASYNC_INITIALIZED; portp->port.flags &= ~ASYNC_INITIALIZED;
stl_disableintrs(portp); stl_disableintrs(portp);
if (tty->termios->c_cflag & HUPCL) if (tty->termios->c_cflag & HUPCL)
stl_setsignals(portp, 0, 0); stl_setsignals(portp, 0, 0);
...@@ -1452,10 +1452,10 @@ static void stl_hangup(struct tty_struct *tty) ...@@ -1452,10 +1452,10 @@ static void stl_hangup(struct tty_struct *tty)
portp->tx.head = NULL; portp->tx.head = NULL;
portp->tx.tail = NULL; portp->tx.tail = NULL;
} }
portp->tty = NULL; portp->port.tty = NULL;
portp->flags &= ~ASYNC_NORMAL_ACTIVE; portp->port.flags &= ~ASYNC_NORMAL_ACTIVE;
portp->refcount = 0; portp->port.count = 0;
wake_up_interruptible(&portp->open_wait); wake_up_interruptible(&portp->port.open_wait);
} }
/*****************************************************************************/ /*****************************************************************************/
...@@ -1814,8 +1814,8 @@ static int __devinit stl_initports(struct stlbrd *brdp, struct stlpanel *panelp) ...@@ -1814,8 +1814,8 @@ static int __devinit stl_initports(struct stlbrd *brdp, struct stlpanel *panelp)
portp->baud_base = STL_BAUDBASE; portp->baud_base = STL_BAUDBASE;
portp->close_delay = STL_CLOSEDELAY; portp->close_delay = STL_CLOSEDELAY;
portp->closing_wait = 30 * HZ; portp->closing_wait = 30 * HZ;
init_waitqueue_head(&portp->open_wait); init_waitqueue_head(&portp->port.open_wait);
init_waitqueue_head(&portp->close_wait); init_waitqueue_head(&portp->port.close_wait);
portp->stats.brd = portp->brdnr; portp->stats.brd = portp->brdnr;
portp->stats.panel = portp->panelnr; portp->stats.panel = portp->panelnr;
portp->stats.port = portp->portnr; portp->stats.port = portp->portnr;
...@@ -1840,8 +1840,8 @@ static void stl_cleanup_panels(struct stlbrd *brdp) ...@@ -1840,8 +1840,8 @@ static void stl_cleanup_panels(struct stlbrd *brdp)
portp = panelp->ports[k]; portp = panelp->ports[k];
if (portp == NULL) if (portp == NULL)
continue; continue;
if (portp->tty != NULL) if (portp->port.tty != NULL)
stl_hangup(portp->tty); stl_hangup(portp->port.tty);
kfree(portp->tx.buf); kfree(portp->tx.buf);
kfree(portp); kfree(portp);
} }
...@@ -2513,7 +2513,7 @@ static int stl_getportstats(struct stlport *portp, comstats_t __user *cp) ...@@ -2513,7 +2513,7 @@ static int stl_getportstats(struct stlport *portp, comstats_t __user *cp)
} }
portp->stats.state = portp->istate; portp->stats.state = portp->istate;
portp->stats.flags = portp->flags; portp->stats.flags = portp->port.flags;
portp->stats.hwid = portp->hwid; portp->stats.hwid = portp->hwid;
portp->stats.ttystate = 0; portp->stats.ttystate = 0;
...@@ -2524,16 +2524,16 @@ static int stl_getportstats(struct stlport *portp, comstats_t __user *cp) ...@@ -2524,16 +2524,16 @@ static int stl_getportstats(struct stlport *portp, comstats_t __user *cp)
portp->stats.rxbuffered = 0; portp->stats.rxbuffered = 0;
spin_lock_irqsave(&stallion_lock, flags); spin_lock_irqsave(&stallion_lock, flags);
if (portp->tty != NULL) if (portp->port.tty != NULL)
if (portp->tty->driver_data == portp) { if (portp->port.tty->driver_data == portp) {
portp->stats.ttystate = portp->tty->flags; portp->stats.ttystate = portp->port.tty->flags;
/* No longer available as a statistic */ /* No longer available as a statistic */
portp->stats.rxbuffered = 1; /*portp->tty->flip.count; */ portp->stats.rxbuffered = 1; /*portp->port.tty->flip.count; */
if (portp->tty->termios != NULL) { if (portp->port.tty->termios != NULL) {
portp->stats.cflags = portp->tty->termios->c_cflag; portp->stats.cflags = portp->port.tty->termios->c_cflag;
portp->stats.iflags = portp->tty->termios->c_iflag; portp->stats.iflags = portp->port.tty->termios->c_iflag;
portp->stats.oflags = portp->tty->termios->c_oflag; portp->stats.oflags = portp->port.tty->termios->c_oflag;
portp->stats.lflags = portp->tty->termios->c_lflag; portp->stats.lflags = portp->port.tty->termios->c_lflag;
} }
} }
spin_unlock_irqrestore(&stallion_lock, flags); spin_unlock_irqrestore(&stallion_lock, flags);
...@@ -2939,15 +2939,15 @@ static void stl_cd1400setport(struct stlport *portp, struct ktermios *tiosp) ...@@ -2939,15 +2939,15 @@ static void stl_cd1400setport(struct stlport *portp, struct ktermios *tiosp)
} }
baudrate = stl_baudrates[baudrate]; baudrate = stl_baudrates[baudrate];
if ((tiosp->c_cflag & CBAUD) == B38400) { if ((tiosp->c_cflag & CBAUD) == B38400) {
if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
baudrate = 57600; baudrate = 57600;
else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
baudrate = 115200; baudrate = 115200;
else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
baudrate = 230400; baudrate = 230400;
else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
baudrate = 460800; baudrate = 460800;
else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)
baudrate = (portp->baud_base / portp->custom_divisor); baudrate = (portp->baud_base / portp->custom_divisor);
} }
if (baudrate > STL_CD1400MAXBAUD) if (baudrate > STL_CD1400MAXBAUD)
...@@ -2969,9 +2969,9 @@ static void stl_cd1400setport(struct stlport *portp, struct ktermios *tiosp) ...@@ -2969,9 +2969,9 @@ static void stl_cd1400setport(struct stlport *portp, struct ktermios *tiosp)
mcor1 |= MCOR1_DCD; mcor1 |= MCOR1_DCD;
mcor2 |= MCOR2_DCD; mcor2 |= MCOR2_DCD;
sreron |= SRER_MODEM; sreron |= SRER_MODEM;
portp->flags |= ASYNC_CHECK_CD; portp->port.flags |= ASYNC_CHECK_CD;
} else } else
portp->flags &= ~ASYNC_CHECK_CD; portp->port.flags &= ~ASYNC_CHECK_CD;
/* /*
* Setup cd1400 enhanced modes if we can. In particular we want to * Setup cd1400 enhanced modes if we can. In particular we want to
...@@ -3242,7 +3242,7 @@ static void stl_cd1400flowctrl(struct stlport *portp, int state) ...@@ -3242,7 +3242,7 @@ static void stl_cd1400flowctrl(struct stlport *portp, int state)
if (portp == NULL) if (portp == NULL)
return; return;
tty = portp->tty; tty = portp->port.tty;
if (tty == NULL) if (tty == NULL)
return; return;
...@@ -3304,7 +3304,7 @@ static void stl_cd1400sendflow(struct stlport *portp, int state) ...@@ -3304,7 +3304,7 @@ static void stl_cd1400sendflow(struct stlport *portp, int state)
if (portp == NULL) if (portp == NULL)
return; return;
tty = portp->tty; tty = portp->port.tty;
if (tty == NULL) if (tty == NULL)
return; return;
...@@ -3503,8 +3503,8 @@ static void stl_cd1400txisr(struct stlpanel *panelp, int ioaddr) ...@@ -3503,8 +3503,8 @@ static void stl_cd1400txisr(struct stlpanel *panelp, int ioaddr)
if ((len == 0) || ((len < STL_TXBUFLOW) && if ((len == 0) || ((len < STL_TXBUFLOW) &&
(test_bit(ASYI_TXLOW, &portp->istate) == 0))) { (test_bit(ASYI_TXLOW, &portp->istate) == 0))) {
set_bit(ASYI_TXLOW, &portp->istate); set_bit(ASYI_TXLOW, &portp->istate);
if (portp->tty) if (portp->port.tty)
tty_wakeup(portp->tty); tty_wakeup(portp->port.tty);
} }
if (len == 0) { if (len == 0) {
...@@ -3568,7 +3568,7 @@ static void stl_cd1400rxisr(struct stlpanel *panelp, int ioaddr) ...@@ -3568,7 +3568,7 @@ static void stl_cd1400rxisr(struct stlpanel *panelp, int ioaddr)
return; return;
} }
portp = panelp->ports[(ioack >> 3)]; portp = panelp->ports[(ioack >> 3)];
tty = portp->tty; tty = portp->port.tty;
if ((ioack & ACK_TYPMASK) == ACK_TYPRXGOOD) { if ((ioack & ACK_TYPMASK) == ACK_TYPRXGOOD) {
outb((RDCR + portp->uartaddr), ioaddr); outb((RDCR + portp->uartaddr), ioaddr);
...@@ -3613,7 +3613,7 @@ static void stl_cd1400rxisr(struct stlpanel *panelp, int ioaddr) ...@@ -3613,7 +3613,7 @@ static void stl_cd1400rxisr(struct stlpanel *panelp, int ioaddr)
if (portp->rxmarkmsk & status) { if (portp->rxmarkmsk & status) {
if (status & ST_BREAK) { if (status & ST_BREAK) {
status = TTY_BREAK; status = TTY_BREAK;
if (portp->flags & ASYNC_SAK) { if (portp->port.flags & ASYNC_SAK) {
do_SAK(tty); do_SAK(tty);
BRDENABLE(portp->brdnr, portp->pagenr); BRDENABLE(portp->brdnr, portp->pagenr);
} }
...@@ -3899,15 +3899,15 @@ static void stl_sc26198setport(struct stlport *portp, struct ktermios *tiosp) ...@@ -3899,15 +3899,15 @@ static void stl_sc26198setport(struct stlport *portp, struct ktermios *tiosp)
} }
baudrate = stl_baudrates[baudrate]; baudrate = stl_baudrates[baudrate];
if ((tiosp->c_cflag & CBAUD) == B38400) { if ((tiosp->c_cflag & CBAUD) == B38400) {
if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
baudrate = 57600; baudrate = 57600;
else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
baudrate = 115200; baudrate = 115200;
else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
baudrate = 230400; baudrate = 230400;
else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
baudrate = 460800; baudrate = 460800;
else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)
baudrate = (portp->baud_base / portp->custom_divisor); baudrate = (portp->baud_base / portp->custom_divisor);
} }
if (baudrate > STL_SC26198MAXBAUD) if (baudrate > STL_SC26198MAXBAUD)
...@@ -3922,11 +3922,11 @@ static void stl_sc26198setport(struct stlport *portp, struct ktermios *tiosp) ...@@ -3922,11 +3922,11 @@ static void stl_sc26198setport(struct stlport *portp, struct ktermios *tiosp)
* Check what form of modem signaling is required and set it up. * Check what form of modem signaling is required and set it up.
*/ */
if (tiosp->c_cflag & CLOCAL) { if (tiosp->c_cflag & CLOCAL) {
portp->flags &= ~ASYNC_CHECK_CD; portp->port.flags &= ~ASYNC_CHECK_CD;
} else { } else {
iopr |= IOPR_DCDCOS; iopr |= IOPR_DCDCOS;
imron |= IR_IOPORT; imron |= IR_IOPORT;
portp->flags |= ASYNC_CHECK_CD; portp->port.flags |= ASYNC_CHECK_CD;
} }
/* /*
...@@ -4174,7 +4174,7 @@ static void stl_sc26198flowctrl(struct stlport *portp, int state) ...@@ -4174,7 +4174,7 @@ static void stl_sc26198flowctrl(struct stlport *portp, int state)
if (portp == NULL) if (portp == NULL)
return; return;
tty = portp->tty; tty = portp->port.tty;
if (tty == NULL) if (tty == NULL)
return; return;
...@@ -4243,7 +4243,7 @@ static void stl_sc26198sendflow(struct stlport *portp, int state) ...@@ -4243,7 +4243,7 @@ static void stl_sc26198sendflow(struct stlport *portp, int state)
if (portp == NULL) if (portp == NULL)
return; return;
tty = portp->tty; tty = portp->port.tty;
if (tty == NULL) if (tty == NULL)
return; return;
...@@ -4421,8 +4421,8 @@ static void stl_sc26198txisr(struct stlport *portp) ...@@ -4421,8 +4421,8 @@ static void stl_sc26198txisr(struct stlport *portp)
if ((len == 0) || ((len < STL_TXBUFLOW) && if ((len == 0) || ((len < STL_TXBUFLOW) &&
(test_bit(ASYI_TXLOW, &portp->istate) == 0))) { (test_bit(ASYI_TXLOW, &portp->istate) == 0))) {
set_bit(ASYI_TXLOW, &portp->istate); set_bit(ASYI_TXLOW, &portp->istate);
if (portp->tty) if (portp->port.tty)
tty_wakeup(portp->tty); tty_wakeup(portp->port.tty);
} }
if (len == 0) { if (len == 0) {
...@@ -4475,7 +4475,7 @@ static void stl_sc26198rxisr(struct stlport *portp, unsigned int iack) ...@@ -4475,7 +4475,7 @@ static void stl_sc26198rxisr(struct stlport *portp, unsigned int iack)
pr_debug("stl_sc26198rxisr(portp=%p,iack=%x)\n", portp, iack); pr_debug("stl_sc26198rxisr(portp=%p,iack=%x)\n", portp, iack);
tty = portp->tty; tty = portp->port.tty;
ioaddr = portp->ioaddr; ioaddr = portp->ioaddr;
outb(GIBCR, (ioaddr + XP_ADDR)); outb(GIBCR, (ioaddr + XP_ADDR));
len = inb(ioaddr + XP_DATA) + 1; len = inb(ioaddr + XP_DATA) + 1;
...@@ -4527,7 +4527,7 @@ static void stl_sc26198rxbadch(struct stlport *portp, unsigned char status, char ...@@ -4527,7 +4527,7 @@ static void stl_sc26198rxbadch(struct stlport *portp, unsigned char status, char
struct tty_struct *tty; struct tty_struct *tty;
unsigned int ioaddr; unsigned int ioaddr;
tty = portp->tty; tty = portp->port.tty;
ioaddr = portp->ioaddr; ioaddr = portp->ioaddr;
if (status & SR_RXPARITY) if (status & SR_RXPARITY)
...@@ -4544,7 +4544,7 @@ static void stl_sc26198rxbadch(struct stlport *portp, unsigned char status, char ...@@ -4544,7 +4544,7 @@ static void stl_sc26198rxbadch(struct stlport *portp, unsigned char status, char
if (portp->rxmarkmsk & status) { if (portp->rxmarkmsk & status) {
if (status & SR_RXBREAK) { if (status & SR_RXBREAK) {
status = TTY_BREAK; status = TTY_BREAK;
if (portp->flags & ASYNC_SAK) { if (portp->port.flags & ASYNC_SAK) {
do_SAK(tty); do_SAK(tty);
BRDENABLE(portp->brdnr, portp->pagenr); BRDENABLE(portp->brdnr, portp->pagenr);
} }
......
...@@ -69,6 +69,7 @@ struct stlrq { ...@@ -69,6 +69,7 @@ struct stlrq {
*/ */
struct stlport { struct stlport {
unsigned long magic; unsigned long magic;
struct tty_port port;
unsigned int portnr; unsigned int portnr;
unsigned int panelnr; unsigned int panelnr;
unsigned int brdnr; unsigned int brdnr;
...@@ -76,12 +77,10 @@ struct stlport { ...@@ -76,12 +77,10 @@ struct stlport {
int uartaddr; int uartaddr;
unsigned int pagenr; unsigned int pagenr;
unsigned long istate; unsigned long istate;
int flags;
int baud_base; int baud_base;
int custom_divisor; int custom_divisor;
int close_delay; int close_delay;
int closing_wait; int closing_wait;
int refcount;
int openwaitcnt; int openwaitcnt;
int brklen; int brklen;
unsigned int sigs; unsigned int sigs;
...@@ -92,9 +91,6 @@ struct stlport { ...@@ -92,9 +91,6 @@ struct stlport {
unsigned long clk; unsigned long clk;
unsigned long hwid; unsigned long hwid;
void *uartp; void *uartp;
struct tty_struct *tty;
wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
comstats_t stats; comstats_t stats;
struct stlrq tx; struct stlrq tx;
}; };
......
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