diff options
Diffstat (limited to 'drivers/net/ppp_async.c')
-rw-r--r-- | drivers/net/ppp_async.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 6de8399d6dd9..6c2e8fa0ca31 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c | |||
@@ -31,12 +31,13 @@ | |||
31 | #include <linux/spinlock.h> | 31 | #include <linux/spinlock.h> |
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <linux/jiffies.h> | 33 | #include <linux/jiffies.h> |
34 | #include <linux/slab.h> | ||
34 | #include <asm/uaccess.h> | 35 | #include <asm/uaccess.h> |
35 | #include <asm/string.h> | 36 | #include <asm/string.h> |
36 | 37 | ||
37 | #define PPP_VERSION "2.4.2" | 38 | #define PPP_VERSION "2.4.2" |
38 | 39 | ||
39 | #define OBUFSIZE 256 | 40 | #define OBUFSIZE 4096 |
40 | 41 | ||
41 | /* Structure for storing local state. */ | 42 | /* Structure for storing local state. */ |
42 | struct asyncppp { | 43 | struct asyncppp { |
@@ -337,10 +338,7 @@ ppp_asynctty_poll(struct tty_struct *tty, struct file *file, poll_table *wait) | |||
337 | return 0; | 338 | return 0; |
338 | } | 339 | } |
339 | 340 | ||
340 | /* | 341 | /* May sleep, don't call from interrupt level or with interrupts disabled */ |
341 | * This can now be called from hard interrupt level as well | ||
342 | * as soft interrupt level or mainline. | ||
343 | */ | ||
344 | static void | 342 | static void |
345 | ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, | 343 | ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf, |
346 | char *cflags, int count) | 344 | char *cflags, int count) |
@@ -561,8 +559,8 @@ ppp_async_encode(struct asyncppp *ap) | |||
561 | * Start of a new packet - insert the leading FLAG | 559 | * Start of a new packet - insert the leading FLAG |
562 | * character if necessary. | 560 | * character if necessary. |
563 | */ | 561 | */ |
564 | if (islcp || flag_time == 0 | 562 | if (islcp || flag_time == 0 || |
565 | || time_after_eq(jiffies, ap->last_xmit + flag_time)) | 563 | time_after_eq(jiffies, ap->last_xmit + flag_time)) |
566 | *buf++ = PPP_FLAG; | 564 | *buf++ = PPP_FLAG; |
567 | ap->last_xmit = jiffies; | 565 | ap->last_xmit = jiffies; |
568 | fcs = PPP_INITFCS; | 566 | fcs = PPP_INITFCS; |
@@ -699,8 +697,8 @@ ppp_async_push(struct asyncppp *ap) | |||
699 | */ | 697 | */ |
700 | clear_bit(XMIT_BUSY, &ap->xmit_flags); | 698 | clear_bit(XMIT_BUSY, &ap->xmit_flags); |
701 | /* any more work to do? if not, exit the loop */ | 699 | /* any more work to do? if not, exit the loop */ |
702 | if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) | 700 | if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) || |
703 | || (!tty_stuffed && ap->tpkt))) | 701 | (!tty_stuffed && ap->tpkt))) |
704 | break; | 702 | break; |
705 | /* more work to do, see if we can do it now */ | 703 | /* more work to do, see if we can do it now */ |
706 | if (test_and_set_bit(XMIT_BUSY, &ap->xmit_flags)) | 704 | if (test_and_set_bit(XMIT_BUSY, &ap->xmit_flags)) |
@@ -757,8 +755,8 @@ scan_ordinary(struct asyncppp *ap, const unsigned char *buf, int count) | |||
757 | 755 | ||
758 | for (i = 0; i < count; ++i) { | 756 | for (i = 0; i < count; ++i) { |
759 | c = buf[i]; | 757 | c = buf[i]; |
760 | if (c == PPP_ESCAPE || c == PPP_FLAG | 758 | if (c == PPP_ESCAPE || c == PPP_FLAG || |
761 | || (c < 0x20 && (ap->raccm & (1 << c)) != 0)) | 759 | (c < 0x20 && (ap->raccm & (1 << c)) != 0)) |
762 | break; | 760 | break; |
763 | } | 761 | } |
764 | return i; | 762 | return i; |