diff --git a/src/api/tcpip.c b/src/api/tcpip.c index a1601bc8..c8cd605f 100644 --- a/src/api/tcpip.c +++ b/src/api/tcpip.c @@ -44,6 +44,7 @@ #include "lwip/memp.h" #include "lwip/pbuf.h" #include "lwip/ip_frag.h" +#include "lwip/tcp.h" #include "lwip/autoip.h" #include "lwip/dhcp.h" #include "lwip/igmp.h" @@ -302,10 +303,12 @@ tcpip_thread(void *arg) while (1) { /* MAIN Loop */ sys_mbox_fetch(mbox, (void *)&msg); switch (msg->type) { +#if LWIP_NETCONN case TCPIP_MSG_API: LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API message %p\n", (void *)msg)); msg->msg.apimsg->function(&(msg->msg.apimsg->msg)); break; +#endif /* LWIP_NETCONN */ case TCPIP_MSG_INPKT: LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: PACKET %p\n", (void *)msg)); @@ -348,7 +351,6 @@ tcpip_thread(void *arg) } } -#if LWIP_ARP /** * Pass a received packet to tcpip_thread for input processing * @@ -375,7 +377,6 @@ tcpip_input(struct pbuf *p, struct netif *inp) } return ERR_VAL; } -#endif /* LWIP_ARP */ /** * Call a specific function in the thread context of @@ -428,6 +429,7 @@ tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg) return ERR_VAL; } +#if LWIP_NETCONN /** * Call the lower part of a netconn_* function * This function is then running in the thread context @@ -470,6 +472,7 @@ tcpip_apimsg_lock(struct api_msg *apimsg) } #endif /* LWIP_TCPIP_CORE_LOCKING */ +#endif /* LWIP_NETCONN */ #if LWIP_NETIF_API #if !LWIP_TCPIP_CORE_LOCKING diff --git a/src/include/lwip/tcpip.h b/src/include/lwip/tcpip.h index ca6e2b58..d920682e 100644 --- a/src/include/lwip/tcpip.h +++ b/src/include/lwip/tcpip.h @@ -63,10 +63,13 @@ extern sys_sem_t lock_tcpip_core; #endif /* LWIP_TCPIP_CORE_LOCKING */ void tcpip_init(void (* tcpip_init_done)(void *), void *arg); + +#if LWIP_NETCONN err_t tcpip_apimsg(struct api_msg *apimsg); #if LWIP_TCPIP_CORE_LOCKING err_t tcpip_apimsg_lock(struct api_msg *apimsg); #endif /* LWIP_TCPIP_CORE_LOCKING */ +#endif /* LWIP_NETCONN */ err_t tcpip_input(struct pbuf *p, struct netif *inp); @@ -82,7 +85,9 @@ err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg); #define tcpip_untimeout(h, arg) tcpip_timeout(0xffffffff, h, arg) enum tcpip_msg_type { +#if LWIP_NETCONN TCPIP_MSG_API, +#endif /* LWIP_NETCONN */ TCPIP_MSG_INPKT, #if LWIP_NETIF_API TCPIP_MSG_NETIFAPI, @@ -95,7 +100,9 @@ struct tcpip_msg { enum tcpip_msg_type type; sys_sem_t *sem; union { +#if LWIP_NETCONN struct api_msg *apimsg; +#endif /* LWIP_NETCONN */ #if LWIP_NETIF_API struct netifapi_msg *netifapimsg; #endif /* LWIP_NETIF_API */