Index: src/api/tcpip.c =================================================================== RCS file: /sources/lwip/lwip/src/api/tcpip.c,v retrieving revision 1.53 diff -u -0 -p -r1.53 tcpip.c --- src/api/tcpip.c 17 Aug 2007 10:46:07 -0000 1.53 +++ src/api/tcpip.c 20 Aug 2007 19:56:13 -0000 @@ -208 +207,0 @@ igmp_timer(void *arg) -#if ETHARP_TCPIP_ETHINPUT @@ -231 +230 @@ ethernet_input(struct pbuf *p, struct ne -#endif +#endif /* ETHARP_TRUST_IP_MAC */ @@ -237,2 +236 @@ ethernet_input(struct pbuf *p, struct ne - } - else + } else { @@ -240,0 +239 @@ ethernet_input(struct pbuf *p, struct ne + } @@ -251,0 +251 @@ ethernet_input(struct pbuf *p, struct ne + @@ -265 +264,0 @@ ethernet_input(struct pbuf *p, struct ne -#endif /* ETHARP_TCPIP_ETHINPUT */ @@ -315 +313,0 @@ tcpip_thread(void *arg) -#if ETHARP_TCPIP_INPUT || ETHARP_TCPIP_ETHINPUT @@ -318 +316 @@ tcpip_thread(void *arg) - msg->msg.inp.f(msg->msg.inp.p, msg->msg.inp.netif); + ethernet_input(msg->msg.inp.p, msg->msg.inp.netif); @@ -321 +318,0 @@ tcpip_thread(void *arg) -#endif /* ETHARP_TCPIP_INPUT || ETHARP_TCPIP_ETHINPUT */ @@ -334,0 +332 @@ tcpip_thread(void *arg) + @@ -343,0 +342 @@ tcpip_thread(void *arg) + @@ -350 +348,0 @@ tcpip_thread(void *arg) -#if ETHARP_TCPIP_INPUT @@ -352 +350 @@ tcpip_thread(void *arg) - * Pass a received IP packet to tcpip_thread for input processing + * Pass a received packet to tcpip_thread for input processing @@ -354 +352 @@ tcpip_thread(void *arg) - * @param p the recevied packet, p->payload pointing to the IP header + * @param p the received packet, p->payload pointing to the IP header @@ -369 +366,0 @@ tcpip_input(struct pbuf *p, struct netif - msg->msg.inp.f = ip_input; @@ -378,36 +374,0 @@ tcpip_input(struct pbuf *p, struct netif -err_t -tcpip_input_callback(struct pbuf *p, struct netif *inp, err_t (*f)(struct pbuf *, struct netif *)) -{ - struct tcpip_msg *msg; - - if (mbox != SYS_MBOX_NULL) { - msg = memp_malloc(MEMP_TCPIP_MSG_INPKT); - if (msg == NULL) { - return ERR_MEM; - } - - msg->type = TCPIP_MSG_INPKT; - msg->msg.inp.f = f; - msg->msg.inp.p = p; - msg->msg.inp.netif = inp; - sys_mbox_post(mbox, msg); - return ERR_OK; - } - return ERR_VAL; -} -#endif /* ETHARP_TCPIP_INPUT */ - -#if ETHARP_TCPIP_ETHINPUT -/** - * Pass a received IP packet to tcpip_thread for input processing - * - * @param p the recevied packet, p->payload pointing to the ethernet header - * @param netif the network interface on which the packet was received - */ -err_t -tcpip_ethinput(struct pbuf *p, struct netif *inp) -{ - return tcpip_input_callback(p, inp, ethernet_input); -} -#endif /* ETHARP_TCPIP_ETHINPUT */ - Index: src/include/lwip/opt.h =================================================================== RCS file: /sources/lwip/lwip/src/include/lwip/opt.h,v retrieving revision 1.85 diff -u -0 -p -r1.85 opt.h --- src/include/lwip/opt.h 20 Aug 2007 18:53:33 -0000 1.85 +++ src/include/lwip/opt.h 20 Aug 2007 19:53:15 -0000 @@ -320,21 +319,0 @@ - * ETHARP_TCPIP_INPUT==1: Driver can pass packets to tcpip_input after it - * has processed any incoming ARP packets. Incoming IP packets are then - * processed in tcpip_thread context. It is recommended that you use - * ETHARP_TCPIP_ETHINPUT instead; see that option for explanation. - * (only useful if you use tcpip.c) - */ -#ifndef ETHARP_TCPIP_INPUT -#define ETHARP_TCPIP_INPUT 1 -#endif - -/** - * ETHARP_TCPIP_ETHINPUT==1: Driver passes *all* packets to tcpip_ethinput - * (and not tcpip_input). IP and ARP packets will be both processed inside - * tcpip_thread context. The aim is to protect ARP layer against concurrent - * access. Older ports have to be updated to use tcpip_ethinput. - */ -#ifndef ETHARP_TCPIP_ETHINPUT -#define ETHARP_TCPIP_ETHINPUT 1 -#endif - -/** Index: src/include/lwip/tcpip.h =================================================================== RCS file: /sources/lwip/lwip/src/include/lwip/tcpip.h,v retrieving revision 1.15 diff -u -0 -p -r1.15 tcpip.h --- src/include/lwip/tcpip.h 17 Aug 2007 02:46:44 -0000 1.15 +++ src/include/lwip/tcpip.h 20 Aug 2007 19:54:12 -0000 @@ -67 +66,0 @@ err_t tcpip_apimsg_lock(struct api_msg * -#if ETHARP_TCPIP_INPUT @@ -69,6 +67,0 @@ err_t tcpip_input(struct pbuf *p, struct -err_t tcpip_input_callback(struct pbuf *p, struct netif *inp, err_t (*f)(struct pbuf *, struct netif *)); -#endif /* ETHARP_TCPIP_INPUT */ - -#if ETHARP_TCPIP_ETHINPUT -err_t tcpip_ethinput(struct pbuf *p, struct netif *inp); -#endif /* ETHARP_TCPIP_ETHINPUT */ @@ -89 +81,0 @@ enum tcpip_msg_type { -#if ETHARP_TCPIP_INPUT || ETHARP_TCPIP_ETHINPUT @@ -91 +82,0 @@ enum tcpip_msg_type { -#endif /* ETHARP_TCPIP_INPUT || ETHARP_TCPIP_ETHINPUT */ @@ -110 +100,0 @@ struct tcpip_msg { - err_t (*f)(struct pbuf *, struct netif *); Index: src/netif/ethernetif.c =================================================================== RCS file: /sources/lwip/lwip/src/netif/ethernetif.c,v retrieving revision 1.41 diff -u -0 -p -r1.41 ethernetif.c --- src/netif/ethernetif.c 17 Aug 2007 00:30:28 -0000 1.41 +++ src/netif/ethernetif.c 20 Aug 2007 19:54:47 -0000 @@ -239 +238,0 @@ ethernetif_input(struct netif *netif) -#if ETHARP_TCPIP_ETHINPUT @@ -242,0 +242,4 @@ ethernetif_input(struct netif *netif) +#if PPPOE_SUPPORT + case ETHTYPE_PPPOEDISC: + case ETHTYPE_PPPOE: +#endif /* PPPOE_SUPPORT */ @@ -250,49 +252,0 @@ ethernetif_input(struct netif *netif) - -#else /* ETHARP_TCPIP_ETHINPUT */ -#if ETHARP_TCPIP_INPUT - - /* IP packet? */ - case ETHTYPE_IP: -#if ETHARP_TRUST_IP_MAC - /* update ARP table */ - /* In multithreaded environments, watch out if using etharp_ip_input() - * in another thread than the main tcpip_thread, since the ARP table - * is not locked from concurrent access!!! - * Use ETHARP_TCPIP_ETHINPUT=1 instead so ARP processing is done inside - * the thread context of tcpip_thread. - */ - etharp_ip_input(netif, p); -#endif /* ETHARP_TRUST_IP_MAC */ - /* skip Ethernet header */ - pbuf_header(p, -sizeof(struct eth_hdr)); - /* pass to network layer */ - if (netif->input(p, netif)!=ERR_OK) - { LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n")); - pbuf_free(p); - p = NULL; - } - break; - - /* ARP packet? */ - case ETHTYPE_ARP: - /* pass p to ARP module */ - /* In multithreaded environments, watch out if using etharp_ip_input() - * in another thread than the main tcpip_thread, since the ARP table - * is not locked from concurrent access!!! - * Use ETHARP_TCPIP_ETHINPUT=1 instead so ARP processing is done inside - * the thread context of tcpip_thread. - */ - etharp_arp_input(netif, ethernetif->ethaddr, p); - break; - -#endif /* ETHARP_TCPIP_INPUT */ -#endif /* ETHARP_TCPIP_ETHINPUT */ - -#if PPPOE_SUPPORT - case ETHTYPE_PPPOEDISC: /* PPP Over Ethernet Discovery Stage */ - pppoe_disc_input(netif, p); - break; - case ETHTYPE_PPPOE: /* PPP Over Ethernet Session Stage */ - pppoe_data_input(netif, p); - break; -#endif /* PPPOE_SUPPORT */