]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/ppp_generic-ppp-2.4.3_multilink.patch
prepared build of dm9601 module
[people/pmueller/ipfire-2.x.git] / src / patches / ppp_generic-ppp-2.4.3_multilink.patch
1 diff -urN linux-2.5/drivers/net/ppp_generic.c pmac-2.5/drivers/net/ppp_generic.c
2 --- linux-2.5/drivers/net/ppp_generic.c 2004-10-29 07:03:21.000000000 +1000
3 +++ pmac-2.5/drivers/net/ppp_generic.c 2004-11-15 08:53:54.000000000 +1100
4 @@ -19,7 +19,7 @@
5 * PPP driver, written by Michael Callahan and Al Longyear, and
6 * subsequently hacked by Paul Mackerras.
7 *
8 - * ==FILEVERSION 20020217==
9 + * ==FILEVERSION 20041108==
10 */
11
12 #include <linux/config.h>
13 @@ -412,6 +412,17 @@
14 ret = 0;
15 if (pf->dead)
16 break;
17 + if (pf->kind == INTERFACE) {
18 + /*
19 + * Return 0 (EOF) on an interface that has no
20 + * channels connected, unless it is looping
21 + * network traffic (demand mode).
22 + */
23 + struct ppp *ppp = PF_TO_PPP(pf);
24 + if (ppp->n_channels == 0
25 + && (ppp->flags & SC_LOOP_TRAFFIC) == 0)
26 + break;
27 + }
28 ret = -EAGAIN;
29 if (file->f_flags & O_NONBLOCK)
30 break;
31 @@ -491,6 +502,14 @@
32 mask |= POLLIN | POLLRDNORM;
33 if (pf->dead)
34 mask |= POLLHUP;
35 + else if (pf->kind == INTERFACE) {
36 + /* see comment in ppp_read */
37 + struct ppp *ppp = PF_TO_PPP(pf);
38 + if (ppp->n_channels == 0
39 + && (ppp->flags & SC_LOOP_TRAFFIC) == 0)
40 + mask |= POLLIN | POLLRDNORM;
41 + }
42 +
43 return mask;
44 }
45
46 @@ -2559,7 +2578,8 @@
47 /* remove it from the ppp unit's list */
48 ppp_lock(ppp);
49 list_del(&pch->clist);
50 - --ppp->n_channels;
51 + if (--ppp->n_channels == 0)
52 + wake_up_interruptible(&ppp->file.rwait);
53 ppp_unlock(ppp);
54 if (atomic_dec_and_test(&ppp->file.refcnt))
55 ppp_destroy_interface(ppp);