summaryrefslogtreecommitdiffstats
path: root/c/src/exec/libnetworking/net/if_pppvar.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-01-31 21:42:11 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-01-31 21:42:11 +0000
commit0286b9f6145f9664f6b0e196e24daee8be46b538 (patch)
tree5cdf87997238653f4083fe1c1326213040183044 /c/src/exec/libnetworking/net/if_pppvar.h
parent2002-01-31 Ralf Corsepius <corsepiu@faw.uni-ulm.de> (diff)
downloadrtems-0286b9f6145f9664f6b0e196e24daee8be46b538.tar.bz2
2001-01-31 Mike Siers <mikes@poliac.com>
* Nice Update of PPPD support which eliminates the requiremetn that drivers be in the termios TASK_DRIVEN mode. Mike did significant testing and reports that it seems to be more stable and handle larger packets better. This patch replaces the termios tasks with more general pppd network driver tasks. The functions pppinput() and pppstart() get called from the interrupt service routine. * Makefile.am, configure.ac, net/Makefile.am, net/bpf.h, net/ethernet.h, net/if.c, net/if.h, net/if_arp.h, net/if_dl.h, net/if_ethersubr.c, net/if_llc.h, net/if_loop.c, net/if_ppp.h, net/if_pppvar.h, net/if_types.h, net/netisr.h, net/ppp-comp.h, net/ppp_defs.h, net/pppcompress.h, net/radix.c, net/radix.h, net/raw_cb.c, net/raw_cb.h, net/raw_usrreq.c, net/route.c, net/route.h, net/rtsock.c, pppd/Makefile.am, pppd/README, pppd/STATUS, pppd/auth.c, pppd/cbcp.c, pppd/ccp.c, pppd/ccp.h, pppd/chap.c, pppd/chap.h, pppd/chap_ms.c, pppd/chap_ms.h, pppd/chat.c, pppd/demand.c, pppd/fsm.c, pppd/fsm.h, pppd/ipcp.c, pppd/ipcp.h, pppd/ipxcp.c, pppd/ipxcp.h, pppd/lcp.c, pppd/lcp.h, pppd/magic.c, pppd/magic.h, pppd/options.c, pppd/patchlevel.h, pppd/pathnames.h, pppd/pppd.8, pppd/pppd.h, pppd/rtemsmain.c, pppd/rtemspppd.c, pppd/rtemspppd.h, pppd/sys-rtems.c, pppd/upap.c, pppd/upap.h, pppd/utils.c, pppd/example/README, pppd/example/netconfig.h, wrapup/Makefile.am: Modified. * net/bsd-comp.c, net/if_ppp.c, net/ppp-deflate.c, net/ppp.h, net/ppp_tty.c, net/pppcompress.c, net/zlib.c, net/zlib.h: New file. * modem/, modem/.cvsignore, modem/Makefile.am, modem/ppp.c, modem/ppp.h, modem/ppp_tty.c, modem/pppcompress.c: Subdirectory removed.
Diffstat (limited to 'c/src/exec/libnetworking/net/if_pppvar.h')
-rw-r--r--c/src/exec/libnetworking/net/if_pppvar.h62
1 files changed, 45 insertions, 17 deletions
diff --git a/c/src/exec/libnetworking/net/if_pppvar.h b/c/src/exec/libnetworking/net/if_pppvar.h
index 6eb45a6afb..374fac3b11 100644
--- a/c/src/exec/libnetworking/net/if_pppvar.h
+++ b/c/src/exec/libnetworking/net/if_pppvar.h
@@ -45,8 +45,10 @@
* Supported network protocols. These values are used for
* indexing sc_npmode.
*/
-#define NP_IP 0 /* Internet Protocol */
-#define NUM_NP 1 /* Number of NPs. */
+#define NP_IP 0 /* Internet Protocol */
+#define NUM_NP 1 /* Number of NPs. */
+#define NUM_MBUFQ 64
+
/*
* Structure describing each ppp unit.
@@ -63,7 +65,6 @@ struct ppp_softc {
struct ifqueue sc_rawq; /* received packets */
struct ifqueue sc_inq; /* queue of input packets for daemon */
struct ifqueue sc_fastq; /* interactive output packet q */
- struct mbuf *sc_togo; /* output packet ready to go */
struct mbuf *sc_npqueue; /* output packets not to be sent yet */
struct mbuf **sc_npqtail; /* ptr to last next ptr in npqueue */
struct pppstat sc_stats; /* count of bytes/pkts sent/rcvd */
@@ -84,18 +85,30 @@ struct ppp_softc {
#endif
/* Device-dependent part for async lines. */
- ext_accm sc_asyncmap; /* async control character map */
- u_long sc_rasyncmap; /* receive async control char map */
- struct mbuf *sc_outm; /* mbuf chain currently being output */
- struct mbuf *sc_m; /* pointer to input mbuf chain */
- struct mbuf *sc_mc; /* pointer to current input mbuf */
- char *sc_mp; /* ptr to next char in input mbuf */
- short sc_ilen; /* length of input packet so far */
- u_short sc_fcs; /* FCS so far (input) */
- u_short sc_outfcs; /* FCS so far for output packet */
- u_char sc_rawin[16]; /* chars as received */
- int sc_rawin_count; /* # in sc_rawin */
- rtems_id sem_id; /* ID of comm semaphore */
+ ext_accm sc_asyncmap; /* async control character map */
+ u_long sc_rasyncmap; /* receive async control char map */
+ struct mbuf *sc_outm; /* mbuf chain currently being output */
+ struct mbuf *sc_outmc; /* mbuf currently being output */
+ struct mbuf *sc_m; /* pointer to input mbuf chain */
+ struct mbuf *sc_mc; /* pointer to current input mbuf */
+ char *sc_mp; /* ptr to next char in input mbuf */
+ short sc_ilen; /* length of input packet so far */
+ u_short sc_fcs; /* FCS so far (input) */
+ u_char sc_rawin[16]; /* chars as received */
+ int sc_rawin_count; /* # in sc_rawin */
+ u_short sc_outfcs; /* FCS so far for output packet */
+
+ struct ifqueue sc_freeq; /* free packets */
+ short sc_outoff; /* output packet byte offset */
+ short sc_outflag; /* output status flag */
+ short sc_outlen; /* length of output packet */
+ short sc_outfcslen; /* length of output fcs data */
+ u_char sc_outfcsbuf[8]; /* output packet fcs buffer */
+ u_char *sc_outbuf; /* pointer to output data */
+
+ rtems_id sc_rxtask;
+ rtems_id sc_txtask;
+ rtems_id sc_pppdtask;
};
struct ppp_softc ppp_softc[NPPP];
@@ -106,6 +119,21 @@ int pppoutput __P((struct ifnet *, struct mbuf *,
struct sockaddr *, struct rtentry *));
int pppioctl __P((struct ppp_softc *sc, int cmd, caddr_t data,
int flag, struct proc *p));
-void ppp_restart __P((struct ppp_softc *sc));
-void ppppktin __P((struct ppp_softc *sc, struct mbuf *m, int lost));
struct mbuf *ppp_dequeue __P((struct ppp_softc *sc));
+u_short pppfcs __P((u_short fcs, u_char *cp, int len));
+void pppallocmbuf __P((struct ppp_softc *sc, struct mbuf **mp));
+
+
+/* define event values */
+#define RX_PACKET RTEMS_EVENT_1
+#define RX_MBUF RTEMS_EVENT_2
+#define RX_EMPTY RTEMS_EVENT_3
+#define TX_PACKET RTEMS_EVENT_1
+#define TX_TRANSMIT RTEMS_EVENT_2
+#define PPPD_EVENT RTEMS_EVENT_31
+
+/* define out flag values */
+#define SC_TX_BUSY 0x0001
+#define SC_TX_FCS 0x0002
+#define SC_TX_ESCAPE 0x0004
+#define SC_TX_PENDING 0x0010