aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/stallion.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-07-16 16:56:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-20 20:12:37 -0400
commitf8ae47641611fcdf175ab8bbe89054731b16971d (patch)
tree9008eb8b650ef694b302bbc22e6a4e8a6d54bcd6 /drivers/char/stallion.c
parentb1d1619b4a53072f19e41b1def71fd223fc5d780 (diff)
stallion: use tty_port
Switch the stallion driver to use 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/stallion.c')
-rw-r--r--drivers/char/stallion.c160
1 files changed, 80 insertions, 80 deletions
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index d17be10c5d21..0243efb0be95 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -613,17 +613,17 @@ static void stl_cd_change(struct stlport *portp)
613{ 613{
614 unsigned int oldsigs = portp->sigs; 614 unsigned int oldsigs = portp->sigs;
615 615
616 if (!portp->tty) 616 if (!portp->port.tty)
617 return; 617 return;
618 618
619 portp->sigs = stl_getsignals(portp); 619 portp->sigs = stl_getsignals(portp);
620 620
621 if ((portp->sigs & TIOCM_CD) && ((oldsigs & TIOCM_CD) == 0)) 621 if ((portp->sigs & TIOCM_CD) && ((oldsigs & TIOCM_CD) == 0))
622 wake_up_interruptible(&portp->open_wait); 622 wake_up_interruptible(&portp->port.open_wait);
623 623
624 if ((oldsigs & TIOCM_CD) && ((portp->sigs & TIOCM_CD) == 0)) 624 if ((oldsigs & TIOCM_CD) && ((portp->sigs & TIOCM_CD) == 0))
625 if (portp->flags & ASYNC_CHECK_CD) 625 if (portp->port.flags & ASYNC_CHECK_CD)
626 tty_hangup(portp->tty); 626 tty_hangup(portp->port.tty);
627} 627}
628 628
629/* 629/*
@@ -734,11 +734,11 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
734 * On the first open of the device setup the port hardware, and 734 * On the first open of the device setup the port hardware, and
735 * initialize the per port data structure. 735 * initialize the per port data structure.
736 */ 736 */
737 portp->tty = tty; 737 portp->port.tty = tty;
738 tty->driver_data = portp; 738 tty->driver_data = portp;
739 portp->refcount++; 739 portp->port.count++;
740 740
741 if ((portp->flags & ASYNC_INITIALIZED) == 0) { 741 if ((portp->port.flags & ASYNC_INITIALIZED) == 0) {
742 if (!portp->tx.buf) { 742 if (!portp->tx.buf) {
743 portp->tx.buf = kmalloc(STL_TXBUFSIZE, GFP_KERNEL); 743 portp->tx.buf = kmalloc(STL_TXBUFSIZE, GFP_KERNEL);
744 if (!portp->tx.buf) 744 if (!portp->tx.buf)
@@ -752,7 +752,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
752 stl_enablerxtx(portp, 1, 1); 752 stl_enablerxtx(portp, 1, 1);
753 stl_startrxtx(portp, 1, 0); 753 stl_startrxtx(portp, 1, 0);
754 clear_bit(TTY_IO_ERROR, &tty->flags); 754 clear_bit(TTY_IO_ERROR, &tty->flags);
755 portp->flags |= ASYNC_INITIALIZED; 755 portp->port.flags |= ASYNC_INITIALIZED;
756 } 756 }
757 757
758/* 758/*
@@ -761,9 +761,9 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
761 * The sleep here does not need interrupt protection since the wakeup 761 * The sleep here does not need interrupt protection since the wakeup
762 * for it is done with the same context. 762 * for it is done with the same context.
763 */ 763 */
764 if (portp->flags & ASYNC_CLOSING) { 764 if (portp->port.flags & ASYNC_CLOSING) {
765 interruptible_sleep_on(&portp->close_wait); 765 interruptible_sleep_on(&portp->port.close_wait);
766 if (portp->flags & ASYNC_HUP_NOTIFY) 766 if (portp->port.flags & ASYNC_HUP_NOTIFY)
767 return -EAGAIN; 767 return -EAGAIN;
768 return -ERESTARTSYS; 768 return -ERESTARTSYS;
769 } 769 }
@@ -777,7 +777,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
777 if ((rc = stl_waitcarrier(portp, filp)) != 0) 777 if ((rc = stl_waitcarrier(portp, filp)) != 0)
778 return rc; 778 return rc;
779 779
780 portp->flags |= ASYNC_NORMAL_ACTIVE; 780 portp->port.flags |= ASYNC_NORMAL_ACTIVE;
781 781
782 return 0; 782 return 0;
783} 783}
@@ -801,25 +801,25 @@ static int stl_waitcarrier(struct stlport *portp, struct file *filp)
801 801
802 spin_lock_irqsave(&stallion_lock, flags); 802 spin_lock_irqsave(&stallion_lock, flags);
803 803
804 if (portp->tty->termios->c_cflag & CLOCAL) 804 if (portp->port.tty->termios->c_cflag & CLOCAL)
805 doclocal++; 805 doclocal++;
806 806
807 portp->openwaitcnt++; 807 portp->openwaitcnt++;
808 if (! tty_hung_up_p(filp)) 808 if (! tty_hung_up_p(filp))
809 portp->refcount--; 809 portp->port.count--;
810 810
811 for (;;) { 811 for (;;) {
812 /* Takes brd_lock internally */ 812 /* Takes brd_lock internally */
813 stl_setsignals(portp, 1, 1); 813 stl_setsignals(portp, 1, 1);
814 if (tty_hung_up_p(filp) || 814 if (tty_hung_up_p(filp) ||
815 ((portp->flags & ASYNC_INITIALIZED) == 0)) { 815 ((portp->port.flags & ASYNC_INITIALIZED) == 0)) {
816 if (portp->flags & ASYNC_HUP_NOTIFY) 816 if (portp->port.flags & ASYNC_HUP_NOTIFY)
817 rc = -EBUSY; 817 rc = -EBUSY;
818 else 818 else
819 rc = -ERESTARTSYS; 819 rc = -ERESTARTSYS;
820 break; 820 break;
821 } 821 }
822 if (((portp->flags & ASYNC_CLOSING) == 0) && 822 if (((portp->port.flags & ASYNC_CLOSING) == 0) &&
823 (doclocal || (portp->sigs & TIOCM_CD))) 823 (doclocal || (portp->sigs & TIOCM_CD)))
824 break; 824 break;
825 if (signal_pending(current)) { 825 if (signal_pending(current)) {
@@ -827,11 +827,11 @@ static int stl_waitcarrier(struct stlport *portp, struct file *filp)
827 break; 827 break;
828 } 828 }
829 /* FIXME */ 829 /* FIXME */
830 interruptible_sleep_on(&portp->open_wait); 830 interruptible_sleep_on(&portp->port.open_wait);
831 } 831 }
832 832
833 if (! tty_hung_up_p(filp)) 833 if (! tty_hung_up_p(filp))
834 portp->refcount++; 834 portp->port.count++;
835 portp->openwaitcnt--; 835 portp->openwaitcnt--;
836 spin_unlock_irqrestore(&stallion_lock, flags); 836 spin_unlock_irqrestore(&stallion_lock, flags);
837 837
@@ -904,15 +904,15 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
904 spin_unlock_irqrestore(&stallion_lock, flags); 904 spin_unlock_irqrestore(&stallion_lock, flags);
905 return; 905 return;
906 } 906 }
907 if ((tty->count == 1) && (portp->refcount != 1)) 907 if ((tty->count == 1) && (portp->port.count != 1))
908 portp->refcount = 1; 908 portp->port.count = 1;
909 if (portp->refcount-- > 1) { 909 if (portp->port.count-- > 1) {
910 spin_unlock_irqrestore(&stallion_lock, flags); 910 spin_unlock_irqrestore(&stallion_lock, flags);
911 return; 911 return;
912 } 912 }
913 913
914 portp->refcount = 0; 914 portp->port.count = 0;
915 portp->flags |= ASYNC_CLOSING; 915 portp->port.flags |= ASYNC_CLOSING;
916 916
917/* 917/*
918 * May want to wait for any data to drain before closing. The BUSY 918 * 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 930
931 931
932 spin_lock_irqsave(&stallion_lock, flags); 932 spin_lock_irqsave(&stallion_lock, flags);
933 portp->flags &= ~ASYNC_INITIALIZED; 933 portp->port.flags &= ~ASYNC_INITIALIZED;
934 spin_unlock_irqrestore(&stallion_lock, flags); 934 spin_unlock_irqrestore(&stallion_lock, flags);
935 935
936 stl_disableintrs(portp); 936 stl_disableintrs(portp);
@@ -949,16 +949,16 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
949 tty_ldisc_flush(tty); 949 tty_ldisc_flush(tty);
950 950
951 tty->closing = 0; 951 tty->closing = 0;
952 portp->tty = NULL; 952 portp->port.tty = NULL;
953 953
954 if (portp->openwaitcnt) { 954 if (portp->openwaitcnt) {
955 if (portp->close_delay) 955 if (portp->close_delay)
956 msleep_interruptible(jiffies_to_msecs(portp->close_delay)); 956 msleep_interruptible(jiffies_to_msecs(portp->close_delay));
957 wake_up_interruptible(&portp->open_wait); 957 wake_up_interruptible(&portp->port.open_wait);
958 } 958 }
959 959
960 portp->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); 960 portp->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
961 wake_up_interruptible(&portp->close_wait); 961 wake_up_interruptible(&portp->port.close_wait);
962} 962}
963 963
964/*****************************************************************************/ 964/*****************************************************************************/
@@ -1153,7 +1153,7 @@ static int stl_getserial(struct stlport *portp, struct serial_struct __user *sp)
1153 memset(&sio, 0, sizeof(struct serial_struct)); 1153 memset(&sio, 0, sizeof(struct serial_struct));
1154 sio.line = portp->portnr; 1154 sio.line = portp->portnr;
1155 sio.port = portp->ioaddr; 1155 sio.port = portp->ioaddr;
1156 sio.flags = portp->flags; 1156 sio.flags = portp->port.flags;
1157 sio.baud_base = portp->baud_base; 1157 sio.baud_base = portp->baud_base;
1158 sio.close_delay = portp->close_delay; 1158 sio.close_delay = portp->close_delay;
1159 sio.closing_wait = portp->closing_wait; 1159 sio.closing_wait = portp->closing_wait;
@@ -1194,17 +1194,17 @@ static int stl_setserial(struct stlport *portp, struct serial_struct __user *sp)
1194 if ((sio.baud_base != portp->baud_base) || 1194 if ((sio.baud_base != portp->baud_base) ||
1195 (sio.close_delay != portp->close_delay) || 1195 (sio.close_delay != portp->close_delay) ||
1196 ((sio.flags & ~ASYNC_USR_MASK) != 1196 ((sio.flags & ~ASYNC_USR_MASK) !=
1197 (portp->flags & ~ASYNC_USR_MASK))) 1197 (portp->port.flags & ~ASYNC_USR_MASK)))
1198 return -EPERM; 1198 return -EPERM;
1199 } 1199 }
1200 1200
1201 portp->flags = (portp->flags & ~ASYNC_USR_MASK) | 1201 portp->port.flags = (portp->port.flags & ~ASYNC_USR_MASK) |
1202 (sio.flags & ASYNC_USR_MASK); 1202 (sio.flags & ASYNC_USR_MASK);
1203 portp->baud_base = sio.baud_base; 1203 portp->baud_base = sio.baud_base;
1204 portp->close_delay = sio.close_delay; 1204 portp->close_delay = sio.close_delay;
1205 portp->closing_wait = sio.closing_wait; 1205 portp->closing_wait = sio.closing_wait;
1206 portp->custom_divisor = sio.custom_divisor; 1206 portp->custom_divisor = sio.custom_divisor;
1207 stl_setport(portp, portp->tty->termios); 1207 stl_setport(portp, portp->port.tty->termios);
1208 return 0; 1208 return 0;
1209} 1209}
1210 1210
@@ -1353,7 +1353,7 @@ static void stl_settermios(struct tty_struct *tty, struct ktermios *old)
1353 stl_start(tty); 1353 stl_start(tty);
1354 } 1354 }
1355 if (((old->c_cflag & CLOCAL) == 0) && (tiosp->c_cflag & CLOCAL)) 1355 if (((old->c_cflag & CLOCAL) == 0) && (tiosp->c_cflag & CLOCAL))
1356 wake_up_interruptible(&portp->open_wait); 1356 wake_up_interruptible(&portp->port.open_wait);
1357} 1357}
1358 1358
1359/*****************************************************************************/ 1359/*****************************************************************************/
@@ -1438,7 +1438,7 @@ static void stl_hangup(struct tty_struct *tty)
1438 if (portp == NULL) 1438 if (portp == NULL)
1439 return; 1439 return;
1440 1440
1441 portp->flags &= ~ASYNC_INITIALIZED; 1441 portp->port.flags &= ~ASYNC_INITIALIZED;
1442 stl_disableintrs(portp); 1442 stl_disableintrs(portp);
1443 if (tty->termios->c_cflag & HUPCL) 1443 if (tty->termios->c_cflag & HUPCL)
1444 stl_setsignals(portp, 0, 0); 1444 stl_setsignals(portp, 0, 0);
@@ -1452,10 +1452,10 @@ static void stl_hangup(struct tty_struct *tty)
1452 portp->tx.head = NULL; 1452 portp->tx.head = NULL;
1453 portp->tx.tail = NULL; 1453 portp->tx.tail = NULL;
1454 } 1454 }
1455 portp->tty = NULL; 1455 portp->port.tty = NULL;
1456 portp->flags &= ~ASYNC_NORMAL_ACTIVE; 1456 portp->port.flags &= ~ASYNC_NORMAL_ACTIVE;
1457 portp->refcount = 0; 1457 portp->port.count = 0;
1458 wake_up_interruptible(&portp->open_wait); 1458 wake_up_interruptible(&portp->port.open_wait);
1459} 1459}
1460 1460
1461/*****************************************************************************/ 1461/*****************************************************************************/
@@ -1814,8 +1814,8 @@ static int __devinit stl_initports(struct stlbrd *brdp, struct stlpanel *panelp)
1814 portp->baud_base = STL_BAUDBASE; 1814 portp->baud_base = STL_BAUDBASE;
1815 portp->close_delay = STL_CLOSEDELAY; 1815 portp->close_delay = STL_CLOSEDELAY;
1816 portp->closing_wait = 30 * HZ; 1816 portp->closing_wait = 30 * HZ;
1817 init_waitqueue_head(&portp->open_wait); 1817 init_waitqueue_head(&portp->port.open_wait);
1818 init_waitqueue_head(&portp->close_wait); 1818 init_waitqueue_head(&portp->port.close_wait);
1819 portp->stats.brd = portp->brdnr; 1819 portp->stats.brd = portp->brdnr;
1820 portp->stats.panel = portp->panelnr; 1820 portp->stats.panel = portp->panelnr;
1821 portp->stats.port = portp->portnr; 1821 portp->stats.port = portp->portnr;
@@ -1840,8 +1840,8 @@ static void stl_cleanup_panels(struct stlbrd *brdp)
1840 portp = panelp->ports[k]; 1840 portp = panelp->ports[k];
1841 if (portp == NULL) 1841 if (portp == NULL)
1842 continue; 1842 continue;
1843 if (portp->tty != NULL) 1843 if (portp->port.tty != NULL)
1844 stl_hangup(portp->tty); 1844 stl_hangup(portp->port.tty);
1845 kfree(portp->tx.buf); 1845 kfree(portp->tx.buf);
1846 kfree(portp); 1846 kfree(portp);
1847 } 1847 }
@@ -2513,7 +2513,7 @@ static int stl_getportstats(struct stlport *portp, comstats_t __user *cp)
2513 } 2513 }
2514 2514
2515 portp->stats.state = portp->istate; 2515 portp->stats.state = portp->istate;
2516 portp->stats.flags = portp->flags; 2516 portp->stats.flags = portp->port.flags;
2517 portp->stats.hwid = portp->hwid; 2517 portp->stats.hwid = portp->hwid;
2518 2518
2519 portp->stats.ttystate = 0; 2519 portp->stats.ttystate = 0;
@@ -2524,16 +2524,16 @@ static int stl_getportstats(struct stlport *portp, comstats_t __user *cp)
2524 portp->stats.rxbuffered = 0; 2524 portp->stats.rxbuffered = 0;
2525 2525
2526 spin_lock_irqsave(&stallion_lock, flags); 2526 spin_lock_irqsave(&stallion_lock, flags);
2527 if (portp->tty != NULL) 2527 if (portp->port.tty != NULL)
2528 if (portp->tty->driver_data == portp) { 2528 if (portp->port.tty->driver_data == portp) {
2529 portp->stats.ttystate = portp->tty->flags; 2529 portp->stats.ttystate = portp->port.tty->flags;
2530 /* No longer available as a statistic */ 2530 /* No longer available as a statistic */
2531 portp->stats.rxbuffered = 1; /*portp->tty->flip.count; */ 2531 portp->stats.rxbuffered = 1; /*portp->port.tty->flip.count; */
2532 if (portp->tty->termios != NULL) { 2532 if (portp->port.tty->termios != NULL) {
2533 portp->stats.cflags = portp->tty->termios->c_cflag; 2533 portp->stats.cflags = portp->port.tty->termios->c_cflag;
2534 portp->stats.iflags = portp->tty->termios->c_iflag; 2534 portp->stats.iflags = portp->port.tty->termios->c_iflag;
2535 portp->stats.oflags = portp->tty->termios->c_oflag; 2535 portp->stats.oflags = portp->port.tty->termios->c_oflag;
2536 portp->stats.lflags = portp->tty->termios->c_lflag; 2536 portp->stats.lflags = portp->port.tty->termios->c_lflag;
2537 } 2537 }
2538 } 2538 }
2539 spin_unlock_irqrestore(&stallion_lock, flags); 2539 spin_unlock_irqrestore(&stallion_lock, flags);
@@ -2939,15 +2939,15 @@ static void stl_cd1400setport(struct stlport *portp, struct ktermios *tiosp)
2939 } 2939 }
2940 baudrate = stl_baudrates[baudrate]; 2940 baudrate = stl_baudrates[baudrate];
2941 if ((tiosp->c_cflag & CBAUD) == B38400) { 2941 if ((tiosp->c_cflag & CBAUD) == B38400) {
2942 if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) 2942 if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
2943 baudrate = 57600; 2943 baudrate = 57600;
2944 else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) 2944 else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
2945 baudrate = 115200; 2945 baudrate = 115200;
2946 else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) 2946 else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
2947 baudrate = 230400; 2947 baudrate = 230400;
2948 else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) 2948 else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
2949 baudrate = 460800; 2949 baudrate = 460800;
2950 else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) 2950 else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)
2951 baudrate = (portp->baud_base / portp->custom_divisor); 2951 baudrate = (portp->baud_base / portp->custom_divisor);
2952 } 2952 }
2953 if (baudrate > STL_CD1400MAXBAUD) 2953 if (baudrate > STL_CD1400MAXBAUD)
@@ -2969,9 +2969,9 @@ static void stl_cd1400setport(struct stlport *portp, struct ktermios *tiosp)
2969 mcor1 |= MCOR1_DCD; 2969 mcor1 |= MCOR1_DCD;
2970 mcor2 |= MCOR2_DCD; 2970 mcor2 |= MCOR2_DCD;
2971 sreron |= SRER_MODEM; 2971 sreron |= SRER_MODEM;
2972 portp->flags |= ASYNC_CHECK_CD; 2972 portp->port.flags |= ASYNC_CHECK_CD;
2973 } else 2973 } else
2974 portp->flags &= ~ASYNC_CHECK_CD; 2974 portp->port.flags &= ~ASYNC_CHECK_CD;
2975 2975
2976/* 2976/*
2977 * Setup cd1400 enhanced modes if we can. In particular we want to 2977 * 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 3242
3243 if (portp == NULL) 3243 if (portp == NULL)
3244 return; 3244 return;
3245 tty = portp->tty; 3245 tty = portp->port.tty;
3246 if (tty == NULL) 3246 if (tty == NULL)
3247 return; 3247 return;
3248 3248
@@ -3304,7 +3304,7 @@ static void stl_cd1400sendflow(struct stlport *portp, int state)
3304 3304
3305 if (portp == NULL) 3305 if (portp == NULL)
3306 return; 3306 return;
3307 tty = portp->tty; 3307 tty = portp->port.tty;
3308 if (tty == NULL) 3308 if (tty == NULL)
3309 return; 3309 return;
3310 3310
@@ -3503,8 +3503,8 @@ static void stl_cd1400txisr(struct stlpanel *panelp, int ioaddr)
3503 if ((len == 0) || ((len < STL_TXBUFLOW) && 3503 if ((len == 0) || ((len < STL_TXBUFLOW) &&
3504 (test_bit(ASYI_TXLOW, &portp->istate) == 0))) { 3504 (test_bit(ASYI_TXLOW, &portp->istate) == 0))) {
3505 set_bit(ASYI_TXLOW, &portp->istate); 3505 set_bit(ASYI_TXLOW, &portp->istate);
3506 if (portp->tty) 3506 if (portp->port.tty)
3507 tty_wakeup(portp->tty); 3507 tty_wakeup(portp->port.tty);
3508 } 3508 }
3509 3509
3510 if (len == 0) { 3510 if (len == 0) {
@@ -3568,7 +3568,7 @@ static void stl_cd1400rxisr(struct stlpanel *panelp, int ioaddr)
3568 return; 3568 return;
3569 } 3569 }
3570 portp = panelp->ports[(ioack >> 3)]; 3570 portp = panelp->ports[(ioack >> 3)];
3571 tty = portp->tty; 3571 tty = portp->port.tty;
3572 3572
3573 if ((ioack & ACK_TYPMASK) == ACK_TYPRXGOOD) { 3573 if ((ioack & ACK_TYPMASK) == ACK_TYPRXGOOD) {
3574 outb((RDCR + portp->uartaddr), ioaddr); 3574 outb((RDCR + portp->uartaddr), ioaddr);
@@ -3613,7 +3613,7 @@ static void stl_cd1400rxisr(struct stlpanel *panelp, int ioaddr)
3613 if (portp->rxmarkmsk & status) { 3613 if (portp->rxmarkmsk & status) {
3614 if (status & ST_BREAK) { 3614 if (status & ST_BREAK) {
3615 status = TTY_BREAK; 3615 status = TTY_BREAK;
3616 if (portp->flags & ASYNC_SAK) { 3616 if (portp->port.flags & ASYNC_SAK) {
3617 do_SAK(tty); 3617 do_SAK(tty);
3618 BRDENABLE(portp->brdnr, portp->pagenr); 3618 BRDENABLE(portp->brdnr, portp->pagenr);
3619 } 3619 }
@@ -3899,15 +3899,15 @@ static void stl_sc26198setport(struct stlport *portp, struct ktermios *tiosp)
3899 } 3899 }
3900 baudrate = stl_baudrates[baudrate]; 3900 baudrate = stl_baudrates[baudrate];
3901 if ((tiosp->c_cflag & CBAUD) == B38400) { 3901 if ((tiosp->c_cflag & CBAUD) == B38400) {
3902 if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) 3902 if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
3903 baudrate = 57600; 3903 baudrate = 57600;
3904 else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) 3904 else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
3905 baudrate = 115200; 3905 baudrate = 115200;
3906 else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) 3906 else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
3907 baudrate = 230400; 3907 baudrate = 230400;
3908 else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) 3908 else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
3909 baudrate = 460800; 3909 baudrate = 460800;
3910 else if ((portp->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) 3910 else if ((portp->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)
3911 baudrate = (portp->baud_base / portp->custom_divisor); 3911 baudrate = (portp->baud_base / portp->custom_divisor);
3912 } 3912 }
3913 if (baudrate > STL_SC26198MAXBAUD) 3913 if (baudrate > STL_SC26198MAXBAUD)
@@ -3922,11 +3922,11 @@ static void stl_sc26198setport(struct stlport *portp, struct ktermios *tiosp)
3922 * Check what form of modem signaling is required and set it up. 3922 * Check what form of modem signaling is required and set it up.
3923 */ 3923 */
3924 if (tiosp->c_cflag & CLOCAL) { 3924 if (tiosp->c_cflag & CLOCAL) {
3925 portp->flags &= ~ASYNC_CHECK_CD; 3925 portp->port.flags &= ~ASYNC_CHECK_CD;
3926 } else { 3926 } else {
3927 iopr |= IOPR_DCDCOS; 3927 iopr |= IOPR_DCDCOS;
3928 imron |= IR_IOPORT; 3928 imron |= IR_IOPORT;
3929 portp->flags |= ASYNC_CHECK_CD; 3929 portp->port.flags |= ASYNC_CHECK_CD;
3930 } 3930 }
3931 3931
3932/* 3932/*
@@ -4174,7 +4174,7 @@ static void stl_sc26198flowctrl(struct stlport *portp, int state)
4174 4174
4175 if (portp == NULL) 4175 if (portp == NULL)
4176 return; 4176 return;
4177 tty = portp->tty; 4177 tty = portp->port.tty;
4178 if (tty == NULL) 4178 if (tty == NULL)
4179 return; 4179 return;
4180 4180
@@ -4243,7 +4243,7 @@ static void stl_sc26198sendflow(struct stlport *portp, int state)
4243 4243
4244 if (portp == NULL) 4244 if (portp == NULL)
4245 return; 4245 return;
4246 tty = portp->tty; 4246 tty = portp->port.tty;
4247 if (tty == NULL) 4247 if (tty == NULL)
4248 return; 4248 return;
4249 4249
@@ -4421,8 +4421,8 @@ static void stl_sc26198txisr(struct stlport *portp)
4421 if ((len == 0) || ((len < STL_TXBUFLOW) && 4421 if ((len == 0) || ((len < STL_TXBUFLOW) &&
4422 (test_bit(ASYI_TXLOW, &portp->istate) == 0))) { 4422 (test_bit(ASYI_TXLOW, &portp->istate) == 0))) {
4423 set_bit(ASYI_TXLOW, &portp->istate); 4423 set_bit(ASYI_TXLOW, &portp->istate);
4424 if (portp->tty) 4424 if (portp->port.tty)
4425 tty_wakeup(portp->tty); 4425 tty_wakeup(portp->port.tty);
4426 } 4426 }
4427 4427
4428 if (len == 0) { 4428 if (len == 0) {
@@ -4475,7 +4475,7 @@ static void stl_sc26198rxisr(struct stlport *portp, unsigned int iack)
4475 4475
4476 pr_debug("stl_sc26198rxisr(portp=%p,iack=%x)\n", portp, iack); 4476 pr_debug("stl_sc26198rxisr(portp=%p,iack=%x)\n", portp, iack);
4477 4477
4478 tty = portp->tty; 4478 tty = portp->port.tty;
4479 ioaddr = portp->ioaddr; 4479 ioaddr = portp->ioaddr;
4480 outb(GIBCR, (ioaddr + XP_ADDR)); 4480 outb(GIBCR, (ioaddr + XP_ADDR));
4481 len = inb(ioaddr + XP_DATA) + 1; 4481 len = inb(ioaddr + XP_DATA) + 1;
@@ -4527,7 +4527,7 @@ static void stl_sc26198rxbadch(struct stlport *portp, unsigned char status, char
4527 struct tty_struct *tty; 4527 struct tty_struct *tty;
4528 unsigned int ioaddr; 4528 unsigned int ioaddr;
4529 4529
4530 tty = portp->tty; 4530 tty = portp->port.tty;
4531 ioaddr = portp->ioaddr; 4531 ioaddr = portp->ioaddr;
4532 4532
4533 if (status & SR_RXPARITY) 4533 if (status & SR_RXPARITY)
@@ -4544,7 +4544,7 @@ static void stl_sc26198rxbadch(struct stlport *portp, unsigned char status, char
4544 if (portp->rxmarkmsk & status) { 4544 if (portp->rxmarkmsk & status) {
4545 if (status & SR_RXBREAK) { 4545 if (status & SR_RXBREAK) {
4546 status = TTY_BREAK; 4546 status = TTY_BREAK;
4547 if (portp->flags & ASYNC_SAK) { 4547 if (portp->port.flags & ASYNC_SAK) {
4548 do_SAK(tty); 4548 do_SAK(tty);
4549 BRDENABLE(portp->brdnr, portp->pagenr); 4549 BRDENABLE(portp->brdnr, portp->pagenr);
4550 } 4550 }