aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/line.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/line.c')
-rw-r--r--arch/um/drivers/line.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index 83bf15a3dda8..2c898c4d6b6a 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -8,6 +8,7 @@
8#include "chan_kern.h" 8#include "chan_kern.h"
9#include "irq_kern.h" 9#include "irq_kern.h"
10#include "irq_user.h" 10#include "irq_user.h"
11#include "kern_util.h"
11#include "os.h" 12#include "os.h"
12 13
13#define LINE_BUFSIZE 4096 14#define LINE_BUFSIZE 4096
@@ -48,7 +49,7 @@ static int write_room(struct line *line)
48 n = line->head - line->tail; 49 n = line->head - line->tail;
49 50
50 if (n <= 0) 51 if (n <= 0)
51 n = LINE_BUFSIZE + n; /* The other case */ 52 n += LINE_BUFSIZE; /* The other case */
52 return n - 1; 53 return n - 1;
53} 54}
54 55
@@ -58,17 +59,10 @@ int line_write_room(struct tty_struct *tty)
58 unsigned long flags; 59 unsigned long flags;
59 int room; 60 int room;
60 61
61 if (tty->stopped)
62 return 0;
63
64 spin_lock_irqsave(&line->lock, flags); 62 spin_lock_irqsave(&line->lock, flags);
65 room = write_room(line); 63 room = write_room(line);
66 spin_unlock_irqrestore(&line->lock, flags); 64 spin_unlock_irqrestore(&line->lock, flags);
67 65
68 /*XXX: Warning to remove */
69 if (0 == room)
70 printk(KERN_DEBUG "%s: %s: no room left in buffer\n",
71 __FUNCTION__,tty->name);
72 return room; 66 return room;
73} 67}
74 68
@@ -79,8 +73,7 @@ int line_chars_in_buffer(struct tty_struct *tty)
79 int ret; 73 int ret;
80 74
81 spin_lock_irqsave(&line->lock, flags); 75 spin_lock_irqsave(&line->lock, flags);
82 76 /* write_room subtracts 1 for the needed NULL, so we readd it.*/
83 /*write_room subtracts 1 for the needed NULL, so we readd it.*/
84 ret = LINE_BUFSIZE - (write_room(line) + 1); 77 ret = LINE_BUFSIZE - (write_room(line) + 1);
85 spin_unlock_irqrestore(&line->lock, flags); 78 spin_unlock_irqrestore(&line->lock, flags);
86 79
@@ -184,10 +177,6 @@ void line_flush_buffer(struct tty_struct *tty)
184 unsigned long flags; 177 unsigned long flags;
185 int err; 178 int err;
186 179
187 /*XXX: copied from line_write, verify if it is correct!*/
188 if (tty->stopped)
189 return;
190
191 spin_lock_irqsave(&line->lock, flags); 180 spin_lock_irqsave(&line->lock, flags);
192 err = flush_buffer(line); 181 err = flush_buffer(line);
193 spin_unlock_irqrestore(&line->lock, flags); 182 spin_unlock_irqrestore(&line->lock, flags);
@@ -213,9 +202,6 @@ int line_write(struct tty_struct *tty, const unsigned char *buf, int len)
213 unsigned long flags; 202 unsigned long flags;
214 int n, ret = 0; 203 int n, ret = 0;
215 204
216 if (tty->stopped)
217 return 0;
218
219 spin_lock_irqsave(&line->lock, flags); 205 spin_lock_irqsave(&line->lock, flags);
220 if (line->head != line->tail) 206 if (line->head != line->tail)
221 ret = buffer_data(line, buf, len); 207 ret = buffer_data(line, buf, len);
@@ -788,9 +774,11 @@ static irqreturn_t winch_interrupt(int irq, void *data)
788 tty = winch->tty; 774 tty = winch->tty;
789 if (tty != NULL) { 775 if (tty != NULL) {
790 line = tty->driver_data; 776 line = tty->driver_data;
791 chan_window_size(&line->chan_list, &tty->winsize.ws_row, 777 if (line != NULL) {
792 &tty->winsize.ws_col); 778 chan_window_size(&line->chan_list, &tty->winsize.ws_row,
793 kill_pgrp(tty->pgrp, SIGWINCH, 1); 779 &tty->winsize.ws_col);
780 kill_pgrp(tty->pgrp, SIGWINCH, 1);
781 }
794 } 782 }
795 out: 783 out:
796 if (winch->fd != -1) 784 if (winch->fd != -1)