NXP LPC1768 Ethernet driver for lwip and CMSIS-RTOS

Dependents:   EthernetInterface EthernetInterface EthernetInterface_RSF EthernetInterface ... more

Legacy Networking Libraries

This is an mbed 2 networking library. For mbed 5, the networking libraries have been revised to better support additional network stacks and thread safety here.

This library is based on the code of the NXP LPC port of the Lightweight TCP/IP Stack

Copyright(C) 2011, NXP Semiconductor
All rights reserved.

Software that is described herein is for illustrative purposes only
which provides customers with programming information regarding the
products. This software is supplied "AS IS" without any warranties.
NXP Semiconductors assumes no responsibility or liability for the
use of the software, conveys no license or title under any patent,
copyright, or mask work right to the product. NXP Semiconductors
reserves the right to make changes in the software without
notification. NXP Semiconductors also make no representation or
warranty that such application will be suitable for the specified
use without further testing or modification.

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Tue Nov 10 09:31:00 2015 +0000
Parent:
28:72f8b097fbf3
Child:
30:da4b2487ee7b
Commit message:
Synchronized with git revision 7218418919aeaf775fb8d386ea7ee0dfc0c80ff9

Full URL: https://github.com/mbedmicro/mbed/commit/7218418919aeaf775fb8d386ea7ee0dfc0c80ff9/

DISCO_F469NI - add disco F469NI support

Changed in this revision

arch/TARGET_RZ_A1H/rza1_emac.c Show annotated file Show diff for this revision Revisions of this file
--- a/arch/TARGET_RZ_A1H/rza1_emac.c	Thu Aug 13 10:45:29 2015 +0100
+++ b/arch/TARGET_RZ_A1H/rza1_emac.c	Tue Nov 10 09:31:00 2015 +0000
@@ -24,33 +24,38 @@
     struct eth_hdr *ethhdr;
     u16_t          recv_size;
     struct pbuf    *p;
+    int            cnt;
 
     while (1) {
         sys_arch_sem_wait(&recv_ready_sem, 0);
-        recv_size = ethernet_receive();
-        if (recv_size != 0) {
-            p = pbuf_alloc(PBUF_RAW, recv_size, PBUF_RAM);
-            if (p != NULL) {
-                (void)ethernet_read((char *)p->payload, p->len);
-                ethhdr = p->payload;
-                switch (htons(ethhdr->type)) {
-                    case ETHTYPE_IP:
-                    case ETHTYPE_ARP:
+        for (cnt = 0; cnt < 16; cnt++) {
+            recv_size = ethernet_receive();
+            if (recv_size != 0) {
+                p = pbuf_alloc(PBUF_RAW, recv_size, PBUF_RAM);
+                if (p != NULL) {
+                    (void)ethernet_read((char *)p->payload, p->len);
+                    ethhdr = p->payload;
+                    switch (htons(ethhdr->type)) {
+                        case ETHTYPE_IP:
+                        case ETHTYPE_ARP:
 #if PPPOE_SUPPORT
-                    case ETHTYPE_PPPOEDISC:
-                    case ETHTYPE_PPPOE:
+                        case ETHTYPE_PPPOEDISC:
+                        case ETHTYPE_PPPOE:
 #endif /* PPPOE_SUPPORT */
-                        /* full packet send to tcpip_thread to process */
-                        if (netif->input(p, netif) != ERR_OK) {
-                            /* Free buffer */
+                            /* full packet send to tcpip_thread to process */
+                            if (netif->input(p, netif) != ERR_OK) {
+                                /* Free buffer */
+                                pbuf_free(p);
+                            }
+                            break;
+                        default:
+                            /* Return buffer */
                             pbuf_free(p);
-                        }
-                        break;
-                    default:
-                        /* Return buffer */
-                        pbuf_free(p);
-                        break;
+                            break;
+                    }
                 }
+            } else {
+                break;
             }
         }
     }