diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-10-18 16:26:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 19:53:01 -0400 |
commit | ba2e68ac6157004ee4922fb39ebd9459bbae883e (patch) | |
tree | 0eddb7fcb1c7cafb85761c1af3e072469a68c405 /drivers/tty/n_tty.c | |
parent | 3fe780b379fac2e1eeb5907ee7c864756ce7ec83 (diff) |
TTY: move ldisc data from tty_struct: read_* and echo_* and canon_* stuff
All the ring-buffers...
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r-- | drivers/tty/n_tty.c | 260 |
1 files changed, 137 insertions, 123 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 702dd4adbdc9..4794537a50ff 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -83,6 +83,19 @@ struct n_tty_data { | |||
83 | 83 | ||
84 | DECLARE_BITMAP(process_char_map, 256); | 84 | DECLARE_BITMAP(process_char_map, 256); |
85 | DECLARE_BITMAP(read_flags, N_TTY_BUF_SIZE); | 85 | DECLARE_BITMAP(read_flags, N_TTY_BUF_SIZE); |
86 | |||
87 | char *read_buf; | ||
88 | int read_head; | ||
89 | int read_tail; | ||
90 | int read_cnt; | ||
91 | |||
92 | unsigned char *echo_buf; | ||
93 | unsigned int echo_pos; | ||
94 | unsigned int echo_cnt; | ||
95 | |||
96 | int canon_data; | ||
97 | unsigned long canon_head; | ||
98 | unsigned int canon_column; | ||
86 | }; | 99 | }; |
87 | 100 | ||
88 | static inline int tty_put_user(struct tty_struct *tty, unsigned char x, | 101 | static inline int tty_put_user(struct tty_struct *tty, unsigned char x, |
@@ -110,14 +123,14 @@ static void n_tty_set_room(struct tty_struct *tty) | |||
110 | int left; | 123 | int left; |
111 | int old_left; | 124 | int old_left; |
112 | 125 | ||
113 | /* tty->read_cnt is not read locked ? */ | 126 | /* ldata->read_cnt is not read locked ? */ |
114 | if (I_PARMRK(tty)) { | 127 | if (I_PARMRK(tty)) { |
115 | /* Multiply read_cnt by 3, since each byte might take up to | 128 | /* Multiply read_cnt by 3, since each byte might take up to |
116 | * three times as many spaces when PARMRK is set (depending on | 129 | * three times as many spaces when PARMRK is set (depending on |
117 | * its flags, e.g. parity error). */ | 130 | * its flags, e.g. parity error). */ |
118 | left = N_TTY_BUF_SIZE - tty->read_cnt * 3 - 1; | 131 | left = N_TTY_BUF_SIZE - ldata->read_cnt * 3 - 1; |
119 | } else | 132 | } else |
120 | left = N_TTY_BUF_SIZE - tty->read_cnt - 1; | 133 | left = N_TTY_BUF_SIZE - ldata->read_cnt - 1; |
121 | 134 | ||
122 | /* | 135 | /* |
123 | * If we are doing input canonicalization, and there are no | 136 | * If we are doing input canonicalization, and there are no |
@@ -126,7 +139,7 @@ static void n_tty_set_room(struct tty_struct *tty) | |||
126 | * characters will be beeped. | 139 | * characters will be beeped. |
127 | */ | 140 | */ |
128 | if (left <= 0) | 141 | if (left <= 0) |
129 | left = ldata->icanon && !tty->canon_data; | 142 | left = ldata->icanon && !ldata->canon_data; |
130 | old_left = tty->receive_room; | 143 | old_left = tty->receive_room; |
131 | tty->receive_room = left; | 144 | tty->receive_room = left; |
132 | 145 | ||
@@ -137,10 +150,12 @@ static void n_tty_set_room(struct tty_struct *tty) | |||
137 | 150 | ||
138 | static void put_tty_queue_nolock(unsigned char c, struct tty_struct *tty) | 151 | static void put_tty_queue_nolock(unsigned char c, struct tty_struct *tty) |
139 | { | 152 | { |
140 | if (tty->read_cnt < N_TTY_BUF_SIZE) { | 153 | struct n_tty_data *ldata = tty->disc_data; |
141 | tty->read_buf[tty->read_head] = c; | 154 | |
142 | tty->read_head = (tty->read_head + 1) & (N_TTY_BUF_SIZE-1); | 155 | if (ldata->read_cnt < N_TTY_BUF_SIZE) { |
143 | tty->read_cnt++; | 156 | ldata->read_buf[ldata->read_head] = c; |
157 | ldata->read_head = (ldata->read_head + 1) & (N_TTY_BUF_SIZE-1); | ||
158 | ldata->read_cnt++; | ||
144 | } | 159 | } |
145 | } | 160 | } |
146 | 161 | ||
@@ -198,14 +213,14 @@ static void reset_buffer_flags(struct tty_struct *tty) | |||
198 | unsigned long flags; | 213 | unsigned long flags; |
199 | 214 | ||
200 | spin_lock_irqsave(&tty->read_lock, flags); | 215 | spin_lock_irqsave(&tty->read_lock, flags); |
201 | tty->read_head = tty->read_tail = tty->read_cnt = 0; | 216 | ldata->read_head = ldata->read_tail = ldata->read_cnt = 0; |
202 | spin_unlock_irqrestore(&tty->read_lock, flags); | 217 | spin_unlock_irqrestore(&tty->read_lock, flags); |
203 | 218 | ||
204 | mutex_lock(&tty->echo_lock); | 219 | mutex_lock(&tty->echo_lock); |
205 | tty->echo_pos = tty->echo_cnt = ldata->echo_overrun = 0; | 220 | ldata->echo_pos = ldata->echo_cnt = ldata->echo_overrun = 0; |
206 | mutex_unlock(&tty->echo_lock); | 221 | mutex_unlock(&tty->echo_lock); |
207 | 222 | ||
208 | tty->canon_head = tty->canon_data = ldata->erasing = 0; | 223 | ldata->canon_head = ldata->canon_data = ldata->erasing = 0; |
209 | bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE); | 224 | bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE); |
210 | n_tty_set_room(tty); | 225 | n_tty_set_room(tty); |
211 | } | 226 | } |
@@ -257,11 +272,11 @@ static ssize_t n_tty_chars_in_buffer(struct tty_struct *tty) | |||
257 | 272 | ||
258 | spin_lock_irqsave(&tty->read_lock, flags); | 273 | spin_lock_irqsave(&tty->read_lock, flags); |
259 | if (!ldata->icanon) { | 274 | if (!ldata->icanon) { |
260 | n = tty->read_cnt; | 275 | n = ldata->read_cnt; |
261 | } else if (tty->canon_data) { | 276 | } else if (ldata->canon_data) { |
262 | n = (tty->canon_head > tty->read_tail) ? | 277 | n = (ldata->canon_head > ldata->read_tail) ? |
263 | tty->canon_head - tty->read_tail : | 278 | ldata->canon_head - ldata->read_tail : |
264 | tty->canon_head + (N_TTY_BUF_SIZE - tty->read_tail); | 279 | ldata->canon_head + (N_TTY_BUF_SIZE - ldata->read_tail); |
265 | } | 280 | } |
266 | spin_unlock_irqrestore(&tty->read_lock, flags); | 281 | spin_unlock_irqrestore(&tty->read_lock, flags); |
267 | return n; | 282 | return n; |
@@ -331,11 +346,11 @@ static int do_output_char(unsigned char c, struct tty_struct *tty, int space) | |||
331 | if (O_ONLCR(tty)) { | 346 | if (O_ONLCR(tty)) { |
332 | if (space < 2) | 347 | if (space < 2) |
333 | return -1; | 348 | return -1; |
334 | tty->canon_column = ldata->column = 0; | 349 | ldata->canon_column = ldata->column = 0; |
335 | tty->ops->write(tty, "\r\n", 2); | 350 | tty->ops->write(tty, "\r\n", 2); |
336 | return 2; | 351 | return 2; |
337 | } | 352 | } |
338 | tty->canon_column = ldata->column; | 353 | ldata->canon_column = ldata->column; |
339 | break; | 354 | break; |
340 | case '\r': | 355 | case '\r': |
341 | if (O_ONOCR(tty) && ldata->column == 0) | 356 | if (O_ONOCR(tty) && ldata->column == 0) |
@@ -343,10 +358,10 @@ static int do_output_char(unsigned char c, struct tty_struct *tty, int space) | |||
343 | if (O_OCRNL(tty)) { | 358 | if (O_OCRNL(tty)) { |
344 | c = '\n'; | 359 | c = '\n'; |
345 | if (O_ONLRET(tty)) | 360 | if (O_ONLRET(tty)) |
346 | tty->canon_column = ldata->column = 0; | 361 | ldata->canon_column = ldata->column = 0; |
347 | break; | 362 | break; |
348 | } | 363 | } |
349 | tty->canon_column = ldata->column = 0; | 364 | ldata->canon_column = ldata->column = 0; |
350 | break; | 365 | break; |
351 | case '\t': | 366 | case '\t': |
352 | spaces = 8 - (ldata->column & 7); | 367 | spaces = 8 - (ldata->column & 7); |
@@ -453,14 +468,14 @@ static ssize_t process_output_block(struct tty_struct *tty, | |||
453 | ldata->column = 0; | 468 | ldata->column = 0; |
454 | if (O_ONLCR(tty)) | 469 | if (O_ONLCR(tty)) |
455 | goto break_out; | 470 | goto break_out; |
456 | tty->canon_column = ldata->column; | 471 | ldata->canon_column = ldata->column; |
457 | break; | 472 | break; |
458 | case '\r': | 473 | case '\r': |
459 | if (O_ONOCR(tty) && ldata->column == 0) | 474 | if (O_ONOCR(tty) && ldata->column == 0) |
460 | goto break_out; | 475 | goto break_out; |
461 | if (O_OCRNL(tty)) | 476 | if (O_OCRNL(tty)) |
462 | goto break_out; | 477 | goto break_out; |
463 | tty->canon_column = ldata->column = 0; | 478 | ldata->canon_column = ldata->column = 0; |
464 | break; | 479 | break; |
465 | case '\t': | 480 | case '\t': |
466 | goto break_out; | 481 | goto break_out; |
@@ -518,7 +533,7 @@ static void process_echoes(struct tty_struct *tty) | |||
518 | unsigned char c; | 533 | unsigned char c; |
519 | unsigned char *cp, *buf_end; | 534 | unsigned char *cp, *buf_end; |
520 | 535 | ||
521 | if (!tty->echo_cnt) | 536 | if (!ldata->echo_cnt) |
522 | return; | 537 | return; |
523 | 538 | ||
524 | mutex_lock(&tty->output_lock); | 539 | mutex_lock(&tty->output_lock); |
@@ -526,9 +541,9 @@ static void process_echoes(struct tty_struct *tty) | |||
526 | 541 | ||
527 | space = tty_write_room(tty); | 542 | space = tty_write_room(tty); |
528 | 543 | ||
529 | buf_end = tty->echo_buf + N_TTY_BUF_SIZE; | 544 | buf_end = ldata->echo_buf + N_TTY_BUF_SIZE; |
530 | cp = tty->echo_buf + tty->echo_pos; | 545 | cp = ldata->echo_buf + ldata->echo_pos; |
531 | nr = tty->echo_cnt; | 546 | nr = ldata->echo_cnt; |
532 | while (nr > 0) { | 547 | while (nr > 0) { |
533 | c = *cp; | 548 | c = *cp; |
534 | if (c == ECHO_OP_START) { | 549 | if (c == ECHO_OP_START) { |
@@ -565,7 +580,7 @@ static void process_echoes(struct tty_struct *tty) | |||
565 | * Otherwise, tab spacing is normal. | 580 | * Otherwise, tab spacing is normal. |
566 | */ | 581 | */ |
567 | if (!(num_chars & 0x80)) | 582 | if (!(num_chars & 0x80)) |
568 | num_chars += tty->canon_column; | 583 | num_chars += ldata->canon_column; |
569 | num_bs = 8 - (num_chars & 7); | 584 | num_bs = 8 - (num_chars & 7); |
570 | 585 | ||
571 | if (num_bs > space) { | 586 | if (num_bs > space) { |
@@ -583,7 +598,7 @@ static void process_echoes(struct tty_struct *tty) | |||
583 | break; | 598 | break; |
584 | 599 | ||
585 | case ECHO_OP_SET_CANON_COL: | 600 | case ECHO_OP_SET_CANON_COL: |
586 | tty->canon_column = ldata->column; | 601 | ldata->canon_column = ldata->column; |
587 | cp += 2; | 602 | cp += 2; |
588 | nr -= 2; | 603 | nr -= 2; |
589 | break; | 604 | break; |
@@ -655,14 +670,14 @@ static void process_echoes(struct tty_struct *tty) | |||
655 | } | 670 | } |
656 | 671 | ||
657 | if (nr == 0) { | 672 | if (nr == 0) { |
658 | tty->echo_pos = 0; | 673 | ldata->echo_pos = 0; |
659 | tty->echo_cnt = 0; | 674 | ldata->echo_cnt = 0; |
660 | ldata->echo_overrun = 0; | 675 | ldata->echo_overrun = 0; |
661 | } else { | 676 | } else { |
662 | int num_processed = tty->echo_cnt - nr; | 677 | int num_processed = ldata->echo_cnt - nr; |
663 | tty->echo_pos += num_processed; | 678 | ldata->echo_pos += num_processed; |
664 | tty->echo_pos &= N_TTY_BUF_SIZE - 1; | 679 | ldata->echo_pos &= N_TTY_BUF_SIZE - 1; |
665 | tty->echo_cnt = nr; | 680 | ldata->echo_cnt = nr; |
666 | if (num_processed > 0) | 681 | if (num_processed > 0) |
667 | ldata->echo_overrun = 0; | 682 | ldata->echo_overrun = 0; |
668 | } | 683 | } |
@@ -689,37 +704,37 @@ static void add_echo_byte(unsigned char c, struct tty_struct *tty) | |||
689 | struct n_tty_data *ldata = tty->disc_data; | 704 | struct n_tty_data *ldata = tty->disc_data; |
690 | int new_byte_pos; | 705 | int new_byte_pos; |
691 | 706 | ||
692 | if (tty->echo_cnt == N_TTY_BUF_SIZE) { | 707 | if (ldata->echo_cnt == N_TTY_BUF_SIZE) { |
693 | /* Circular buffer is already at capacity */ | 708 | /* Circular buffer is already at capacity */ |
694 | new_byte_pos = tty->echo_pos; | 709 | new_byte_pos = ldata->echo_pos; |
695 | 710 | ||
696 | /* | 711 | /* |
697 | * Since the buffer start position needs to be advanced, | 712 | * Since the buffer start position needs to be advanced, |
698 | * be sure to step by a whole operation byte group. | 713 | * be sure to step by a whole operation byte group. |
699 | */ | 714 | */ |
700 | if (tty->echo_buf[tty->echo_pos] == ECHO_OP_START) { | 715 | if (ldata->echo_buf[ldata->echo_pos] == ECHO_OP_START) { |
701 | if (tty->echo_buf[(tty->echo_pos + 1) & | 716 | if (ldata->echo_buf[(ldata->echo_pos + 1) & |
702 | (N_TTY_BUF_SIZE - 1)] == | 717 | (N_TTY_BUF_SIZE - 1)] == |
703 | ECHO_OP_ERASE_TAB) { | 718 | ECHO_OP_ERASE_TAB) { |
704 | tty->echo_pos += 3; | 719 | ldata->echo_pos += 3; |
705 | tty->echo_cnt -= 2; | 720 | ldata->echo_cnt -= 2; |
706 | } else { | 721 | } else { |
707 | tty->echo_pos += 2; | 722 | ldata->echo_pos += 2; |
708 | tty->echo_cnt -= 1; | 723 | ldata->echo_cnt -= 1; |
709 | } | 724 | } |
710 | } else { | 725 | } else { |
711 | tty->echo_pos++; | 726 | ldata->echo_pos++; |
712 | } | 727 | } |
713 | tty->echo_pos &= N_TTY_BUF_SIZE - 1; | 728 | ldata->echo_pos &= N_TTY_BUF_SIZE - 1; |
714 | 729 | ||
715 | ldata->echo_overrun = 1; | 730 | ldata->echo_overrun = 1; |
716 | } else { | 731 | } else { |
717 | new_byte_pos = tty->echo_pos + tty->echo_cnt; | 732 | new_byte_pos = ldata->echo_pos + ldata->echo_cnt; |
718 | new_byte_pos &= N_TTY_BUF_SIZE - 1; | 733 | new_byte_pos &= N_TTY_BUF_SIZE - 1; |
719 | tty->echo_cnt++; | 734 | ldata->echo_cnt++; |
720 | } | 735 | } |
721 | 736 | ||
722 | tty->echo_buf[new_byte_pos] = c; | 737 | ldata->echo_buf[new_byte_pos] = c; |
723 | } | 738 | } |
724 | 739 | ||
725 | /** | 740 | /** |
@@ -889,7 +904,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) | |||
889 | unsigned long flags; | 904 | unsigned long flags; |
890 | 905 | ||
891 | /* FIXME: locking needed ? */ | 906 | /* FIXME: locking needed ? */ |
892 | if (tty->read_head == tty->canon_head) { | 907 | if (ldata->read_head == ldata->canon_head) { |
893 | /* process_output('\a', tty); */ /* what do you think? */ | 908 | /* process_output('\a', tty); */ /* what do you think? */ |
894 | return; | 909 | return; |
895 | } | 910 | } |
@@ -900,17 +915,17 @@ static void eraser(unsigned char c, struct tty_struct *tty) | |||
900 | else { | 915 | else { |
901 | if (!L_ECHO(tty)) { | 916 | if (!L_ECHO(tty)) { |
902 | spin_lock_irqsave(&tty->read_lock, flags); | 917 | spin_lock_irqsave(&tty->read_lock, flags); |
903 | tty->read_cnt -= ((tty->read_head - tty->canon_head) & | 918 | ldata->read_cnt -= ((ldata->read_head - ldata->canon_head) & |
904 | (N_TTY_BUF_SIZE - 1)); | 919 | (N_TTY_BUF_SIZE - 1)); |
905 | tty->read_head = tty->canon_head; | 920 | ldata->read_head = ldata->canon_head; |
906 | spin_unlock_irqrestore(&tty->read_lock, flags); | 921 | spin_unlock_irqrestore(&tty->read_lock, flags); |
907 | return; | 922 | return; |
908 | } | 923 | } |
909 | if (!L_ECHOK(tty) || !L_ECHOKE(tty) || !L_ECHOE(tty)) { | 924 | if (!L_ECHOK(tty) || !L_ECHOKE(tty) || !L_ECHOE(tty)) { |
910 | spin_lock_irqsave(&tty->read_lock, flags); | 925 | spin_lock_irqsave(&tty->read_lock, flags); |
911 | tty->read_cnt -= ((tty->read_head - tty->canon_head) & | 926 | ldata->read_cnt -= ((ldata->read_head - ldata->canon_head) & |
912 | (N_TTY_BUF_SIZE - 1)); | 927 | (N_TTY_BUF_SIZE - 1)); |
913 | tty->read_head = tty->canon_head; | 928 | ldata->read_head = ldata->canon_head; |
914 | spin_unlock_irqrestore(&tty->read_lock, flags); | 929 | spin_unlock_irqrestore(&tty->read_lock, flags); |
915 | finish_erasing(tty); | 930 | finish_erasing(tty); |
916 | echo_char(KILL_CHAR(tty), tty); | 931 | echo_char(KILL_CHAR(tty), tty); |
@@ -924,14 +939,14 @@ static void eraser(unsigned char c, struct tty_struct *tty) | |||
924 | 939 | ||
925 | seen_alnums = 0; | 940 | seen_alnums = 0; |
926 | /* FIXME: Locking ?? */ | 941 | /* FIXME: Locking ?? */ |
927 | while (tty->read_head != tty->canon_head) { | 942 | while (ldata->read_head != ldata->canon_head) { |
928 | head = tty->read_head; | 943 | head = ldata->read_head; |
929 | 944 | ||
930 | /* erase a single possibly multibyte character */ | 945 | /* erase a single possibly multibyte character */ |
931 | do { | 946 | do { |
932 | head = (head - 1) & (N_TTY_BUF_SIZE-1); | 947 | head = (head - 1) & (N_TTY_BUF_SIZE-1); |
933 | c = tty->read_buf[head]; | 948 | c = ldata->read_buf[head]; |
934 | } while (is_continuation(c, tty) && head != tty->canon_head); | 949 | } while (is_continuation(c, tty) && head != ldata->canon_head); |
935 | 950 | ||
936 | /* do not partially erase */ | 951 | /* do not partially erase */ |
937 | if (is_continuation(c, tty)) | 952 | if (is_continuation(c, tty)) |
@@ -944,10 +959,10 @@ static void eraser(unsigned char c, struct tty_struct *tty) | |||
944 | else if (seen_alnums) | 959 | else if (seen_alnums) |
945 | break; | 960 | break; |
946 | } | 961 | } |
947 | cnt = (tty->read_head - head) & (N_TTY_BUF_SIZE-1); | 962 | cnt = (ldata->read_head - head) & (N_TTY_BUF_SIZE-1); |
948 | spin_lock_irqsave(&tty->read_lock, flags); | 963 | spin_lock_irqsave(&tty->read_lock, flags); |
949 | tty->read_head = head; | 964 | ldata->read_head = head; |
950 | tty->read_cnt -= cnt; | 965 | ldata->read_cnt -= cnt; |
951 | spin_unlock_irqrestore(&tty->read_lock, flags); | 966 | spin_unlock_irqrestore(&tty->read_lock, flags); |
952 | if (L_ECHO(tty)) { | 967 | if (L_ECHO(tty)) { |
953 | if (L_ECHOPRT(tty)) { | 968 | if (L_ECHOPRT(tty)) { |
@@ -959,7 +974,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) | |||
959 | echo_char(c, tty); | 974 | echo_char(c, tty); |
960 | while (--cnt > 0) { | 975 | while (--cnt > 0) { |
961 | head = (head+1) & (N_TTY_BUF_SIZE-1); | 976 | head = (head+1) & (N_TTY_BUF_SIZE-1); |
962 | echo_char_raw(tty->read_buf[head], tty); | 977 | echo_char_raw(ldata->read_buf[head], tty); |
963 | echo_move_back_col(tty); | 978 | echo_move_back_col(tty); |
964 | } | 979 | } |
965 | } else if (kill_type == ERASE && !L_ECHOE(tty)) { | 980 | } else if (kill_type == ERASE && !L_ECHOE(tty)) { |
@@ -967,7 +982,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) | |||
967 | } else if (c == '\t') { | 982 | } else if (c == '\t') { |
968 | unsigned int num_chars = 0; | 983 | unsigned int num_chars = 0; |
969 | int after_tab = 0; | 984 | int after_tab = 0; |
970 | unsigned long tail = tty->read_head; | 985 | unsigned long tail = ldata->read_head; |
971 | 986 | ||
972 | /* | 987 | /* |
973 | * Count the columns used for characters | 988 | * Count the columns used for characters |
@@ -976,9 +991,9 @@ static void eraser(unsigned char c, struct tty_struct *tty) | |||
976 | * This info is used to go back the correct | 991 | * This info is used to go back the correct |
977 | * number of columns. | 992 | * number of columns. |
978 | */ | 993 | */ |
979 | while (tail != tty->canon_head) { | 994 | while (tail != ldata->canon_head) { |
980 | tail = (tail-1) & (N_TTY_BUF_SIZE-1); | 995 | tail = (tail-1) & (N_TTY_BUF_SIZE-1); |
981 | c = tty->read_buf[tail]; | 996 | c = ldata->read_buf[tail]; |
982 | if (c == '\t') { | 997 | if (c == '\t') { |
983 | after_tab = 1; | 998 | after_tab = 1; |
984 | break; | 999 | break; |
@@ -1006,7 +1021,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) | |||
1006 | if (kill_type == ERASE) | 1021 | if (kill_type == ERASE) |
1007 | break; | 1022 | break; |
1008 | } | 1023 | } |
1009 | if (tty->read_head == tty->canon_head && L_ECHO(tty)) | 1024 | if (ldata->read_head == ldata->canon_head && L_ECHO(tty)) |
1010 | finish_erasing(tty); | 1025 | finish_erasing(tty); |
1011 | } | 1026 | } |
1012 | 1027 | ||
@@ -1171,7 +1186,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) | |||
1171 | if (!test_bit(c, ldata->process_char_map) || ldata->lnext) { | 1186 | if (!test_bit(c, ldata->process_char_map) || ldata->lnext) { |
1172 | ldata->lnext = 0; | 1187 | ldata->lnext = 0; |
1173 | parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0; | 1188 | parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0; |
1174 | if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { | 1189 | if (ldata->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { |
1175 | /* beep if no space */ | 1190 | /* beep if no space */ |
1176 | if (L_ECHO(tty)) | 1191 | if (L_ECHO(tty)) |
1177 | process_output('\a', tty); | 1192 | process_output('\a', tty); |
@@ -1180,7 +1195,7 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c) | |||
1180 | if (L_ECHO(tty)) { | 1195 | if (L_ECHO(tty)) { |
1181 | finish_erasing(tty); | 1196 | finish_erasing(tty); |
1182 | /* Record the column of first canon char. */ | 1197 | /* Record the column of first canon char. */ |
1183 | if (tty->canon_head == tty->read_head) | 1198 | if (ldata->canon_head == ldata->read_head) |
1184 | echo_set_canon_col(tty); | 1199 | echo_set_canon_col(tty); |
1185 | echo_char(c, tty); | 1200 | echo_char(c, tty); |
1186 | process_echoes(tty); | 1201 | process_echoes(tty); |
@@ -1264,20 +1279,20 @@ send_signal: | |||
1264 | } | 1279 | } |
1265 | if (c == REPRINT_CHAR(tty) && L_ECHO(tty) && | 1280 | if (c == REPRINT_CHAR(tty) && L_ECHO(tty) && |
1266 | L_IEXTEN(tty)) { | 1281 | L_IEXTEN(tty)) { |
1267 | unsigned long tail = tty->canon_head; | 1282 | unsigned long tail = ldata->canon_head; |
1268 | 1283 | ||
1269 | finish_erasing(tty); | 1284 | finish_erasing(tty); |
1270 | echo_char(c, tty); | 1285 | echo_char(c, tty); |
1271 | echo_char_raw('\n', tty); | 1286 | echo_char_raw('\n', tty); |
1272 | while (tail != tty->read_head) { | 1287 | while (tail != ldata->read_head) { |
1273 | echo_char(tty->read_buf[tail], tty); | 1288 | echo_char(ldata->read_buf[tail], tty); |
1274 | tail = (tail+1) & (N_TTY_BUF_SIZE-1); | 1289 | tail = (tail+1) & (N_TTY_BUF_SIZE-1); |
1275 | } | 1290 | } |
1276 | process_echoes(tty); | 1291 | process_echoes(tty); |
1277 | return; | 1292 | return; |
1278 | } | 1293 | } |
1279 | if (c == '\n') { | 1294 | if (c == '\n') { |
1280 | if (tty->read_cnt >= N_TTY_BUF_SIZE) { | 1295 | if (ldata->read_cnt >= N_TTY_BUF_SIZE) { |
1281 | if (L_ECHO(tty)) | 1296 | if (L_ECHO(tty)) |
1282 | process_output('\a', tty); | 1297 | process_output('\a', tty); |
1283 | return; | 1298 | return; |
@@ -1289,9 +1304,9 @@ send_signal: | |||
1289 | goto handle_newline; | 1304 | goto handle_newline; |
1290 | } | 1305 | } |
1291 | if (c == EOF_CHAR(tty)) { | 1306 | if (c == EOF_CHAR(tty)) { |
1292 | if (tty->read_cnt >= N_TTY_BUF_SIZE) | 1307 | if (ldata->read_cnt >= N_TTY_BUF_SIZE) |
1293 | return; | 1308 | return; |
1294 | if (tty->canon_head != tty->read_head) | 1309 | if (ldata->canon_head != ldata->read_head) |
1295 | set_bit(TTY_PUSH, &tty->flags); | 1310 | set_bit(TTY_PUSH, &tty->flags); |
1296 | c = __DISABLED_CHAR; | 1311 | c = __DISABLED_CHAR; |
1297 | goto handle_newline; | 1312 | goto handle_newline; |
@@ -1300,7 +1315,7 @@ send_signal: | |||
1300 | (c == EOL2_CHAR(tty) && L_IEXTEN(tty))) { | 1315 | (c == EOL2_CHAR(tty) && L_IEXTEN(tty))) { |
1301 | parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) | 1316 | parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) |
1302 | ? 1 : 0; | 1317 | ? 1 : 0; |
1303 | if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) { | 1318 | if (ldata->read_cnt >= (N_TTY_BUF_SIZE - parmrk)) { |
1304 | if (L_ECHO(tty)) | 1319 | if (L_ECHO(tty)) |
1305 | process_output('\a', tty); | 1320 | process_output('\a', tty); |
1306 | return; | 1321 | return; |
@@ -1310,7 +1325,7 @@ send_signal: | |||
1310 | */ | 1325 | */ |
1311 | if (L_ECHO(tty)) { | 1326 | if (L_ECHO(tty)) { |
1312 | /* Record the column of first canon char. */ | 1327 | /* Record the column of first canon char. */ |
1313 | if (tty->canon_head == tty->read_head) | 1328 | if (ldata->canon_head == ldata->read_head) |
1314 | echo_set_canon_col(tty); | 1329 | echo_set_canon_col(tty); |
1315 | echo_char(c, tty); | 1330 | echo_char(c, tty); |
1316 | process_echoes(tty); | 1331 | process_echoes(tty); |
@@ -1324,10 +1339,10 @@ send_signal: | |||
1324 | 1339 | ||
1325 | handle_newline: | 1340 | handle_newline: |
1326 | spin_lock_irqsave(&tty->read_lock, flags); | 1341 | spin_lock_irqsave(&tty->read_lock, flags); |
1327 | set_bit(tty->read_head, ldata->read_flags); | 1342 | set_bit(ldata->read_head, ldata->read_flags); |
1328 | put_tty_queue_nolock(c, tty); | 1343 | put_tty_queue_nolock(c, tty); |
1329 | tty->canon_head = tty->read_head; | 1344 | ldata->canon_head = ldata->read_head; |
1330 | tty->canon_data++; | 1345 | ldata->canon_data++; |
1331 | spin_unlock_irqrestore(&tty->read_lock, flags); | 1346 | spin_unlock_irqrestore(&tty->read_lock, flags); |
1332 | kill_fasync(&tty->fasync, SIGIO, POLL_IN); | 1347 | kill_fasync(&tty->fasync, SIGIO, POLL_IN); |
1333 | if (waitqueue_active(&tty->read_wait)) | 1348 | if (waitqueue_active(&tty->read_wait)) |
@@ -1337,7 +1352,7 @@ handle_newline: | |||
1337 | } | 1352 | } |
1338 | 1353 | ||
1339 | parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0; | 1354 | parmrk = (c == (unsigned char) '\377' && I_PARMRK(tty)) ? 1 : 0; |
1340 | if (tty->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { | 1355 | if (ldata->read_cnt >= (N_TTY_BUF_SIZE - parmrk - 1)) { |
1341 | /* beep if no space */ | 1356 | /* beep if no space */ |
1342 | if (L_ECHO(tty)) | 1357 | if (L_ECHO(tty)) |
1343 | process_output('\a', tty); | 1358 | process_output('\a', tty); |
@@ -1349,7 +1364,7 @@ handle_newline: | |||
1349 | echo_char_raw('\n', tty); | 1364 | echo_char_raw('\n', tty); |
1350 | else { | 1365 | else { |
1351 | /* Record the column of first canon char. */ | 1366 | /* Record the column of first canon char. */ |
1352 | if (tty->canon_head == tty->read_head) | 1367 | if (ldata->canon_head == ldata->read_head) |
1353 | echo_set_canon_col(tty); | 1368 | echo_set_canon_col(tty); |
1354 | echo_char(c, tty); | 1369 | echo_char(c, tty); |
1355 | } | 1370 | } |
@@ -1403,21 +1418,21 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
1403 | 1418 | ||
1404 | if (ldata->real_raw) { | 1419 | if (ldata->real_raw) { |
1405 | spin_lock_irqsave(&tty->read_lock, cpuflags); | 1420 | spin_lock_irqsave(&tty->read_lock, cpuflags); |
1406 | i = min(N_TTY_BUF_SIZE - tty->read_cnt, | 1421 | i = min(N_TTY_BUF_SIZE - ldata->read_cnt, |
1407 | N_TTY_BUF_SIZE - tty->read_head); | 1422 | N_TTY_BUF_SIZE - ldata->read_head); |
1408 | i = min(count, i); | 1423 | i = min(count, i); |
1409 | memcpy(tty->read_buf + tty->read_head, cp, i); | 1424 | memcpy(ldata->read_buf + ldata->read_head, cp, i); |
1410 | tty->read_head = (tty->read_head + i) & (N_TTY_BUF_SIZE-1); | 1425 | ldata->read_head = (ldata->read_head + i) & (N_TTY_BUF_SIZE-1); |
1411 | tty->read_cnt += i; | 1426 | ldata->read_cnt += i; |
1412 | cp += i; | 1427 | cp += i; |
1413 | count -= i; | 1428 | count -= i; |
1414 | 1429 | ||
1415 | i = min(N_TTY_BUF_SIZE - tty->read_cnt, | 1430 | i = min(N_TTY_BUF_SIZE - ldata->read_cnt, |
1416 | N_TTY_BUF_SIZE - tty->read_head); | 1431 | N_TTY_BUF_SIZE - ldata->read_head); |
1417 | i = min(count, i); | 1432 | i = min(count, i); |
1418 | memcpy(tty->read_buf + tty->read_head, cp, i); | 1433 | memcpy(ldata->read_buf + ldata->read_head, cp, i); |
1419 | tty->read_head = (tty->read_head + i) & (N_TTY_BUF_SIZE-1); | 1434 | ldata->read_head = (ldata->read_head + i) & (N_TTY_BUF_SIZE-1); |
1420 | tty->read_cnt += i; | 1435 | ldata->read_cnt += i; |
1421 | spin_unlock_irqrestore(&tty->read_lock, cpuflags); | 1436 | spin_unlock_irqrestore(&tty->read_lock, cpuflags); |
1422 | } else { | 1437 | } else { |
1423 | for (i = count, p = cp, f = fp; i; i--, p++) { | 1438 | for (i = count, p = cp, f = fp; i; i--, p++) { |
@@ -1449,7 +1464,7 @@ static void n_tty_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
1449 | 1464 | ||
1450 | n_tty_set_room(tty); | 1465 | n_tty_set_room(tty); |
1451 | 1466 | ||
1452 | if ((!ldata->icanon && (tty->read_cnt >= tty->minimum_to_wake)) || | 1467 | if ((!ldata->icanon && (ldata->read_cnt >= tty->minimum_to_wake)) || |
1453 | L_EXTPROC(tty)) { | 1468 | L_EXTPROC(tty)) { |
1454 | kill_fasync(&tty->fasync, SIGIO, POLL_IN); | 1469 | kill_fasync(&tty->fasync, SIGIO, POLL_IN); |
1455 | if (waitqueue_active(&tty->read_wait)) | 1470 | if (waitqueue_active(&tty->read_wait)) |
@@ -1500,12 +1515,12 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old) | |||
1500 | canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON; | 1515 | canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON; |
1501 | if (canon_change) { | 1516 | if (canon_change) { |
1502 | bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE); | 1517 | bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE); |
1503 | tty->canon_head = tty->read_tail; | 1518 | ldata->canon_head = ldata->read_tail; |
1504 | tty->canon_data = 0; | 1519 | ldata->canon_data = 0; |
1505 | ldata->erasing = 0; | 1520 | ldata->erasing = 0; |
1506 | } | 1521 | } |
1507 | 1522 | ||
1508 | if (canon_change && !L_ICANON(tty) && tty->read_cnt) | 1523 | if (canon_change && !L_ICANON(tty) && ldata->read_cnt) |
1509 | wake_up_interruptible(&tty->read_wait); | 1524 | wake_up_interruptible(&tty->read_wait); |
1510 | 1525 | ||
1511 | ldata->icanon = (L_ICANON(tty) != 0); | 1526 | ldata->icanon = (L_ICANON(tty) != 0); |
@@ -1586,11 +1601,9 @@ static void n_tty_close(struct tty_struct *tty) | |||
1586 | struct n_tty_data *ldata = tty->disc_data; | 1601 | struct n_tty_data *ldata = tty->disc_data; |
1587 | 1602 | ||
1588 | n_tty_flush_buffer(tty); | 1603 | n_tty_flush_buffer(tty); |
1589 | kfree(tty->read_buf); | 1604 | kfree(ldata->read_buf); |
1590 | kfree(tty->echo_buf); | 1605 | kfree(ldata->echo_buf); |
1591 | kfree(ldata); | 1606 | kfree(ldata); |
1592 | tty->read_buf = NULL; | ||
1593 | tty->echo_buf = NULL; | ||
1594 | tty->disc_data = NULL; | 1607 | tty->disc_data = NULL; |
1595 | } | 1608 | } |
1596 | 1609 | ||
@@ -1615,9 +1628,9 @@ static int n_tty_open(struct tty_struct *tty) | |||
1615 | ldata->overrun_time = jiffies; | 1628 | ldata->overrun_time = jiffies; |
1616 | 1629 | ||
1617 | /* These are ugly. Currently a malloc failure here can panic */ | 1630 | /* These are ugly. Currently a malloc failure here can panic */ |
1618 | tty->read_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); | 1631 | ldata->read_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); |
1619 | tty->echo_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); | 1632 | ldata->echo_buf = kzalloc(N_TTY_BUF_SIZE, GFP_KERNEL); |
1620 | if (!tty->read_buf || !tty->echo_buf) | 1633 | if (!ldata->read_buf || !ldata->echo_buf) |
1621 | goto err_free_bufs; | 1634 | goto err_free_bufs; |
1622 | 1635 | ||
1623 | tty->disc_data = ldata; | 1636 | tty->disc_data = ldata; |
@@ -1630,8 +1643,8 @@ static int n_tty_open(struct tty_struct *tty) | |||
1630 | 1643 | ||
1631 | return 0; | 1644 | return 0; |
1632 | err_free_bufs: | 1645 | err_free_bufs: |
1633 | kfree(tty->read_buf); | 1646 | kfree(ldata->read_buf); |
1634 | kfree(tty->echo_buf); | 1647 | kfree(ldata->echo_buf); |
1635 | kfree(ldata); | 1648 | kfree(ldata); |
1636 | err: | 1649 | err: |
1637 | return -ENOMEM; | 1650 | return -ENOMEM; |
@@ -1643,9 +1656,9 @@ static inline int input_available_p(struct tty_struct *tty, int amt) | |||
1643 | 1656 | ||
1644 | tty_flush_to_ldisc(tty); | 1657 | tty_flush_to_ldisc(tty); |
1645 | if (ldata->icanon && !L_EXTPROC(tty)) { | 1658 | if (ldata->icanon && !L_EXTPROC(tty)) { |
1646 | if (tty->canon_data) | 1659 | if (ldata->canon_data) |
1647 | return 1; | 1660 | return 1; |
1648 | } else if (tty->read_cnt >= (amt ? amt : 1)) | 1661 | } else if (ldata->read_cnt >= (amt ? amt : 1)) |
1649 | return 1; | 1662 | return 1; |
1650 | 1663 | ||
1651 | return 0; | 1664 | return 0; |
@@ -1681,21 +1694,21 @@ static int copy_from_read_buf(struct tty_struct *tty, | |||
1681 | 1694 | ||
1682 | retval = 0; | 1695 | retval = 0; |
1683 | spin_lock_irqsave(&tty->read_lock, flags); | 1696 | spin_lock_irqsave(&tty->read_lock, flags); |
1684 | n = min(tty->read_cnt, N_TTY_BUF_SIZE - tty->read_tail); | 1697 | n = min(ldata->read_cnt, N_TTY_BUF_SIZE - ldata->read_tail); |
1685 | n = min(*nr, n); | 1698 | n = min(*nr, n); |
1686 | spin_unlock_irqrestore(&tty->read_lock, flags); | 1699 | spin_unlock_irqrestore(&tty->read_lock, flags); |
1687 | if (n) { | 1700 | if (n) { |
1688 | retval = copy_to_user(*b, &tty->read_buf[tty->read_tail], n); | 1701 | retval = copy_to_user(*b, &ldata->read_buf[ldata->read_tail], n); |
1689 | n -= retval; | 1702 | n -= retval; |
1690 | is_eof = n == 1 && | 1703 | is_eof = n == 1 && |
1691 | tty->read_buf[tty->read_tail] == EOF_CHAR(tty); | 1704 | ldata->read_buf[ldata->read_tail] == EOF_CHAR(tty); |
1692 | tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n, | 1705 | tty_audit_add_data(tty, &ldata->read_buf[ldata->read_tail], n, |
1693 | ldata->icanon); | 1706 | ldata->icanon); |
1694 | spin_lock_irqsave(&tty->read_lock, flags); | 1707 | spin_lock_irqsave(&tty->read_lock, flags); |
1695 | tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1); | 1708 | ldata->read_tail = (ldata->read_tail + n) & (N_TTY_BUF_SIZE-1); |
1696 | tty->read_cnt -= n; | 1709 | ldata->read_cnt -= n; |
1697 | /* Turn single EOF into zero-length read */ | 1710 | /* Turn single EOF into zero-length read */ |
1698 | if (L_EXTPROC(tty) && ldata->icanon && is_eof && !tty->read_cnt) | 1711 | if (L_EXTPROC(tty) && ldata->icanon && is_eof && !ldata->read_cnt) |
1699 | n = 0; | 1712 | n = 0; |
1700 | spin_unlock_irqrestore(&tty->read_lock, flags); | 1713 | spin_unlock_irqrestore(&tty->read_lock, flags); |
1701 | *b += n; | 1714 | *b += n; |
@@ -1878,22 +1891,22 @@ do_it_again: | |||
1878 | if (ldata->icanon && !L_EXTPROC(tty)) { | 1891 | if (ldata->icanon && !L_EXTPROC(tty)) { |
1879 | /* N.B. avoid overrun if nr == 0 */ | 1892 | /* N.B. avoid overrun if nr == 0 */ |
1880 | spin_lock_irqsave(&tty->read_lock, flags); | 1893 | spin_lock_irqsave(&tty->read_lock, flags); |
1881 | while (nr && tty->read_cnt) { | 1894 | while (nr && ldata->read_cnt) { |
1882 | int eol; | 1895 | int eol; |
1883 | 1896 | ||
1884 | eol = test_and_clear_bit(tty->read_tail, | 1897 | eol = test_and_clear_bit(ldata->read_tail, |
1885 | ldata->read_flags); | 1898 | ldata->read_flags); |
1886 | c = tty->read_buf[tty->read_tail]; | 1899 | c = ldata->read_buf[ldata->read_tail]; |
1887 | tty->read_tail = ((tty->read_tail+1) & | 1900 | ldata->read_tail = ((ldata->read_tail+1) & |
1888 | (N_TTY_BUF_SIZE-1)); | 1901 | (N_TTY_BUF_SIZE-1)); |
1889 | tty->read_cnt--; | 1902 | ldata->read_cnt--; |
1890 | if (eol) { | 1903 | if (eol) { |
1891 | /* this test should be redundant: | 1904 | /* this test should be redundant: |
1892 | * we shouldn't be reading data if | 1905 | * we shouldn't be reading data if |
1893 | * canon_data is 0 | 1906 | * canon_data is 0 |
1894 | */ | 1907 | */ |
1895 | if (--tty->canon_data < 0) | 1908 | if (--ldata->canon_data < 0) |
1896 | tty->canon_data = 0; | 1909 | ldata->canon_data = 0; |
1897 | } | 1910 | } |
1898 | spin_unlock_irqrestore(&tty->read_lock, flags); | 1911 | spin_unlock_irqrestore(&tty->read_lock, flags); |
1899 | 1912 | ||
@@ -2111,15 +2124,15 @@ static unsigned long inq_canon(struct tty_struct *tty) | |||
2111 | struct n_tty_data *ldata = tty->disc_data; | 2124 | struct n_tty_data *ldata = tty->disc_data; |
2112 | int nr, head, tail; | 2125 | int nr, head, tail; |
2113 | 2126 | ||
2114 | if (!tty->canon_data) | 2127 | if (!ldata->canon_data) |
2115 | return 0; | 2128 | return 0; |
2116 | head = tty->canon_head; | 2129 | head = ldata->canon_head; |
2117 | tail = tty->read_tail; | 2130 | tail = ldata->read_tail; |
2118 | nr = (head - tail) & (N_TTY_BUF_SIZE-1); | 2131 | nr = (head - tail) & (N_TTY_BUF_SIZE-1); |
2119 | /* Skip EOF-chars.. */ | 2132 | /* Skip EOF-chars.. */ |
2120 | while (head != tail) { | 2133 | while (head != tail) { |
2121 | if (test_bit(tail, ldata->read_flags) && | 2134 | if (test_bit(tail, ldata->read_flags) && |
2122 | tty->read_buf[tail] == __DISABLED_CHAR) | 2135 | ldata->read_buf[tail] == __DISABLED_CHAR) |
2123 | nr--; | 2136 | nr--; |
2124 | tail = (tail+1) & (N_TTY_BUF_SIZE-1); | 2137 | tail = (tail+1) & (N_TTY_BUF_SIZE-1); |
2125 | } | 2138 | } |
@@ -2129,6 +2142,7 @@ static unsigned long inq_canon(struct tty_struct *tty) | |||
2129 | static int n_tty_ioctl(struct tty_struct *tty, struct file *file, | 2142 | static int n_tty_ioctl(struct tty_struct *tty, struct file *file, |
2130 | unsigned int cmd, unsigned long arg) | 2143 | unsigned int cmd, unsigned long arg) |
2131 | { | 2144 | { |
2145 | struct n_tty_data *ldata = tty->disc_data; | ||
2132 | int retval; | 2146 | int retval; |
2133 | 2147 | ||
2134 | switch (cmd) { | 2148 | switch (cmd) { |
@@ -2136,7 +2150,7 @@ static int n_tty_ioctl(struct tty_struct *tty, struct file *file, | |||
2136 | return put_user(tty_chars_in_buffer(tty), (int __user *) arg); | 2150 | return put_user(tty_chars_in_buffer(tty), (int __user *) arg); |
2137 | case TIOCINQ: | 2151 | case TIOCINQ: |
2138 | /* FIXME: Locking */ | 2152 | /* FIXME: Locking */ |
2139 | retval = tty->read_cnt; | 2153 | retval = ldata->read_cnt; |
2140 | if (L_ICANON(tty)) | 2154 | if (L_ICANON(tty)) |
2141 | retval = inq_canon(tty); | 2155 | retval = inq_canon(tty); |
2142 | return put_user(retval, (unsigned int __user *) arg); | 2156 | return put_user(retval, (unsigned int __user *) arg); |