aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ppp_channel.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/ppp_channel.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/ppp_channel.h')
-rw-r--r--include/linux/ppp_channel.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h
new file mode 100644
index 000000000000..a942892d6dfe
--- /dev/null
+++ b/include/linux/ppp_channel.h
@@ -0,0 +1,81 @@
1#ifndef _PPP_CHANNEL_H_
2#define _PPP_CHANNEL_H_
3/*
4 * Definitions for the interface between the generic PPP code
5 * and a PPP channel.
6 *
7 * A PPP channel provides a way for the generic PPP code to send
8 * and receive packets over some sort of communications medium.
9 * Packets are stored in sk_buffs and have the 2-byte PPP protocol
10 * number at the start, but not the address and control bytes.
11 *
12 * Copyright 1999 Paul Mackerras.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version
17 * 2 of the License, or (at your option) any later version.
18 *
19 * ==FILEVERSION 20000322==
20 */
21
22#include <linux/list.h>
23#include <linux/skbuff.h>
24#include <linux/poll.h>
25
26struct ppp_channel;
27
28struct ppp_channel_ops {
29 /* Send a packet (or multilink fragment) on this channel.
30 Returns 1 if it was accepted, 0 if not. */
31 int (*start_xmit)(struct ppp_channel *, struct sk_buff *);
32 /* Handle an ioctl call that has come in via /dev/ppp. */
33 int (*ioctl)(struct ppp_channel *, unsigned int, unsigned long);
34};
35
36struct ppp_channel {
37 void *private; /* channel private data */
38 struct ppp_channel_ops *ops; /* operations for this channel */
39 int mtu; /* max transmit packet size */
40 int hdrlen; /* amount of headroom channel needs */
41 void *ppp; /* opaque to channel */
42 /* the following are not used at present */
43 int speed; /* transfer rate (bytes/second) */
44 int latency; /* overhead time in milliseconds */
45};
46
47#ifdef __KERNEL__
48/* Called by the channel when it can send some more data. */
49extern void ppp_output_wakeup(struct ppp_channel *);
50
51/* Called by the channel to process a received PPP packet.
52 The packet should have just the 2-byte PPP protocol header. */
53extern void ppp_input(struct ppp_channel *, struct sk_buff *);
54
55/* Called by the channel when an input error occurs, indicating
56 that we may have missed a packet. */
57extern void ppp_input_error(struct ppp_channel *, int code);
58
59/* Attach a channel to a given PPP unit. */
60extern int ppp_register_channel(struct ppp_channel *);
61
62/* Detach a channel from its PPP unit (e.g. on hangup). */
63extern void ppp_unregister_channel(struct ppp_channel *);
64
65/* Get the channel number for a channel */
66extern int ppp_channel_index(struct ppp_channel *);
67
68/* Get the unit number associated with a channel, or -1 if none */
69extern int ppp_unit_number(struct ppp_channel *);
70
71/*
72 * SMP locking notes:
73 * The channel code must ensure that when it calls ppp_unregister_channel,
74 * nothing is executing in any of the procedures above, for that
75 * channel. The generic layer will ensure that nothing is executing
76 * in the start_xmit and ioctl routines for the channel by the time
77 * that ppp_unregister_channel returns.
78 */
79
80#endif /* __KERNEL__ */
81#endif