aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/stallion.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/stallion.c')
-rw-r--r--drivers/char/stallion.c50
1 files changed, 15 insertions, 35 deletions
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index acef2abf3f0d..0e20780d4a29 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -2901,7 +2901,8 @@ static int stl_getportstats(stlport_t *portp, comstats_t __user *cp)
2901 if (portp->tty != (struct tty_struct *) NULL) { 2901 if (portp->tty != (struct tty_struct *) NULL) {
2902 if (portp->tty->driver_data == portp) { 2902 if (portp->tty->driver_data == portp) {
2903 portp->stats.ttystate = portp->tty->flags; 2903 portp->stats.ttystate = portp->tty->flags;
2904 portp->stats.rxbuffered = portp->tty->flip.count; 2904 /* No longer available as a statistic */
2905 portp->stats.rxbuffered = 1; /*portp->tty->flip.count; */
2905 if (portp->tty->termios != (struct termios *) NULL) { 2906 if (portp->tty->termios != (struct termios *) NULL) {
2906 portp->stats.cflags = portp->tty->termios->c_cflag; 2907 portp->stats.cflags = portp->tty->termios->c_cflag;
2907 portp->stats.iflags = portp->tty->termios->c_iflag; 2908 portp->stats.iflags = portp->tty->termios->c_iflag;
@@ -4045,9 +4046,7 @@ static void stl_cd1400rxisr(stlpanel_t *panelp, int ioaddr)
4045 if ((ioack & ACK_TYPMASK) == ACK_TYPRXGOOD) { 4046 if ((ioack & ACK_TYPMASK) == ACK_TYPRXGOOD) {
4046 outb((RDCR + portp->uartaddr), ioaddr); 4047 outb((RDCR + portp->uartaddr), ioaddr);
4047 len = inb(ioaddr + EREG_DATA); 4048 len = inb(ioaddr + EREG_DATA);
4048 if ((tty == (struct tty_struct *) NULL) || 4049 if (tty == NULL || (buflen = tty_buffer_request_room(tty, len)) == 0) {
4049 (tty->flip.char_buf_ptr == (char *) NULL) ||
4050 ((buflen = TTY_FLIPBUF_SIZE - tty->flip.count) == 0)) {
4051 len = MIN(len, sizeof(stl_unwanted)); 4050 len = MIN(len, sizeof(stl_unwanted));
4052 outb((RDSR + portp->uartaddr), ioaddr); 4051 outb((RDSR + portp->uartaddr), ioaddr);
4053 insb((ioaddr + EREG_DATA), &stl_unwanted[0], len); 4052 insb((ioaddr + EREG_DATA), &stl_unwanted[0], len);
@@ -4056,12 +4055,10 @@ static void stl_cd1400rxisr(stlpanel_t *panelp, int ioaddr)
4056 } else { 4055 } else {
4057 len = MIN(len, buflen); 4056 len = MIN(len, buflen);
4058 if (len > 0) { 4057 if (len > 0) {
4058 unsigned char *ptr;
4059 outb((RDSR + portp->uartaddr), ioaddr); 4059 outb((RDSR + portp->uartaddr), ioaddr);
4060 insb((ioaddr + EREG_DATA), tty->flip.char_buf_ptr, len); 4060 tty_prepare_flip_string(tty, &ptr, len);
4061 memset(tty->flip.flag_buf_ptr, 0, len); 4061 insb((ioaddr + EREG_DATA), ptr, len);
4062 tty->flip.flag_buf_ptr += len;
4063 tty->flip.char_buf_ptr += len;
4064 tty->flip.count += len;
4065 tty_schedule_flip(tty); 4062 tty_schedule_flip(tty);
4066 portp->stats.rxtotal += len; 4063 portp->stats.rxtotal += len;
4067 } 4064 }
@@ -4085,8 +4082,7 @@ static void stl_cd1400rxisr(stlpanel_t *panelp, int ioaddr)
4085 portp->stats.txxoff++; 4082 portp->stats.txxoff++;
4086 goto stl_rxalldone; 4083 goto stl_rxalldone;
4087 } 4084 }
4088 if ((tty != (struct tty_struct *) NULL) && 4085 if (tty != NULL && (portp->rxignoremsk & status) == 0) {
4089 ((portp->rxignoremsk & status) == 0)) {
4090 if (portp->rxmarkmsk & status) { 4086 if (portp->rxmarkmsk & status) {
4091 if (status & ST_BREAK) { 4087 if (status & ST_BREAK) {
4092 status = TTY_BREAK; 4088 status = TTY_BREAK;
@@ -4106,14 +4102,8 @@ static void stl_cd1400rxisr(stlpanel_t *panelp, int ioaddr)
4106 } else { 4102 } else {
4107 status = 0; 4103 status = 0;
4108 } 4104 }
4109 if (tty->flip.char_buf_ptr != (char *) NULL) { 4105 tty_insert_flip_char(tty, ch, status);
4110 if (tty->flip.count < TTY_FLIPBUF_SIZE) { 4106 tty_schedule_flip(tty);
4111 *tty->flip.flag_buf_ptr++ = status;
4112 *tty->flip.char_buf_ptr++ = ch;
4113 tty->flip.count++;
4114 }
4115 tty_schedule_flip(tty);
4116 }
4117 } 4107 }
4118 } else { 4108 } else {
4119 printk("STALLION: bad RX interrupt ack value=%x\n", ioack); 4109 printk("STALLION: bad RX interrupt ack value=%x\n", ioack);
@@ -5012,9 +5002,7 @@ static void stl_sc26198rxisr(stlport_t *portp, unsigned int iack)
5012 len = inb(ioaddr + XP_DATA) + 1; 5002 len = inb(ioaddr + XP_DATA) + 1;
5013 5003
5014 if ((iack & IVR_TYPEMASK) == IVR_RXDATA) { 5004 if ((iack & IVR_TYPEMASK) == IVR_RXDATA) {
5015 if ((tty == (struct tty_struct *) NULL) || 5005 if (tty == NULL || (buflen = tty_buffer_request_room(tty, len)) == 0) {
5016 (tty->flip.char_buf_ptr == (char *) NULL) ||
5017 ((buflen = TTY_FLIPBUF_SIZE - tty->flip.count) == 0)) {
5018 len = MIN(len, sizeof(stl_unwanted)); 5006 len = MIN(len, sizeof(stl_unwanted));
5019 outb(GRXFIFO, (ioaddr + XP_ADDR)); 5007 outb(GRXFIFO, (ioaddr + XP_ADDR));
5020 insb((ioaddr + XP_DATA), &stl_unwanted[0], len); 5008 insb((ioaddr + XP_DATA), &stl_unwanted[0], len);
@@ -5023,12 +5011,10 @@ static void stl_sc26198rxisr(stlport_t *portp, unsigned int iack)
5023 } else { 5011 } else {
5024 len = MIN(len, buflen); 5012 len = MIN(len, buflen);
5025 if (len > 0) { 5013 if (len > 0) {
5014 unsigned char *ptr;
5026 outb(GRXFIFO, (ioaddr + XP_ADDR)); 5015 outb(GRXFIFO, (ioaddr + XP_ADDR));
5027 insb((ioaddr + XP_DATA), tty->flip.char_buf_ptr, len); 5016 tty_prepare_flip_string(tty, &ptr, len);
5028 memset(tty->flip.flag_buf_ptr, 0, len); 5017 insb((ioaddr + XP_DATA), ptr, len);
5029 tty->flip.flag_buf_ptr += len;
5030 tty->flip.char_buf_ptr += len;
5031 tty->flip.count += len;
5032 tty_schedule_flip(tty); 5018 tty_schedule_flip(tty);
5033 portp->stats.rxtotal += len; 5019 portp->stats.rxtotal += len;
5034 } 5020 }
@@ -5096,14 +5082,8 @@ static inline void stl_sc26198rxbadch(stlport_t *portp, unsigned char status, ch
5096 status = 0; 5082 status = 0;
5097 } 5083 }
5098 5084
5099 if (tty->flip.char_buf_ptr != (char *) NULL) { 5085 tty_insert_flip_char(tty, ch, status);
5100 if (tty->flip.count < TTY_FLIPBUF_SIZE) { 5086 tty_schedule_flip(tty);
5101 *tty->flip.flag_buf_ptr++ = status;
5102 *tty->flip.char_buf_ptr++ = ch;
5103 tty->flip.count++;
5104 }
5105 tty_schedule_flip(tty);
5106 }
5107 5087
5108 if (status == 0) 5088 if (status == 0)
5109 portp->stats.rxtotal++; 5089 portp->stats.rxtotal++;