diff --git a/Makefile.unix b/Makefile.unix index 467f9f8ed4..fbbb258afb 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -438,7 +438,7 @@ ifeq ($(CONFIG_RAW_BINARY),y) endif ifeq ($(CONFIG_UBOOT_UIMAGE),y) @echo "MKIMAGE: uImage" - $(Q) mkimage -A arm -O linux -C none -T kernel -a $(CONFIG_UIMAGE_LOAD_ADDRESS) \ + $(Q) mkimage -A $(CONFIG_ARCH) -O linux -C none -T kernel -a $(CONFIG_UIMAGE_LOAD_ADDRESS) \ -e $(CONFIG_UIMAGE_ENTRY_POINT) -n $(BIN) -d $(NUTTXNAME).bin uImage $(Q) if [ -w /tftpboot ] ; then \ cp -f uImage /tftpboot/uImage; \ diff --git a/net/devif/ipv4_input.c b/net/devif/ipv4_input.c index 82acb0544a..033e82b97f 100644 --- a/net/devif/ipv4_input.c +++ b/net/devif/ipv4_input.c @@ -309,10 +309,11 @@ nullreturn: * Description: * * Returned Value: - * OK The packet was processed (or dropped) and can be discarded. - * ERROR There is a matching connection, but could not dispatch the packet - * yet. Currently useful for UDP when a packet arrives before a recv - * call is in place. + * OK - The packet was processed (or dropped) and can be discarded. + * ERROR - Hold the packet and try again later. There is a listening + * socket but no receive in place to catch the packet yet. The + * device's d_len will be set to zero in this case as there is + * no outgoing data. * ****************************************************************************/ diff --git a/net/devif/ipv6_input.c b/net/devif/ipv6_input.c index f71e82c883..77f60e7375 100644 --- a/net/devif/ipv6_input.c +++ b/net/devif/ipv6_input.c @@ -238,9 +238,10 @@ static bool check_destipaddr(FAR struct net_driver_s *dev, * the IPv6 packet. * Returned Value: * OK - The packet was processed (or dropped) and can be discarded. - * ERROR - There is a matching connection, but could not dispatch the - * packet yet. Currently useful for UDP when a packet arrives - * before a recv call is in place. + * ERROR - Hold the packet and try again later. There is a listening + * socket but no receive in place to catch the packet yet. The + * device's d_len will be set to zero in this case as there is + * no outgoing data. * * If this function returns to the network driver with dev->d_len > 0, * that is an indication to the driver that there is an outgoing response diff --git a/net/pkt/pkt_input.c b/net/pkt/pkt_input.c index b585dd5432..5deaa3c617 100644 --- a/net/pkt/pkt_input.c +++ b/net/pkt/pkt_input.c @@ -74,9 +74,10 @@ * dev - The device driver structure containing the received packet * * Return: - * OK The packet has been processed and can be deleted - * ERROR Hold the packet and try again later. There is a listening socket - * but no recv in place to catch the packet yet. + * OK The packet has been processed and can be deleted + * ERROR There is a matching connection, but could not dispatch the packet + * yet. Currently useful for UDP when a packet arrives before a recv + * call is in place. * * Assumptions: * Called from the interrupt level or with interrupts disabled. @@ -110,10 +111,14 @@ int pkt_input(struct net_driver_s *dev) if ((flags & PKT_NEWDATA) != 0) { /* No.. the packet was not processed now. Return ERROR so - * that the driver may retry again later. + * that the driver may retry again later. We still need to + * set d_len to zero so that the driver is aware that there + * is nothing to be sent. */ - ret = ERROR; + nwarn("WARNING: Packet not processed\n"); + //dev->d_len = 0; REVISIT + ret = ERROR; } } else diff --git a/net/socket/inet_sockif.c b/net/socket/inet_sockif.c index 3e35e2df90..b61effa816 100644 --- a/net/socket/inet_sockif.c +++ b/net/socket/inet_sockif.c @@ -50,6 +50,7 @@ #include "tcp/tcp.h" #include "udp/udp.h" +#include "sixlowpan/sixlowpan.h" #include "usrsock/usrsock.h" #include "socket/socket.h" diff --git a/net/udp/udp_input.c b/net/udp/udp_input.c index 6678e3e4b5..e28e46b5d6 100644 --- a/net/udp/udp_input.c +++ b/net/udp/udp_input.c @@ -72,9 +72,11 @@ * iplen - Length of the IP and UDP headers * * Return: - * OK The packet has been processed and can be deleted - * ERROR Hold the packet and try again later. There is a listening socket - * but no receive in place to catch the packet yet. + * OK - The packet has been processed and can be deleted + * ERROR - Hold the packet and try again later. There is a listening + * socket but no receive in place to catch the packet yet. The + * device's d_len will be set to zero in this case as there is + * no outgoing data. * * Assumptions: * Called from the interrupt level or with interrupts disabled. @@ -185,16 +187,27 @@ static int udp_input(FAR struct net_driver_s *dev, unsigned int iplen) flags = udp_callback(dev, conn, UDP_NEWDATA); - /* If the operation was successful, the UDP_NEWDATA flag is removed - * and thus the packet can be deleted (OK will be returned). + /* If the operation was successful and the UDP data was "consumed," + * then the UDP_NEWDATA flag will be cleared by logic in + * udp_callback(). The packet memory can then be freed by the + * network driver. OK will be returned to the network driver to + * indicate this case. + * + * "Consumed" here means that either the received data was (1) + * accepted by a socket waiting for data on the port or was (2) + * buffered in the UDP socket's read-ahead buffer. */ if ((flags & UDP_NEWDATA) != 0) { /* No.. the packet was not processed now. Return ERROR so - * that the driver may retry again later. + * that the driver may retry again later. We still need to + * set d_len to zero so that the driver is aware that there + * is nothing to be sent. */ + nwarn("WARNING: Packet not processed\n"); + dev->d_len = 0; ret = ERROR; } diff --git a/wireless/ieee802154/Kconfig b/wireless/ieee802154/Kconfig index 11e47bed07..a940b71b02 100644 --- a/wireless/ieee802154/Kconfig +++ b/wireless/ieee802154/Kconfig @@ -107,7 +107,8 @@ config IEEE802154_IND_PREALLOC config IEEE802154_IND_IRQRESERVE int "Reserved pre-allocated meta-data structures" - default 10 + default 0 + depends on EXPERIMENTAL ---help--- If meta-data structures can be allocated from interrupt handlers, then this specifies the number of pre-allocatd meta-data structures @@ -124,7 +125,12 @@ config IEEE802154_IND_IRQRESERVE Non-interrupt logic will also first attempt to allocate from the general, pre-allocated structure pool. If that fails, it will - dynamically allocate the meta data structure with an additional cost in performance. + dynamically allocate the meta data structure with an additional cost + in performance. + + NOTE: Currently marked as experimental and with a default 0 zero + because there are no interrupt level allocations performed by the + current IEEE 802.15.4 MAC code. config IEEE802154_MACDEV bool "Character driver for IEEE 802.15.4 MAC layer" diff --git a/wireless/ieee802154/ieee802154_indalloc.c b/wireless/ieee802154/ieee802154_indalloc.c index 375cda69aa..f8747a905f 100644 --- a/wireless/ieee802154/ieee802154_indalloc.c +++ b/wireless/ieee802154/ieee802154_indalloc.c @@ -54,14 +54,21 @@ * Pre-processor Definitions ****************************************************************************/ -#if !defined(CONFIG_IEEE802154_IND_PREALLOC) || CONFIG_IEEE802154_IND_PREALLOC < 0 +/* NOTE: The CONFIG_IEEE802154_IND_IRQRESERVE options is marked as marked + * 'experimental' and with the default 0 zero because there are no interrupt + * level allocations performed by the current IEEE 802.15.4 MAC code. + */ + +#if !defined(CONFIG_IEEE802154_IND_PREALLOC) || \ + CONFIG_IEEE802154_IND_PREALLOC < 0 # undef CONFIG_IEEE802154_IND_PREALLOC # define CONFIG_IEEE802154_IND_PREALLOC 20 #endif -#if !defined(CONFIG_IEEE802154_IND_IRQRESERVE) || CONFIG_IEEE802154_IND_IRQRESERVE < 0 +#if !defined(CONFIG_IEEE802154_IND_IRQRESERVE) || \ + CONFIG_IEEE802154_IND_IRQRESERVE < 0 # undef CONFIG_IEEE802154_IND_IRQRESERVE -# define CONFIG_IEEE802154_IND_IRQRESERVE 10 +# define CONFIG_IEEE802154_IND_IRQRESERVE 0 #endif #if CONFIG_IEEE802154_IND_IRQRESERVE > CONFIG_IEEE802154_IND_PREALLOC