aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/isicom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/isicom.c')
-rw-r--r--drivers/char/isicom.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 1bbf507adda5..86033bed5d6c 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -115,6 +115,7 @@
115#include <linux/module.h> 115#include <linux/module.h>
116#include <linux/kernel.h> 116#include <linux/kernel.h>
117#include <linux/tty.h> 117#include <linux/tty.h>
118#include <linux/tty_flip.h>
118#include <linux/termios.h> 119#include <linux/termios.h>
119#include <linux/fs.h> 120#include <linux/fs.h>
120#include <linux/sched.h> 121#include <linux/sched.h>
@@ -773,6 +774,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
773 unsigned short base, header, word_count, count; 774 unsigned short base, header, word_count, count;
774 unsigned char channel; 775 unsigned char channel;
775 short byte_count; 776 short byte_count;
777 unsigned char *rp;
776 778
777 card = (struct isi_board *) dev_id; 779 card = (struct isi_board *) dev_id;
778 780
@@ -903,14 +905,10 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
903 break; 905 break;
904 906
905 case 1: /* Received Break !!! */ 907 case 1: /* Received Break !!! */
906 if (tty->flip.count >= TTY_FLIPBUF_SIZE) 908 tty_insert_flip_char(tty, 0, TTY_BREAK);
907 break;
908 *tty->flip.flag_buf_ptr++ = TTY_BREAK;
909 *tty->flip.char_buf_ptr++ = 0;
910 tty->flip.count++;
911 if (port->flags & ASYNC_SAK) 909 if (port->flags & ASYNC_SAK)
912 do_SAK(tty); 910 do_SAK(tty);
913 schedule_delayed_work(&tty->flip.work, 1); 911 tty_flip_buffer_push(tty);
914 break; 912 break;
915 913
916 case 2: /* Statistics */ 914 case 2: /* Statistics */
@@ -923,23 +921,19 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
923 } 921 }
924 } 922 }
925 else { /* Data Packet */ 923 else { /* Data Packet */
926 count = min_t(unsigned short, byte_count, (TTY_FLIPBUF_SIZE - tty->flip.count)); 924
925 count = tty_prepare_flip_string(tty, &rp, byte_count & ~1);
927#ifdef ISICOM_DEBUG 926#ifdef ISICOM_DEBUG
928 printk(KERN_DEBUG "ISICOM: Intr: Can rx %d of %d bytes.\n", 927 printk(KERN_DEBUG "ISICOM: Intr: Can rx %d of %d bytes.\n",
929 count, byte_count); 928 count, byte_count);
930#endif 929#endif
931 word_count = count >> 1; 930 word_count = count >> 1;
932 insw(base, tty->flip.char_buf_ptr, word_count); 931 insw(base, rp, word_count);
933 tty->flip.char_buf_ptr += (word_count << 1);
934 byte_count -= (word_count << 1); 932 byte_count -= (word_count << 1);
935 if (count & 0x0001) { 933 if (count & 0x0001) {
936 *tty->flip.char_buf_ptr++ = (char)(inw(base) & 0xff); 934 tty_insert_flip_char(tty, inw(base) & 0xff, TTY_NORMAL);
937 byte_count -= 2; 935 byte_count -= 2;
938 } 936 }
939 memset(tty->flip.flag_buf_ptr, 0, count);
940 tty->flip.flag_buf_ptr += count;
941 tty->flip.count += count;
942
943 if (byte_count > 0) { 937 if (byte_count > 0) {
944 printk(KERN_DEBUG "ISICOM: Intr(0x%x:%d): Flip buffer overflow! dropping bytes...\n", 938 printk(KERN_DEBUG "ISICOM: Intr(0x%x:%d): Flip buffer overflow! dropping bytes...\n",
945 base, channel+1); 939 base, channel+1);
@@ -948,7 +942,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id,
948 byte_count -= 2; 942 byte_count -= 2;
949 } 943 }
950 } 944 }
951 schedule_delayed_work(&tty->flip.work, 1); 945 tty_flip_buffer_push(tty);
952 } 946 }
953 if (card->isa == YES) 947 if (card->isa == YES)
954 ClearInterrupt(base); 948 ClearInterrupt(base);