summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
86058e0)
Remove leftovers from old lwIP ethernetif ports and
only use the new API.
The same processing is done in upper layers when using tcpip_input as
the input function of netif.
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4919
38d2e660-2303-0410-9eaa-
f027e97ec537
/* move received packet into a new pbuf */
p = low_level_input(netif);
/* no packet could be read, silently ignore this */
/* move received packet into a new pbuf */
p = low_level_input(netif);
/* no packet could be read, silently ignore this */
- if (p == NULL) return;
-
+ if (p == NULL)
+ return;
+ /* points to packet payload, which starts with an Ethernet header */
ethhdr = p->payload;
switch (htons(ethhdr->type))
{
ethhdr = p->payload;
switch (htons(ethhdr->type))
{
- case ETHTYPE_ARP:
- etharp_arp_input(netif, ethernetif->ethaddr, p);
- break;
-
+ /* IP or ARP packet? */
-#if DHCP_DOES_ARP_CHECK
- etharp_ip_input(netif, p);
-#endif
- pbuf_header(p, (int16_t) - sizeof(struct eth_hdr));
-
+ case ETHTYPE_ARP:
+#if PPPOE_SUPPORT
+ /* PPPoE packet? */
+ case ETHTYPE_PPPOEDISC:
+ case ETHTYPE_PPPOE:
+#endif /* PPPOE_SUPPORT */
+ /* full packet send to tcpip_thread to process */
if (netif->input(p, netif) != ERR_OK)
{
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
if (netif->input(p, netif) != ERR_OK)
{
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
default:
pbuf_free(p);
p = NULL;
default:
pbuf_free(p);
p = NULL;
static NORETURN void ethernetif_loop(void *arg)
{
struct netif *netif = (struct netif *)arg;
static NORETURN void ethernetif_loop(void *arg)
{
struct netif *netif = (struct netif *)arg;