From 8694deaabb93ab53d03e9d14d0c24ae48cbb569b Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 10 Jun 2012 21:06:02 +0200 Subject: [PATCH] don't add ppp_pcb_rx to ppp_pcb struct if PPPOS support is disabled --- src/netif/ppp/ppp.c | 2 +- src/netif/ppp/ppp.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index c71ebe20..d5012819 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -200,6 +200,7 @@ struct protent *protocols[] = { NULL }; +#if PPPOS_SUPPORT /* PPP packet parser states. Current state indicates operation yet to be * completed. */ typedef enum { @@ -212,7 +213,6 @@ typedef enum { PDDATA /* Process data byte. */ } ppp_dev_states; -#if PPPOS_SUPPORT #define ESCAPE_P(accm, c) ((accm)[(c) >> 3] & ppp_accm_mask[c & 0x07]) /** RX buffer size: this may be configured smaller! */ diff --git a/src/netif/ppp/ppp.h b/src/netif/ppp/ppp.h index 53264232..c2339d02 100644 --- a/src/netif/ppp/ppp.h +++ b/src/netif/ppp/ppp.h @@ -135,6 +135,7 @@ struct ppp_addrs { ip_addr_t our_ipaddr, his_ipaddr, netmask, dns1, dns2; }; +#if PPPOS_SUPPORT /* * PPP interface RX control block. */ @@ -144,11 +145,10 @@ typedef struct ppp_pcb_rx_s { /** the rx file descriptor */ sio_fd_t fd; /** receive buffer - encoded data is stored here */ -#if PPPOS_SUPPORT && PPP_INPROC_OWNTHREAD +#if PPP_INPROC_OWNTHREAD u_char rxbuf[PPPOS_RX_BUFSIZE]; #endif /* PPPOS_SUPPORT && PPP_INPROC_OWNTHREAD */ -#if PPPOS_SUPPORT /* The input packet. */ struct pbuf *in_head, *in_tail; @@ -157,8 +157,8 @@ typedef struct ppp_pcb_rx_s { ppp_dev_states in_state; /* The input process state. */ char in_escaped; /* Escape next character. */ ext_accm in_accm; /* Async-Ctl-Char-Map for input. */ -#endif /* PPPOS_SUPPORT */ } ppp_pcb_rx; +#endif /* PPPOS_SUPPORT */ /* * PPP interface control block. @@ -166,8 +166,9 @@ typedef struct ppp_pcb_rx_s { typedef struct ppp_pcb_s { ppp_settings settings; int unit; - +#if PPPOS_SUPPORT ppp_pcb_rx rx; +#endif /* PPPOS_SUPPORT */ char open_flag; /* True when in use. */ u8_t phase; /* where the link is at */ u8_t status; /* exit status */