diff --git a/net/Makefile b/net/Makefile index 70d83b9384..22ccc94f76 100644 --- a/net/Makefile +++ b/net/Makefile @@ -94,6 +94,7 @@ include udp/Make.defs include pkt/Make.defs include uip/Make.defs include route/Make.defs +include utils/Make.defs endif ASRCS = $(SOCK_ASRCS) $(NETDEV_ASRCS) $(NET_ASRCS) diff --git a/net/uip/Make.defs b/net/uip/Make.defs index d759a9f005..3d58aacc49 100644 --- a/net/uip/Make.defs +++ b/net/uip/Make.defs @@ -38,7 +38,7 @@ ifeq ($(CONFIG_NET),y) # Common IP source files NET_CSRCS += uip_initialize.c uip_setipid.c uip_input.c uip_send.c -NET_CSRCS += uip_poll.c uip_chksum.c uip_callback.c +NET_CSRCS += uip_poll.c uip_callback.c # I/O buffer chain support required? diff --git a/net/utils/Make.defs b/net/utils/Make.defs index 5363cb02fc..6685a3b7c7 100644 --- a/net/utils/Make.defs +++ b/net/utils/Make.defs @@ -35,7 +35,7 @@ ifeq ($(CONFIG_NET),y) -NET_CSRCS += net_dsec2timeval.c +NET_CSRCS += net_dsec2timeval.c net_chksum.c # Non-interrupt level support required? @@ -49,4 +49,3 @@ DEPPATH += --dep-path utils VPATH += :utils endif -endif diff --git a/net/uip/uip_chksum.c b/net/utils/net_chksum.c similarity index 99% rename from net/uip/uip_chksum.c rename to net/utils/net_chksum.c index 640fb35480..a48e749350 100644 --- a/net/uip/uip_chksum.c +++ b/net/utils/net_chksum.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/uip/uip_chksum.c + * net/utils/net_chksum.c * * Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -48,7 +48,7 @@ #include #include -#include "uip/uip.h" +#include "utils/utils.h" /**************************************************************************** * Pre-processor Definitions @@ -142,10 +142,6 @@ static uint16_t icmp_6chksum(FAR struct uip_driver_s *dev) #endif /* UIP_ARCH_CHKSUM */ -/**************************************************************************** - * Public Functions - ****************************************************************************/ - /* Calculate the Internet checksum over a buffer. */ #if !UIP_ARCH_ADD32 @@ -174,6 +170,10 @@ static inline void uip_carry32(FAR uint8_t *sum, uint16_t op16) } } +/**************************************************************************** + * Public Functions + ****************************************************************************/ + void uip_incr32(FAR uint8_t *op32, uint16_t op16) { op32[3] += (op16 & 0xff); diff --git a/net/utils/utils.h b/net/utils/utils.h index 98395315b9..10c386edf3 100644 --- a/net/utils/utils.h +++ b/net/utils/utils.h @@ -84,6 +84,7 @@ extern "C" * ****************************************************************************/ +struct timeval; void net_dsec2timeval(uint16_t dsec, FAR struct timeval *tv); #undef EXTERN