aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/mxser_new.c143
1 files changed, 16 insertions, 127 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 285104d379cb..a3328bb147b9 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -346,8 +346,6 @@ static int CheckIsMoxaMust(int io)
346 return MOXA_OTHER_UART; 346 return MOXA_OTHER_UART;
347} 347}
348 348
349/* above is modified by Victor Yu. 08-15-2002 */
350
351static void process_txrx_fifo(struct mxser_port *info) 349static void process_txrx_fifo(struct mxser_port *info)
352{ 350{
353 int i; 351 int i;
@@ -581,12 +579,10 @@ static int mxser_change_speed(struct mxser_port *info,
581 fcr = 0; 579 fcr = 0;
582 } else { 580 } else {
583 fcr = UART_FCR_ENABLE_FIFO; 581 fcr = UART_FCR_ENABLE_FIFO;
584 /* following add by Victor Yu. 08-30-2002 */
585 if (info->board->chip_flag) { 582 if (info->board->chip_flag) {
586 fcr |= MOXA_MUST_FCR_GDA_MODE_ENABLE; 583 fcr |= MOXA_MUST_FCR_GDA_MODE_ENABLE;
587 SET_MOXA_MUST_FIFO_VALUE(info); 584 SET_MOXA_MUST_FIFO_VALUE(info);
588 } else { 585 } else {
589 /* above add by Victor Yu. 08-30-2002 */
590 switch (info->rx_trigger) { 586 switch (info->rx_trigger) {
591 case 1: 587 case 1:
592 fcr |= UART_FCR_TRIGGER_1; 588 fcr |= UART_FCR_TRIGGER_1;
@@ -612,19 +608,8 @@ static int mxser_change_speed(struct mxser_port *info,
612 info->IER |= UART_IER_MSI; 608 info->IER |= UART_IER_MSI;
613 if ((info->type == PORT_16550A) || (info->board->chip_flag)) { 609 if ((info->type == PORT_16550A) || (info->board->chip_flag)) {
614 info->MCR |= UART_MCR_AFE; 610 info->MCR |= UART_MCR_AFE;
615/* status = mxser_get_msr(info->ioaddr, 0, info->port); */
616/*
617 save_flags(flags);
618 cli();
619 status = inb(baseaddr + UART_MSR);
620 restore_flags(flags);
621*/
622 /* mxser_check_modem_status(info, status); */
623 } else { 611 } else {
624/* status = mxser_get_msr(info->ioaddr, 0, info->port); */
625 /* MX_LOCK(&info->slock); */
626 status = inb(info->ioaddr + UART_MSR); 612 status = inb(info->ioaddr + UART_MSR);
627 /* MX_UNLOCK(&info->slock); */
628 if (info->tty->hw_stopped) { 613 if (info->tty->hw_stopped) {
629 if (status & UART_MSR_CTS) { 614 if (status & UART_MSR_CTS) {
630 info->tty->hw_stopped = 0; 615 info->tty->hw_stopped = 0;
@@ -692,7 +677,6 @@ static int mxser_change_speed(struct mxser_port *info,
692 UART_LSR_FE; 677 UART_LSR_FE;
693 } 678 }
694 } 679 }
695 /* following add by Victor Yu. 09-02-2002 */
696 if (info->board->chip_flag) { 680 if (info->board->chip_flag) {
697 spin_lock_irqsave(&info->slock, flags); 681 spin_lock_irqsave(&info->slock, flags);
698 SET_MOXA_MUST_XON1_VALUE(info->ioaddr, START_CHAR(info->tty)); 682 SET_MOXA_MUST_XON1_VALUE(info->ioaddr, START_CHAR(info->tty));
@@ -707,18 +691,8 @@ static int mxser_change_speed(struct mxser_port *info,
707 } else { 691 } else {
708 DISABLE_MOXA_MUST_TX_SOFTWARE_FLOW_CONTROL(info->ioaddr); 692 DISABLE_MOXA_MUST_TX_SOFTWARE_FLOW_CONTROL(info->ioaddr);
709 } 693 }
710 /*
711 if ( I_IXANY(info->tty) ) {
712 info->MCR |= MOXA_MUST_MCR_XON_ANY;
713 ENABLE_MOXA_MUST_XON_ANY_FLOW_CONTROL(info->ioaddr);
714 } else {
715 info->MCR &= ~MOXA_MUST_MCR_XON_ANY;
716 DISABLE_MOXA_MUST_XON_ANY_FLOW_CONTROL(info->ioaddr);
717 }
718 */
719 spin_unlock_irqrestore(&info->slock, flags); 694 spin_unlock_irqrestore(&info->slock, flags);
720 } 695 }
721 /* above add by Victor Yu. 09-02-2002 */
722 696
723 697
724 outb(fcr, info->ioaddr + UART_FCR); /* set fcr */ 698 outb(fcr, info->ioaddr + UART_FCR); /* set fcr */
@@ -852,12 +826,9 @@ static int mxser_startup(struct mxser_port *info)
852 * Finally, enable interrupts 826 * Finally, enable interrupts
853 */ 827 */
854 info->IER = UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI; 828 info->IER = UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI;
855 /* info->IER = UART_IER_RLSI | UART_IER_RDI; */
856 829
857 /* following add by Victor Yu. 08-30-2002 */
858 if (info->board->chip_flag) 830 if (info->board->chip_flag)
859 info->IER |= MOXA_MUST_IER_EGDAI; 831 info->IER |= MOXA_MUST_IER_EGDAI;
860 /* above add by Victor Yu. 08-30-2002 */
861 outb(info->IER, info->ioaddr + UART_IER); /* enable interrupts */ 832 outb(info->IER, info->ioaddr + UART_IER); /* enable interrupts */
862 833
863 /* 834 /*
@@ -917,13 +888,11 @@ static void mxser_shutdown(struct mxser_port *info)
917 outb(info->MCR, info->ioaddr + UART_MCR); 888 outb(info->MCR, info->ioaddr + UART_MCR);
918 889
919 /* clear Rx/Tx FIFO's */ 890 /* clear Rx/Tx FIFO's */
920 /* following add by Victor Yu. 08-30-2002 */
921 if (info->board->chip_flag) 891 if (info->board->chip_flag)
922 outb(UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | 892 outb(UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT |
923 MOXA_MUST_FCR_GDA_MODE_ENABLE, 893 MOXA_MUST_FCR_GDA_MODE_ENABLE,
924 info->ioaddr + UART_FCR); 894 info->ioaddr + UART_FCR);
925 else 895 else
926 /* above add by Victor Yu. 08-30-2002 */
927 outb(UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, 896 outb(UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT,
928 info->ioaddr + UART_FCR); 897 info->ioaddr + UART_FCR);
929 898
@@ -935,10 +904,8 @@ static void mxser_shutdown(struct mxser_port *info)
935 904
936 info->flags &= ~ASYNC_INITIALIZED; 905 info->flags &= ~ASYNC_INITIALIZED;
937 906
938 /* following add by Victor Yu. 09-23-2002 */
939 if (info->board->chip_flag) 907 if (info->board->chip_flag)
940 SET_MOXA_MUST_NO_SOFTWARE_FLOW_CONTROL(info->ioaddr); 908 SET_MOXA_MUST_NO_SOFTWARE_FLOW_CONTROL(info->ioaddr);
941 /* above add by Victor Yu. 09-23-2002 */
942 909
943 spin_unlock_irqrestore(&info->slock, flags); 910 spin_unlock_irqrestore(&info->slock, flags);
944} 911}
@@ -991,12 +958,7 @@ static int mxser_open(struct tty_struct *tty, struct file *filp)
991 info->session = process_session(current); 958 info->session = process_session(current);
992 info->pgrp = process_group(current); 959 info->pgrp = process_group(current);
993 960
994 /* 961 /* unmark here for very high baud rate (ex. 921600 bps) used */
995 status = mxser_get_msr(info->base, 0, info->port);
996 mxser_check_modem_status(info, status);
997 */
998
999/* unmark here for very high baud rate (ex. 921600 bps) used */
1000 tty->low_latency = 1; 962 tty->low_latency = 1;
1001 return 0; 963 return 0;
1002} 964}
@@ -1070,9 +1032,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
1070 info->IER &= ~UART_IER_RLSI; 1032 info->IER &= ~UART_IER_RLSI;
1071 if (info->board->chip_flag) 1033 if (info->board->chip_flag)
1072 info->IER &= ~MOXA_MUST_RECV_ISR; 1034 info->IER &= ~MOXA_MUST_RECV_ISR;
1073/* by William 1035
1074 info->read_status_mask &= ~UART_LSR_DR;
1075*/
1076 if (info->flags & ASYNC_INITIALIZED) { 1036 if (info->flags & ASYNC_INITIALIZED) {
1077 outb(info->IER, info->ioaddr + UART_IER); 1037 outb(info->IER, info->ioaddr + UART_IER);
1078 /* 1038 /*
@@ -1135,8 +1095,7 @@ static int mxser_write(struct tty_struct *tty, const unsigned char *buf, int cou
1135 total += c; 1095 total += c;
1136 } 1096 }
1137 1097
1138 if (info->xmit_cnt && !tty->stopped 1098 if (info->xmit_cnt && !tty->stopped) {
1139 /*&& !(info->IER & UART_IER_THRI)*/) {
1140 if (!tty->hw_stopped || 1099 if (!tty->hw_stopped ||
1141 (info->type == PORT_16550A) || 1100 (info->type == PORT_16550A) ||
1142 (info->board->chip_flag)) { 1101 (info->board->chip_flag)) {
@@ -1167,7 +1126,7 @@ static void mxser_put_char(struct tty_struct *tty, unsigned char ch)
1167 info->xmit_head &= SERIAL_XMIT_SIZE - 1; 1126 info->xmit_head &= SERIAL_XMIT_SIZE - 1;
1168 info->xmit_cnt++; 1127 info->xmit_cnt++;
1169 spin_unlock_irqrestore(&info->slock, flags); 1128 spin_unlock_irqrestore(&info->slock, flags);
1170 if (!tty->stopped /*&& !(info->IER & UART_IER_THRI)*/) { 1129 if (!tty->stopped) {
1171 if (!tty->hw_stopped || 1130 if (!tty->hw_stopped ||
1172 (info->type == PORT_16550A) || 1131 (info->type == PORT_16550A) ||
1173 info->board->chip_flag) { 1132 info->board->chip_flag) {
@@ -1231,14 +1190,12 @@ static void mxser_flush_buffer(struct tty_struct *tty)
1231 spin_lock_irqsave(&info->slock, flags); 1190 spin_lock_irqsave(&info->slock, flags);
1232 info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; 1191 info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
1233 1192
1234 /* below added by shinhay */
1235 fcr = inb(info->ioaddr + UART_FCR); 1193 fcr = inb(info->ioaddr + UART_FCR);
1236 outb((fcr | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT), 1194 outb((fcr | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT),
1237 info->ioaddr + UART_FCR); 1195 info->ioaddr + UART_FCR);
1238 outb(fcr, info->ioaddr + UART_FCR); 1196 outb(fcr, info->ioaddr + UART_FCR);
1239 1197
1240 spin_unlock_irqrestore(&info->slock, flags); 1198 spin_unlock_irqrestore(&info->slock, flags);
1241 /* above added by shinhay */
1242 1199
1243 tty_wakeup(tty); 1200 tty_wakeup(tty);
1244} 1201}
@@ -1309,10 +1266,9 @@ static int mxser_set_serial_info(struct mxser_port *info,
1309 info->closing_wait = new_serial.closing_wait * HZ / 100; 1266 info->closing_wait = new_serial.closing_wait * HZ / 100;
1310 info->tty->low_latency = 1267 info->tty->low_latency =
1311 (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; 1268 (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
1312 info->tty->low_latency = 0; /* (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; */ 1269 info->tty->low_latency = 0;
1313 } 1270 }
1314 1271
1315 /* added by casper, 3/17/2000, for mouse */
1316 info->type = new_serial.type; 1272 info->type = new_serial.type;
1317 1273
1318 process_txrx_fifo(info); 1274 process_txrx_fifo(info);
@@ -1430,7 +1386,6 @@ static int mxser_tiocmset(struct tty_struct *tty, struct file *file,
1430static int mxser_program_mode(int port) 1386static int mxser_program_mode(int port)
1431{ 1387{
1432 int id, i, j, n; 1388 int id, i, j, n;
1433 /* unsigned long flags; */
1434 1389
1435 spin_lock(&gm_lock); 1390 spin_lock(&gm_lock);
1436 outb(0, port); 1391 outb(0, port);
@@ -1440,7 +1395,6 @@ static int mxser_program_mode(int port)
1440 (void)inb(port); 1395 (void)inb(port);
1441 outb(0, port); 1396 outb(0, port);
1442 (void)inb(port); 1397 (void)inb(port);
1443 /* restore_flags(flags); */
1444 spin_unlock(&gm_lock); 1398 spin_unlock(&gm_lock);
1445 1399
1446 id = inb(port + 1) & 0x1F; 1400 id = inb(port + 1) & 0x1F;
@@ -1623,7 +1577,6 @@ static int mxser_ioctl_special(unsigned int cmd, void __user *argp)
1623 continue; 1577 continue;
1624 1578
1625 status = mxser_get_msr(port->ioaddr, 0, i); 1579 status = mxser_get_msr(port->ioaddr, 0, i);
1626/* mxser_check_modem_status(port, status); */
1627 1580
1628 if (status & UART_MSR_TERI) 1581 if (status & UART_MSR_TERI)
1629 port->icount.rng++; 1582 port->icount.rng++;
@@ -1707,7 +1660,6 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
1707 if (tty->index == MXSER_PORTS) 1660 if (tty->index == MXSER_PORTS)
1708 return mxser_ioctl_special(cmd, argp); 1661 return mxser_ioctl_special(cmd, argp);
1709 1662
1710 /* following add by Victor Yu. 01-05-2004 */
1711 if (cmd == MOXA_SET_OP_MODE || cmd == MOXA_GET_OP_MODE) { 1663 if (cmd == MOXA_SET_OP_MODE || cmd == MOXA_GET_OP_MODE) {
1712 int p; 1664 int p;
1713 unsigned long opmode; 1665 unsigned long opmode;
@@ -1739,7 +1691,6 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
1739 } 1691 }
1740 return 0; 1692 return 0;
1741 } 1693 }
1742 /* above add by Victor Yu. 01-05-2004 */
1743 1694
1744 if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT && cmd != TIOCGICOUNT && 1695 if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT && cmd != TIOCGICOUNT &&
1745 test_bit(TTY_IO_ERROR, &tty->flags)) 1696 test_bit(TTY_IO_ERROR, &tty->flags))
@@ -1829,7 +1780,6 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
1829 cnow = info->icount; 1780 cnow = info->icount;
1830 spin_unlock_irqrestore(&info->slock, flags); 1781 spin_unlock_irqrestore(&info->slock, flags);
1831 p_cuser = argp; 1782 p_cuser = argp;
1832 /* modified by casper 1/11/2000 */
1833 if (put_user(cnow.frame, &p_cuser->frame)) 1783 if (put_user(cnow.frame, &p_cuser->frame))
1834 return -EFAULT; 1784 return -EFAULT;
1835 if (put_user(cnow.brk, &p_cuser->brk)) 1785 if (put_user(cnow.brk, &p_cuser->brk))
@@ -1855,7 +1805,6 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
1855 info->mon_data.rxcnt = 0; 1805 info->mon_data.rxcnt = 0;
1856 info->mon_data.txcnt = 0; 1806 info->mon_data.txcnt = 0;
1857 return 0; 1807 return 0;
1858/* (above) added by James. */
1859 case MOXA_ASPP_SETBAUD:{ 1808 case MOXA_ASPP_SETBAUD:{
1860 long baud; 1809 long baud;
1861 if (get_user(baud, (long __user *)argp)) 1810 if (get_user(baud, (long __user *)argp))
@@ -1886,8 +1835,6 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
1886 case MOXA_ASPP_MON: { 1835 case MOXA_ASPP_MON: {
1887 int mcr, status; 1836 int mcr, status;
1888 1837
1889 /* info->mon_data.ser_param = tty->termios->c_cflag; */
1890
1891 status = mxser_get_msr(info->ioaddr, 1, tty->index); 1838 status = mxser_get_msr(info->ioaddr, 1, tty->index);
1892 mxser_check_modem_status(info, status); 1839 mxser_check_modem_status(info, status);
1893 1840
@@ -1944,7 +1891,6 @@ static void mxser_stoprx(struct tty_struct *tty)
1944 1891
1945 info->ldisc_stop_rx = 1; 1892 info->ldisc_stop_rx = 1;
1946 if (I_IXOFF(tty)) { 1893 if (I_IXOFF(tty)) {
1947 /* following add by Victor Yu. 09-02-2002 */
1948 if (info->board->chip_flag) { 1894 if (info->board->chip_flag) {
1949 info->IER &= ~MOXA_MUST_RECV_ISR; 1895 info->IER &= ~MOXA_MUST_RECV_ISR;
1950 outb(info->IER, info->ioaddr + UART_IER); 1896 outb(info->IER, info->ioaddr + UART_IER);
@@ -1981,7 +1927,6 @@ static void mxser_unthrottle(struct tty_struct *tty)
1981 if (info->x_char) 1927 if (info->x_char)
1982 info->x_char = 0; 1928 info->x_char = 0;
1983 else { 1929 else {
1984 /* following add by Victor Yu. 09-02-2002 */
1985 if (info->board->chip_flag) { 1930 if (info->board->chip_flag) {
1986 info->IER |= MOXA_MUST_RECV_ISR; 1931 info->IER |= MOXA_MUST_RECV_ISR;
1987 outb(info->IER, info->ioaddr + UART_IER); 1932 outb(info->IER, info->ioaddr + UART_IER);
@@ -2025,8 +1970,7 @@ static void mxser_start(struct tty_struct *tty)
2025 unsigned long flags; 1970 unsigned long flags;
2026 1971
2027 spin_lock_irqsave(&info->slock, flags); 1972 spin_lock_irqsave(&info->slock, flags);
2028 if (info->xmit_cnt && info->xmit_buf 1973 if (info->xmit_cnt && info->xmit_buf) {
2029 /* && !(info->IER & UART_IER_THRI) */) {
2030 outb(info->IER & ~UART_IER_THRI, info->ioaddr + UART_IER); 1974 outb(info->IER & ~UART_IER_THRI, info->ioaddr + UART_IER);
2031 info->IER |= UART_IER_THRI; 1975 info->IER |= UART_IER_THRI;
2032 outb(info->IER, info->ioaddr + UART_IER); 1976 outb(info->IER, info->ioaddr + UART_IER);
@@ -2051,18 +1995,16 @@ static void mxser_set_termios(struct tty_struct *tty, struct termios *old_termio
2051 } 1995 }
2052 } 1996 }
2053 1997
2054/* Handle sw stopped */ 1998 /* Handle sw stopped */
2055 if ((old_termios->c_iflag & IXON) && 1999 if ((old_termios->c_iflag & IXON) &&
2056 !(tty->termios->c_iflag & IXON)) { 2000 !(tty->termios->c_iflag & IXON)) {
2057 tty->stopped = 0; 2001 tty->stopped = 0;
2058 2002
2059 /* following add by Victor Yu. 09-02-2002 */
2060 if (info->board->chip_flag) { 2003 if (info->board->chip_flag) {
2061 spin_lock_irqsave(&info->slock, flags); 2004 spin_lock_irqsave(&info->slock, flags);
2062 DISABLE_MOXA_MUST_RX_SOFTWARE_FLOW_CONTROL(info->ioaddr); 2005 DISABLE_MOXA_MUST_RX_SOFTWARE_FLOW_CONTROL(info->ioaddr);
2063 spin_unlock_irqrestore(&info->slock, flags); 2006 spin_unlock_irqrestore(&info->slock, flags);
2064 } 2007 }
2065 /* above add by Victor Yu. 09-02-2002 */
2066 2008
2067 mxser_start(tty); 2009 mxser_start(tty);
2068 } 2010 }
@@ -2131,7 +2073,6 @@ static void mxser_wait_until_sent(struct tty_struct *tty, int timeout)
2131#endif 2073#endif
2132} 2074}
2133 2075
2134
2135/* 2076/*
2136 * This routine is called by tty_hangup() when a hangup is signaled. 2077 * This routine is called by tty_hangup() when a hangup is signaled.
2137 */ 2078 */
@@ -2148,8 +2089,6 @@ void mxser_hangup(struct tty_struct *tty)
2148 wake_up_interruptible(&info->open_wait); 2089 wake_up_interruptible(&info->open_wait);
2149} 2090}
2150 2091
2151
2152/* added by James 03-12-2004. */
2153/* 2092/*
2154 * mxser_rs_break() --- routine which turns the break handling on or off 2093 * mxser_rs_break() --- routine which turns the break handling on or off
2155 */ 2094 */
@@ -2168,8 +2107,6 @@ static void mxser_rs_break(struct tty_struct *tty, int break_state)
2168 spin_unlock_irqrestore(&info->slock, flags); 2107 spin_unlock_irqrestore(&info->slock, flags);
2169} 2108}
2170 2109
2171/* (above) added by James. */
2172
2173static void mxser_receive_chars(struct mxser_port *port, int *status) 2110static void mxser_receive_chars(struct mxser_port *port, int *status)
2174{ 2111{
2175 struct tty_struct *tty = port->tty; 2112 struct tty_struct *tty = port->tty;
@@ -2183,36 +2120,26 @@ static void mxser_receive_chars(struct mxser_port *port, int *status)
2183 spin_lock_irqsave(&port->slock, flags); 2120 spin_lock_irqsave(&port->slock, flags);
2184 2121
2185 recv_room = tty->receive_room; 2122 recv_room = tty->receive_room;
2186 if ((recv_room == 0) && (!port->ldisc_stop_rx)) { 2123 if ((recv_room == 0) && (!port->ldisc_stop_rx))
2187 /* mxser_throttle(tty); */
2188 mxser_stoprx(tty); 2124 mxser_stoprx(tty);
2189 /* return; */
2190 }
2191 2125
2192 /* following add by Victor Yu. 09-02-2002 */
2193 if (port->board->chip_flag != MOXA_OTHER_UART) { 2126 if (port->board->chip_flag != MOXA_OTHER_UART) {
2194 2127
2195 if (*status & UART_LSR_SPECIAL) 2128 if (*status & UART_LSR_SPECIAL)
2196 goto intr_old; 2129 goto intr_old;
2197 /* following add by Victor Yu. 02-11-2004 */
2198 if (port->board->chip_flag == MOXA_MUST_MU860_HWID && 2130 if (port->board->chip_flag == MOXA_MUST_MU860_HWID &&
2199 (*status & MOXA_MUST_LSR_RERR)) 2131 (*status & MOXA_MUST_LSR_RERR))
2200 goto intr_old; 2132 goto intr_old;
2201 /* above add by Victor Yu. 02-14-2004 */
2202 if (*status & MOXA_MUST_LSR_RERR) 2133 if (*status & MOXA_MUST_LSR_RERR)
2203 goto intr_old; 2134 goto intr_old;
2204 2135
2205 gdl = inb(port->ioaddr + MOXA_MUST_GDL_REGISTER); 2136 gdl = inb(port->ioaddr + MOXA_MUST_GDL_REGISTER);
2206 2137
2207 /* add by Victor Yu. 02-11-2004 */
2208 if (port->board->chip_flag == MOXA_MUST_MU150_HWID) 2138 if (port->board->chip_flag == MOXA_MUST_MU150_HWID)
2209 gdl &= MOXA_MUST_GDL_MASK; 2139 gdl &= MOXA_MUST_GDL_MASK;
2210 if (gdl >= recv_room) { 2140 if (gdl >= recv_room) {
2211 if (!port->ldisc_stop_rx) { 2141 if (!port->ldisc_stop_rx)
2212 /* mxser_throttle(tty); */
2213 mxser_stoprx(tty); 2142 mxser_stoprx(tty);
2214 }
2215 /* return; */
2216 } 2143 }
2217 while (gdl--) { 2144 while (gdl--) {
2218 ch = inb(port->ioaddr + UART_RX); 2145 ch = inb(port->ioaddr + UART_RX);
@@ -2221,20 +2148,16 @@ static void mxser_receive_chars(struct mxser_port *port, int *status)
2221 } 2148 }
2222 goto end_intr; 2149 goto end_intr;
2223 } 2150 }
2224 intr_old: 2151intr_old:
2225 /* above add by Victor Yu. 09-02-2002 */
2226 2152
2227 do { 2153 do {
2228 if (max-- < 0) 2154 if (max-- < 0)
2229 break; 2155 break;
2230 2156
2231 ch = inb(port->ioaddr + UART_RX); 2157 ch = inb(port->ioaddr + UART_RX);
2232 /* following add by Victor Yu. 09-02-2002 */ 2158 if (port->board->chip_flag && (*status & UART_LSR_OE))
2233 if (port->board->chip_flag && (*status & UART_LSR_OE)
2234 /*&& !(*status&UART_LSR_DR) */)
2235 outb(0x23, port->ioaddr + UART_FCR); 2159 outb(0x23, port->ioaddr + UART_FCR);
2236 *status &= port->read_status_mask; 2160 *status &= port->read_status_mask;
2237 /* above add by Victor Yu. 09-02-2002 */
2238 if (*status & port->ignore_status_mask) { 2161 if (*status & port->ignore_status_mask) {
2239 if (++ignored > 100) 2162 if (++ignored > 100)
2240 break; 2163 break;
@@ -2243,50 +2166,38 @@ static void mxser_receive_chars(struct mxser_port *port, int *status)
2243 if (*status & UART_LSR_SPECIAL) { 2166 if (*status & UART_LSR_SPECIAL) {
2244 if (*status & UART_LSR_BI) { 2167 if (*status & UART_LSR_BI) {
2245 flag = TTY_BREAK; 2168 flag = TTY_BREAK;
2246/* added by casper 1/11/2000 */
2247 port->icount.brk++; 2169 port->icount.brk++;
2248 2170
2249 if (port->flags & ASYNC_SAK) 2171 if (port->flags & ASYNC_SAK)
2250 do_SAK(tty); 2172 do_SAK(tty);
2251 } else if (*status & UART_LSR_PE) { 2173 } else if (*status & UART_LSR_PE) {
2252 flag = TTY_PARITY; 2174 flag = TTY_PARITY;
2253/* added by casper 1/11/2000 */
2254 port->icount.parity++; 2175 port->icount.parity++;
2255 } else if (*status & UART_LSR_FE) { 2176 } else if (*status & UART_LSR_FE) {
2256 flag = TTY_FRAME; 2177 flag = TTY_FRAME;
2257/* added by casper 1/11/2000 */
2258 port->icount.frame++; 2178 port->icount.frame++;
2259 } else if (*status & UART_LSR_OE) { 2179 } else if (*status & UART_LSR_OE) {
2260 flag = TTY_OVERRUN; 2180 flag = TTY_OVERRUN;
2261/* added by casper 1/11/2000 */
2262 port->icount.overrun++; 2181 port->icount.overrun++;
2263 } 2182 }
2264 } 2183 }
2265 tty_insert_flip_char(tty, ch, flag); 2184 tty_insert_flip_char(tty, ch, flag);
2266 cnt++; 2185 cnt++;
2267 if (cnt >= recv_room) { 2186 if (cnt >= recv_room) {
2268 if (!port->ldisc_stop_rx) { 2187 if (!port->ldisc_stop_rx)
2269 /* mxser_throttle(tty); */
2270 mxser_stoprx(tty); 2188 mxser_stoprx(tty);
2271 }
2272 break; 2189 break;
2273 } 2190 }
2274 2191
2275 } 2192 }
2276 2193
2277 /* following add by Victor Yu. 09-02-2002 */
2278 if (port->board->chip_flag) 2194 if (port->board->chip_flag)
2279 break; 2195 break;
2280 2196
2281 /* mask by Victor Yu. 09-02-2002
2282 *status = inb(port->ioaddr + UART_LSR) & port->read_status_mask;
2283 */
2284 /* following add by Victor Yu. 09-02-2002 */
2285 *status = inb(port->ioaddr + UART_LSR); 2197 *status = inb(port->ioaddr + UART_LSR);
2286 /* above add by Victor Yu. 09-02-2002 */
2287 } while (*status & UART_LSR_DR); 2198 } while (*status & UART_LSR_DR);
2288 2199
2289end_intr: /* add by Victor Yu. 09-02-2002 */ 2200end_intr:
2290 mxvar_log.rxcnt[port->tty->index] += cnt; 2201 mxvar_log.rxcnt[port->tty->index] += cnt;
2291 port->mon_data.rxcnt += cnt; 2202 port->mon_data.rxcnt += cnt;
2292 port->mon_data.up_rxcnt += cnt; 2203 port->mon_data.up_rxcnt += cnt;
@@ -2308,8 +2219,6 @@ static void mxser_transmit_chars(struct mxser_port *port)
2308 mxvar_log.txcnt[port->tty->index]++; 2219 mxvar_log.txcnt[port->tty->index]++;
2309 port->mon_data.txcnt++; 2220 port->mon_data.txcnt++;
2310 port->mon_data.up_txcnt++; 2221 port->mon_data.up_txcnt++;
2311
2312/* added by casper 1/11/2000 */
2313 port->icount.tx++; 2222 port->icount.tx++;
2314 goto unlock; 2223 goto unlock;
2315 } 2224 }
@@ -2337,11 +2246,8 @@ static void mxser_transmit_chars(struct mxser_port *port)
2337 } while (--count > 0); 2246 } while (--count > 0);
2338 mxvar_log.txcnt[port->tty->index] += (cnt - port->xmit_cnt); 2247 mxvar_log.txcnt[port->tty->index] += (cnt - port->xmit_cnt);
2339 2248
2340/* added by James 03-12-2004. */
2341 port->mon_data.txcnt += (cnt - port->xmit_cnt); 2249 port->mon_data.txcnt += (cnt - port->xmit_cnt);
2342 port->mon_data.up_txcnt += (cnt - port->xmit_cnt); 2250 port->mon_data.up_txcnt += (cnt - port->xmit_cnt);
2343
2344/* added by casper 1/11/2000 */
2345 port->icount.tx += (cnt - port->xmit_cnt); 2251 port->icount.tx += (cnt - port->xmit_cnt);
2346 2252
2347 if (port->xmit_cnt < WAKEUP_CHARS) { 2253 if (port->xmit_cnt < WAKEUP_CHARS) {
@@ -2369,8 +2275,6 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2369 unsigned int int_cnt; 2275 unsigned int int_cnt;
2370 int handled = IRQ_NONE; 2276 int handled = IRQ_NONE;
2371 2277
2372 /* spin_lock(&gm_lock); */
2373
2374 for (i = 0; i < MXSER_BOARDS; i++) 2278 for (i = 0; i < MXSER_BOARDS; i++)
2375 if (dev_id == &mxser_boards[i]) { 2279 if (dev_id == &mxser_boards[i]) {
2376 brd = dev_id; 2280 brd = dev_id;
@@ -2397,7 +2301,6 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2397 2301
2398 int_cnt = 0; 2302 int_cnt = 0;
2399 do { 2303 do {
2400 /* following add by Victor Yu. 09-13-2002 */
2401 iir = inb(port->ioaddr + UART_IIR); 2304 iir = inb(port->ioaddr + UART_IIR);
2402 if (iir & UART_IIR_NO_INT) 2305 if (iir & UART_IIR_NO_INT)
2403 break; 2306 break;
@@ -2408,9 +2311,7 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2408 inb(port->ioaddr + UART_MSR); 2311 inb(port->ioaddr + UART_MSR);
2409 break; 2312 break;
2410 } 2313 }
2411 /* above add by Victor Yu. 09-13-2002 */
2412 2314
2413 /* following add by Victor Yu. 09-02-2002 */
2414 status = inb(port->ioaddr + UART_LSR); 2315 status = inb(port->ioaddr + UART_LSR);
2415 2316
2416 if (status & UART_LSR_PE) 2317 if (status & UART_LSR_PE)
@@ -2424,12 +2325,6 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2424 port->err_shadow |= NPPI_NOTIFY_BREAK; 2325 port->err_shadow |= NPPI_NOTIFY_BREAK;
2425 2326
2426 if (port->board->chip_flag) { 2327 if (port->board->chip_flag) {
2427 /*
2428 if ( (status & 0x02) && !(status & 0x01) ) {
2429 outb(port->ioaddr+UART_FCR, 0x23);
2430 continue;
2431 }
2432 */
2433 if (iir == MOXA_MUST_IIR_GDA || 2328 if (iir == MOXA_MUST_IIR_GDA ||
2434 iir == MOXA_MUST_IIR_RDA || 2329 iir == MOXA_MUST_IIR_RDA ||
2435 iir == MOXA_MUST_IIR_RTO || 2330 iir == MOXA_MUST_IIR_RTO ||
@@ -2438,8 +2333,6 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2438 &status); 2333 &status);
2439 2334
2440 } else { 2335 } else {
2441 /* above add by Victor Yu. 09-02-2002 */
2442
2443 status &= port->read_status_mask; 2336 status &= port->read_status_mask;
2444 if (status & UART_LSR_DR) 2337 if (status & UART_LSR_DR)
2445 mxser_receive_chars(port, 2338 mxser_receive_chars(port,
@@ -2449,14 +2342,11 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2449 if (msr & UART_MSR_ANY_DELTA) 2342 if (msr & UART_MSR_ANY_DELTA)
2450 mxser_check_modem_status(port, msr); 2343 mxser_check_modem_status(port, msr);
2451 2344
2452 /* following add by Victor Yu. 09-13-2002 */
2453 if (port->board->chip_flag) { 2345 if (port->board->chip_flag) {
2454 if (iir == 0x02 && (status & 2346 if (iir == 0x02 && (status &
2455 UART_LSR_THRE)) 2347 UART_LSR_THRE))
2456 mxser_transmit_chars(port); 2348 mxser_transmit_chars(port);
2457 } else { 2349 } else {
2458 /* above add by Victor Yu. 09-13-2002 */
2459
2460 if (status & UART_LSR_THRE) 2350 if (status & UART_LSR_THRE)
2461 mxser_transmit_chars(port); 2351 mxser_transmit_chars(port);
2462 } 2352 }
@@ -2466,8 +2356,7 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
2466 break; /* Prevent infinite loops */ 2356 break; /* Prevent infinite loops */
2467 } 2357 }
2468 2358
2469 irq_stop: 2359irq_stop:
2470 /* spin_unlock(&gm_lock); */
2471 return handled; 2360 return handled;
2472} 2361}
2473 2362
@@ -2639,10 +2528,10 @@ static int __init mxser_get_ISA_conf(int cap, struct mxser_board *brd)
2639 for (i = 7, bits = 0x0100; i >= 0; i--, bits <<= 1) { 2528 for (i = 7, bits = 0x0100; i >= 0; i--, bits <<= 1) {
2640 if (regs[12] & bits) { 2529 if (regs[12] & bits) {
2641 brd->ports[i].baud_base = 921600; 2530 brd->ports[i].baud_base = 921600;
2642 brd->ports[i].max_baud = 921600; /* add by Victor Yu. 09-04-2002 */ 2531 brd->ports[i].max_baud = 921600;
2643 } else { 2532 } else {
2644 brd->ports[i].baud_base = 115200; 2533 brd->ports[i].baud_base = 115200;
2645 brd->ports[i].max_baud = 115200; /* add by Victor Yu. 09-04-2002 */ 2534 brd->ports[i].max_baud = 115200;
2646 } 2535 }
2647 } 2536 }
2648 scratch2 = inb(cap + UART_LCR) & (~UART_LCR_DLAB); 2537 scratch2 = inb(cap + UART_LCR) & (~UART_LCR_DLAB);