| From: |
| Dan Eble <dane@aiinet.com> |
| To: |
| linux-net <linux-net@vger.kernel.org> |
| Subject: |
| [PATCH] Generic PPP for Generic HDLC [2/3] |
| Date: |
| Tue, 10 Jun 2003 11:43:28 -0400 (EDT) |
This is part 2 of a 3-message set that adds generic PPP support to the
generic HDLC layer. These changes were made in PPC Linux 2.4.21-pre4.
These 3 parts DO NOT include changes to the PPP daemon to enable it to
work with WAN HDLC devices. I shall post those changes to the
linux-ppp email list, under the subject "[PATCH] WAN HDLC Support".
I welcome comments and suggestions, polite or not. Eventually, this
will be used in the real world ;) and I would like it to work
properly.
______________________________________________________________________
Part 1 is a new drivers/net/wan/hdlc_ppp.c. I have included it
verbatim because I think it is easier to read than a patch (since
almost all of it is different from the previous version).
Part 2 patches the following:
* In include/linux/hdlc.h, the PPP state variables have changed
in accordance with the switch from syncppp.c to ppp_generic.
* In drivers/net/wan/Makefile, syncppp.c is no longer required
when CONFIG_HDLC_PPP is defined.
* In include/linux/hdlc/ioctl.h, there is now a structure
(ppp_proto) for retrieving PPP protocol information via
the SIOCWANDEV(IF_GET_PROTO) ioctl.
* In include/linux/if.h, ppp_proto is part of the union used in
SIOCWANDEV.
Part 3 patches the "sethdlc" program to use the new ppp_proto
structure.
--
Dan Eble <dane@aiinet.com> _____ .
| _ |/|
Applied Innovation Inc. | |_| | |
http://www.aiinet.com/ |__/|_|_|
diff -wbBurN linux-GPL.old/drivers/net/wan/Makefile linux-GPL/drivers/net/wan/Makefile
--- linux-GPL.old/drivers/net/wan/Makefile 2003-04-09 09:44:17.000000000 -0400
+++ linux-GPL/drivers/net/wan/Makefile 2003-05-29 15:03:35.000000000 -0400
@@ -88,9 +88,6 @@
obj-$(CONFIG_LAPBETHER) += lapbether.o
obj-$(CONFIG_SBNI) += sbni.o
obj-$(CONFIG_HDLC) += hdlc.o
-ifeq ($(CONFIG_HDLC_PPP),y)
- obj-$(CONFIG_HDLC) += syncppp.o
-endif
obj-$(CONFIG_N2) += n2.o
obj-$(CONFIG_C101) += c101.o
diff -wbBurN linux-GPL.old/include/linux/hdlc/ioctl.h linux-GPL/include/linux/hdlc/ioctl.h
--- linux-GPL.old/include/linux/hdlc/ioctl.h 2003-05-27 09:10:08.000000000 -0400
+++ linux-GPL/include/linux/hdlc/ioctl.h 2003-06-09 10:49:23.000000000 -0400
@@ -45,6 +45,8 @@
unsigned int timeout;
} cisco_proto;
-/* PPP doesn't need any info now - supply length = 0 to ioctl */
+typedef struct {
+ int channel; /* read-only index assigned by generic PPP layer */
+} ppp_proto;
#endif /* __HDLC_IOCTL_H__ */
diff -wbBurN linux-GPL.old/include/linux/hdlc.h linux-GPL/include/linux/hdlc.h
--- linux-GPL.old/include/linux/hdlc.h 2003-04-10 15:14:01.000000000 -0400
+++ linux-GPL/include/linux/hdlc.h 2003-06-09 14:35:31.000000000 -0400
@@ -403,7 +403,7 @@
#include <linux/skbuff.h>
#include <linux/netdevice.h>
-#include <net/syncppp.h>
+#include <linux/ppp_channel.h>
#include <linux/hdlc/ioctl.h>
#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */
@@ -576,10 +576,12 @@
}raw_hdlc;
struct {
- struct ppp_device pppdev;
- struct ppp_device *syncppp_ptr;
+ ppp_proto settings;
+
+ unsigned int flags;
int (*old_change_mtu)(struct net_device *dev,
int new_mtu);
+ struct ppp_channel chan; /* interface to generic PPP */
}ppp;
}state;
}hdlc_device;
diff -wbBurN linux-GPL.old/include/linux/if.h linux-GPL/include/linux/if.h
--- linux-GPL.old/include/linux/if.h 2003-04-16 08:57:02.000000000 -0400
+++ linux-GPL/include/linux/if.h 2003-06-09 14:35:31.000000000 -0400
@@ -110,6 +110,7 @@
fr_proto *fr;
fr_proto_pvc *fr_pvc;
fr_proto_pvc_info *fr_pvc_info;
+ ppp_proto *ppp;
/* interface settings */
sync_serial_settings *sync;
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html