From 1608b7c33fcc42b1bcda6069503606316005db59 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 9 Jan 2016 15:56:08 -0600 Subject: [PATCH 1/6] Some networking logic was used helpers from apps/netutils. Not good. Quick fix is to duplicate logic --- libc/netdb/Make.defs | 2 +- libc/netdb/lib_dns.h | 6 +- libc/netdb/lib_getdnsaddr.c | 98 +++++++++++++++++ net/procfs/netdev_statistics.c | 6 +- net/utils/Make.defs | 2 +- net/utils/net_ipv6_mask2pref.c | 188 +++++++++++++++++++++++++++++++++ net/utils/utils.h | 28 +++++ 7 files changed, 323 insertions(+), 7 deletions(-) create mode 100644 libc/netdb/lib_getdnsaddr.c create mode 100644 net/utils/net_ipv6_mask2pref.c diff --git a/libc/netdb/Make.defs b/libc/netdb/Make.defs index dbddf836d5..b9347eb0fc 100644 --- a/libc/netdb/Make.defs +++ b/libc/netdb/Make.defs @@ -48,7 +48,7 @@ endif # Add DNS lookup support ifeq ($(CONFIG_NETDB_DNSCLIENT),y) -CSRCS += lib_dnsclient.c +CSRCS += lib_dnsclient.c lib_getdnsaddr.c endif # Add the net directory to the build diff --git a/libc/netdb/lib_dns.h b/libc/netdb/lib_dns.h index dee8985f99..e3e5d3bae5 100644 --- a/libc/netdb/lib_dns.h +++ b/libc/netdb/lib_dns.h @@ -57,11 +57,11 @@ /* DNS client configuration **************************************************/ #ifndef CONFIG_NETDB_DNSCLIENT_ENTRIES -# define RESOLV_ENTRIES 4 -#else -# define RESOLV_ENTRIES CONFIG_NETDB_DNSCLIENT_ENTRIES +# define CONFIG_NETDB_DNSCLIENT_ENTRIES 4 #endif +#define RESOLV_ENTRIES CONFIG_NETDB_DNSCLIENT_ENTRIES + #ifndef CONFIG_NETDB_DNSCLIENT_MAXRESPONSE # define CONFIG_NETDB_DNSCLIENT_MAXRESPONSE 96 #endif diff --git a/libc/netdb/lib_getdnsaddr.c b/libc/netdb/lib_getdnsaddr.c new file mode 100644 index 0000000000..a6e6c4335a --- /dev/null +++ b/libc/netdb/lib_getdnsaddr.c @@ -0,0 +1,98 @@ +/**************************************************************************** + * libc/netdb/lib_dnsgetaddr.c + * + * Copyright (C) 2007-2009, 2011, 2015 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include +#include +#include + +#include + +#include + +#include + +#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NETDB_DNSCLIENT) + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: dns_getaddr + * + * Description: + * Get the DNS server IPv4 address + * + * Parameters: + * ipaddr The location to return the IPv4 address + * + * Return: + * Zero (OK) is returned on success; A negated errno value is returned + * on failure. + * + ****************************************************************************/ + +int dns_getaddr(FAR struct in_addr *inaddr) +{ + struct sockaddr_in addr; + socklen_t addrlen; + int ret = -EINVAL; + + if (inaddr) + { + addrlen = sizeof(struct sockaddr_in); + ret = dns_getserver((FAR struct sockaddr *)&addr, &addrlen); + if (ret >= 0) + { + /* Sanity check */ + + DEBUGASSERT(addr.sin_family == AF_INET && + addrlen == sizeof(struct sockaddr_in)); + memcpy(inaddr, &addr.sin_addr, sizeof(struct in_addr)); + } + } + + return ret; +} + +#endif /* CONFIG_NET_IPv4 && CONFIG_NETDB_DNSCLIENT */ diff --git a/net/procfs/netdev_statistics.c b/net/procfs/netdev_statistics.c index b81741a409..61bc0f3573 100644 --- a/net/procfs/netdev_statistics.c +++ b/net/procfs/netdev_statistics.c @@ -47,8 +47,10 @@ #include #include +#include #include "netdev/netdev.h" +#include "utils/utils.h" #include "procfs/procfs.h" #if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS) && \ @@ -246,7 +248,7 @@ static int netprocfs_ipaddresses(FAR struct netprocfs_file_s *netfile) "Mask:%s\n", inet_ntoa(addr)); #if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS) - netlib_get_ipv4dnsaddr(&addr); + dns_getaddr(&addr); len += snprintf(&netfile->line[len], NET_LINELEN - len, "\tDNSaddr:%s\n", inet_ntoa(addr)); #endif @@ -255,7 +257,7 @@ static int netprocfs_ipaddresses(FAR struct netprocfs_file_s *netfile) #ifdef CONFIG_NET_IPv6 /* Convert the 128 network mask to a human friendly prefix length */ - preflen = netlib_ipv6netmask2prefix(dev->d_ipv6netmask); + preflen = net_ipv6_mask2pref(dev->d_ipv6netmask); /* Show the assigned IPv6 address */ diff --git a/net/utils/Make.defs b/net/utils/Make.defs index 6be4afdfc1..5abcb9226c 100644 --- a/net/utils/Make.defs +++ b/net/utils/Make.defs @@ -41,7 +41,7 @@ NET_CSRCS += net_chksum.c # IPv6 utilities ifeq ($(CONFIG_NET_IPv6),y) -NET_CSRCS += net_ipv6_maskcmp.c net_ipv6_pref2mask.c +NET_CSRCS += net_ipv6_maskcmp.c net_ipv6_mask2pref.c net_ipv6_pref2mask.c endif # Non-interrupt level support required? diff --git a/net/utils/net_ipv6_mask2pref.c b/net/utils/net_ipv6_mask2pref.c new file mode 100644 index 0000000000..dd9e00b6d8 --- /dev/null +++ b/net/utils/net_ipv6_mask2pref.c @@ -0,0 +1,188 @@ +/**************************************************************************** + * net/utils/net_ipv6_mask2pref.c + * + * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "utils/utils.h" + +#ifdef CONFIG_NET_IPv6 + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static const uint8_t g_nibblemap[16] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0: No bits, 1-7: Should not happen */ + 1, 1, 1, 1, /* 8: 1 bit, 9-b: Should not happen */ + 2, 2, 3, 4 /* c: 2 bits, d: Should not happen, e: 3 bits, f: 4 bits */ +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: net_msbits4 + * + * Description: + * Count the number of leading '1' bits in an 4-bit nibble + * + ****************************************************************************/ + +static inline uint8_t net_msbits4(uint8_t nibble) +{ + /* Return the number of leading zeroes: 0-4) */ + + return g_nibblemap[nibble]; +} + +/**************************************************************************** + * Name: net_msbits8 + * + * Description: + * Count the number of leading '1' bits in an 8-bit byte + * + ****************************************************************************/ + +static uint8_t net_msbits8(uint8_t byval) +{ + uint8_t ones; + + /* Check the MS nibble */ + + ones = net_msbits4(byval >> 4); + if (ones == 4) + { + /* All ones, try the LS nibble */ + + ones += net_msbits4(byval & 0x0f); + } + + /* Return the number of leading ones (0-8) */ + + return ones; +} + +/**************************************************************************** + * Name: net_msbits16 + * + * Description: + * Count the number of leading '1' bits in a 16-bit half-workd + * + ****************************************************************************/ + +static inline uint8_t net_msbits16(uint16_t hword) +{ + uint8_t ones; + + /* Look at the MS byte of the 16-bit value */ + + ones = net_msbits8((uint8_t)(hword >> 8)); + if (ones == 8) + { + /* All '1's, try the LS byte */ + + ones += net_msbits8((uint8_t)(hword & 0xff)); + } + + /* Return the number of leading ones (0-15) */ + + return ones; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: net_ipv6_mask2pref + * + * Description: + * Convert a 128-bit netmask to a prefix length. The Nuttx IPv6 + * networking uses 128-bit network masks internally. This function + * converts the IPv6 netmask to a prefix length. + * + * The prefix length is the number of MS '1' bits on in the netmask. + * This, of course, assumes that all MS bits are '1' and all LS bits are + * '0' with no intermixed 1's and 0's. This function searches from the MS + * bit until the first '0' is found (this does not necessary mean that + * there might not be additional '1' bits following the firs '0', but that + * will be a malformed netmask. + * + * Parameters: + * mask Points to an IPv6 netmask in the form of uint16_t[8] + * + * Return: + * The prefix length, range 0-128 on success; This function will not + * fail. + * + ****************************************************************************/ + +uint8_t net_ipv6_mask2pref(FAR const uint16_t *mask) +{ + uint8_t preflen; + int i; + + /* Count the leading all '1' 16-bit groups */ + + for (i = 0, preflen = 0; i < 8 && mask[i] == 0xffff; i++, preflen += 16); + + /* Now i either, (1) indexes past the end of the mask, or (2) is the index + * to the first half-word that is not equal to 0xffff. + */ + + if (i < 8) + { + preflen += net_msbits16(ntohs(mask[i])); + } + + /* Return the prefix length */ + + return preflen; +} + +#endif /* CONFIG_NET_IPv6 */ diff --git a/net/utils/utils.h b/net/utils/utils.h index d3644d446a..90592b2f7a 100644 --- a/net/utils/utils.h +++ b/net/utils/utils.h @@ -151,6 +151,34 @@ unsigned int net_dsec2tick(int dsec); unsigned int net_timeval2dsec(FAR struct timeval *tv, enum tv2ds_remainder_e remainder); +/**************************************************************************** + * Name: net_ipv6_mask2pref + * + * Description: + * Convert a 128-bit netmask to a prefix length. The Nuttx IPv6 + * networking uses 128-bit network masks internally. This function + * converts the IPv6 netmask to a prefix length. + * + * The prefix length is the number of MS '1' bits on in the netmask. + * This, of course, assumes that all MS bits are '1' and all LS bits are + * '0' with no intermixed 1's and 0's. This function searches from the MS + * bit until the first '0' is found (this does not necessary mean that + * there might not be additional '1' bits following the firs '0', but that + * will be a malformed netmask. + * + * Parameters: + * mask Points to an IPv6 netmask in the form of uint16_t[8] + * + * Return: + * The prefix length, range 0-128 on success; This function will not + * fail. + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv6 +uint8_t net_ipv6_mask2pref(FAR const uint16_t *mask); +#endif + /**************************************************************************** * Function: net_ipv6_pref2mask * From fbb4dcc0af4b5b1e61243cbc0999f5e80e5ab6fa Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 9 Jan 2016 15:57:44 -0600 Subject: [PATCH 2/6] Some networking logic was used helpers from apps/netutils. Not good. Quick fix is to duplicate logic --- include/nuttx/net/dns.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/nuttx/net/dns.h b/include/nuttx/net/dns.h index 94da6abbec..f7dff02af6 100644 --- a/include/nuttx/net/dns.h +++ b/include/nuttx/net/dns.h @@ -198,6 +198,25 @@ int dns_setserver(FAR const struct sockaddr *addr, socklen_t addrlen); int dns_getserver(FAR struct sockaddr *addr, FAR socklen_t *addrlen); +/**************************************************************************** + * Name: dns_getaddr + * + * Description: + * Get the DNS server IPv4 address + * + * Parameters: + * ipaddr The location to return the IPv4 address + * + * Return: + * Zero (OK) is returned on success; A negated errno value is returned + * on failure. + * + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv4 +int dns_getaddr(FAR struct in_addr *inaddr); +#endif + #undef EXTERN #if defined(__cplusplus) } From 468732e0643c99db616db20662aa98219a2d184a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 9 Jan 2016 16:07:12 -0600 Subject: [PATCH 3/6] mkdeps.sh and mkdeps.bat have been deleted. All configurations must now use the compiler mkeps program --- ChangeLog | 3 + Documentation | 2 +- arch | 2 +- configs | 2 +- tools/README.txt | 26 +----- tools/mkdeps.bat | 200 ------------------------------------------- tools/mkdeps.sh | 218 ----------------------------------------------- 7 files changed, 9 insertions(+), 444 deletions(-) delete mode 100644 tools/mkdeps.bat delete mode 100755 tools/mkdeps.sh diff --git a/ChangeLog b/ChangeLog index 58ee7eef19..f0f79dde08 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11292,4 +11292,7 @@ (2016-01-09). * arch/avr/include/debug.h: Add an AVR-specific header file used when the AVR MEMX pointer is used. From Dimitri Kloper (2016-01-09). + * tools/mkdeps.c: Deleted mkdeps.sh and mkdeps.bat. The mkdeps + executable generated from mkdeps.c is now that the only supported + way to make dependencies (2016-01-09). diff --git a/Documentation b/Documentation index 4217e1a644..8830f8f638 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit 4217e1a644a0dfe8f111ab07f9df38af2ea906d7 +Subproject commit 8830f8f6387b287a480b849e02569b881e5cd413 diff --git a/arch b/arch index 3fbe4f51dc..4570fe271a 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 3fbe4f51dc531070c93821018a342cfb5d8a6c02 +Subproject commit 4570fe271a034ae7aa23e579064f90c75594f985 diff --git a/configs b/configs index a8e9be00f9..57c7e67c4d 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit a8e9be00f98fe4abe13ad2703637f00c516d7d7d +Subproject commit 57c7e67c4d5374ed87a94091deee8ae65eccde64 diff --git a/tools/README.txt b/tools/README.txt index 5766a98458..7c88cef6c9 100644 --- a/tools/README.txt +++ b/tools/README.txt @@ -393,18 +393,15 @@ mkromfsimg.sh image. It accepts an rcS script "template" and generates and image that may be mounted under /etc in the NuttX pseudo file system. -mkdeps.sh -mkdeps.bat mkdeps.c mknulldeps.sh ------------- NuttX uses the GCC compilers capabilities to create Makefile dependencies. - The bash script mkdeps.sh is used to run GCC in order to create the - dependencies. If a NuttX configuration uses the GCC toolchain, its Make.defs - file (see configs/README.txt) will include a line like: + The program mkdeps is used to run GCC in order to create the dependencies. + If a NuttX configuration uses the GCC toolchain, its Make.defs file (see + configs/README.txt) will include a line like: - MKDEP = $(TOPDIR)/tools/mkdeps.sh, or MKDEP = $(TOPDIR)/tools/mkdeps[.exe] (See NOTE below) If the NuttX configuration does not use a GCC compatible toolchain, then @@ -414,23 +411,6 @@ mknulldeps.sh The mknulldeps.sh is a stub script that does essentially nothing. - NOTE: The mk*deps.* files are undergoing change. mkdeps.sh is a bash - script that produces dependencies well for POSIX style hosts (e..g., - Linux and Cygwin). It does not work well for mixed environments with - a Windows toolchain running in a POSIX style environment (hence, the - mknulldeps.sh script). And, of course, cannot be used in a Windows - nativ environment. - - [mkdeps.sh does have an option, --winpath, that purports to convert - the dependencies generated by a Windows toolchain to POSIX format. - However, that is not being used and mostly likely does not cover - all of the conversion cases.] - - mkdeps.bat is a simple port of the bash script to run in a Windows - command shell. However, it does not work well either because some - of the common CFLAGS use characters like '=' which are transformed - by the CMD.exe shell. - mkdeps.c generates mkdeps (on Linux) or mkdeps.exe (on Windows). However, this verison is still under-development. It works well in the all POSIX environment or in the all Windows environment but also diff --git a/tools/mkdeps.bat b/tools/mkdeps.bat deleted file mode 100644 index 64b4429d10..0000000000 --- a/tools/mkdeps.bat +++ /dev/null @@ -1,200 +0,0 @@ -@echo off - -rem tools/mkdeps.sh -rem -rem Copyright (C) 2012 Gregory Nutt. All rights reserved. -rem Author: Gregory Nutt -rem -rem Redistribution and use in source and binary forms, with or without -rem modification, are permitted provided that the following conditions -rem are met: -rem -rem 1. Redistributions of source code must retain the above copyright -rem notice, this list of conditions and the following disclaimer. -rem 2. Redistributions in binary form must reproduce the above copyright -rem notice, this list of conditions and the following disclaimer in -rem the documentation and/or other materials provided with the -rem distribution. -rem 3. Neither the name NuttX nor the names of its contributors may be -rem used to endorse or promote products derived from this software -rem without specific prior written permission. -rem -rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -rem POSSIBILITY OF SUCH DAMAGE. - -rem Accumulate CFLAGS up to "--" - -set cc= -set cflags= -set altpath= -set files= -set args= -set objpath= -set suffix=.o -set debug=n - -:Loop -if "%1"=="" goto Continue - -if "%1"=="--" ( - set cc=%cflags% - set cflags=%args% - set args= - goto NextParm -) - -if "%1"=="--dep-path" ( - if "%args%"=="" ( - set altpath=%altpath% %2 - ) else ( - set args=%args% %2 - ) - shift - goto NextParm -) - -if "%1"=="--obj-path" ( - set objpath=%2 - shift - goto NextParm -) - -if "%1"=="--obj-suffix" ( - set suffix=%2 - shift - goto NextParm -) - -if "%1"=="--dep-debug" ( -rem @echo on - set debug=y - goto NextParm -) - -if "%1"=="--help" goto Usage - -if "%args%"=="" ( - set args=%1 -) else ( - set args=%args% %1 -) - -:NextParm -shift -goto Loop -:Continue - -set files=%args% - -if "%debug%"=="y" ( - echo cc=%cc% - echo cflags=%cflags% - echo files=%files% - echo altpath=%altpath% -) - -rem Now check if we have everything - -if "%cc%"=="" ( - echo ERROR: No compiler specified - goto Usage -) - -if "%files%"=="" ( - rem Don't report an error -- this happens normally in some configurations - echo # No files specified for dependency generataion - goto End -) - -rem Then get the dependencies for each file - -if "%altpath%"=="" goto NoPaths -for %%G in (%files%) do ( - set fullpath= - set file=%%G - call :Checkpaths - if "%debug%"=="y" echo %file%: fullpath=%fullpath% - if "%fullpath%"=="" goto :NoFile - - mtarg="" - if "%objpath%"=="" ( - set objname=%~n1 - set mtarg="-MT %objpath%\%objname%%suffix% - ) - - if "%debug%"=="y" echo CMD: %cc% -M %cflags% %fullpath% - %cc% -M %mtarg% %cflags% %fullpath% || goto DepFail -) -goto :End - -:NoPaths -for %%G in (%files%) do ( - set fullpath= - set file=%%G - call :CheckFile %%G -) -goto :End - -:CheckFile -if "%debug%"=="y" echo Checkfile: Checking %file% -if not exist %file% goto :NoFile -set fullpath=%file% - if "%debug%"=="y" echo CMD: %cc% -M %cflags% %fullpath% -%cc% -M %cflags% %fullpath% || goto DepFail -goto :EOF - -:CheckPaths -for %%H in (%altpath%) do ( - set tmppath=%%H\%file% - if "%debug%"=="y" echo Checkfile: Checking %tmppath% - if exist %tmppath% ( - set fullpath=%tmppath% - goto :EOF - ) -) -goto :EOF - -:NoFile -echo ERROR: No readable file at %file% -goto Usage - -:DepFail -echo ERROR: Failed to created dependencies for %file% - -:Usage -echo Usage: mkdeps [OPTIONS] CC -- CFLAGS -- file [file [file...]] -echo Where: -echo CC -echo A variable number of arguments that define how to execute the compiler -echo CFLAGS -echo The compiler compilation flags -echo file -echo One or more C files whose dependencies will be checked. Each file is expected -echo to reside in the current directory unless --dep-path is provided on the command line -echo And [OPTIONS] include: -echo --dep-debug -echo Enable script debug -echo --dep-path ^ -echo Do not look in the current directory for the file. Instead, look in to see -echo if the file resides there. --dep-path may be used multiple times to specify -echo multiple alternative location -echo --obj-path ^ -echo The final objects will not reside in this path but, rather, at the path provided by -echo ^. if provided multiple time, only the last --obj-path will be used. -echo --obj-suffix ^ -echo If and object path is provided, then the extension will be assumed to be .o. This -echo default suffix can be overrided with this command line option. -echo --help -echo Shows this message and exits - -:End diff --git a/tools/mkdeps.sh b/tools/mkdeps.sh deleted file mode 100755 index 8a03ac5712..0000000000 --- a/tools/mkdeps.sh +++ /dev/null @@ -1,218 +0,0 @@ -#!/bin/bash -############################################################################ -# tools/mkdeps.sh -# -# Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ -# -# Usage: - -show_usage () -{ - echo "" - echo "$progname [OPTIONS] CC -- CFLAGS -- file [file [file...]]" - echo "" - echo "Where:" - echo " CC" - echo " A variable number of arguments that define how to execute the compiler" - echo " CFLAGS" - echo " The compiler compilation flags" - echo " file" - echo " One or more C files whose dependencies will be checked. Each file is expected" - echo " to reside in the current directory unless --dep-path is provided on the command line" - echo "" - echo "And [OPTIONS] include:" - echo " --dep-debug" - echo " Enable script debug" - echo " --dep-path " - echo " Do not look in the current directory for the file. Instead, look in to see" - echo " if the file resides there. --dep-path may be used multiple times to specify" - echo " multiple alternative location" - echo " --obj-path " - echo " The final objects will not reside in this path but, rather, at the path provided by" - echo " . if provided multiple time, only the last --obj-path will be used." - echo " --obj-suffix " - echo " If and object path is provided, then the extension will be assumed to be .o. This" - echo " default suffix can be overrided with this command line option." - echo " --winpaths " - echo " CC generates dependency lists using Windows paths (e.g., C:\blablah\blabla). This" - echo " switch instructs the script to use 'cygpath' to convert the Windows paths to Cygwin" - echo " paths" - echo " --help" - echo " Shows this message and exits" - exit 1 -} - -dodep () -{ - unset fullpath - if [ -z "$altpath" ]; then - if [ -r $1 ]; then - fullpath=$1 - else - echo "# ERROR: No readable file at $1" - show_usage - fi - else - for path in $altpath; do - tmppath=$path/$1 - if [ -r $tmppath ]; then - fullpath=$tmppath - break; - fi - done - if [ -z "$fullpath" ]; then - echo "# ERROR: No readable file for $1 found at any location" - show_usage - fi - fi - - unset mtarg - if [ ! -z "$objpath" ]; then - srcname=`basename $1` - objname="${srcname%.*}" - mtarg="-MT ${objpath}/${objname}${suffix}" - fi - - $cc -M $mtarg $cflags $fullpath || \ - ( echo "# ERROR: $cc -M $cflags $fullpath FAILED"; exit 4; ) -} - -unset cc -unset cflags -unset files -unset args -unset altpath -unset objpath -suffix=.o -winpaths=n -unset topdir - -# Accumulate CFLAGS up to "--" -progname=$0 -while [ ! -z "$1" ]; do - case $1 in - -- ) - cc=$cflags - cflags=$args - args= - ;; - --dep-debug ) - if [ -z "$args" ]; then - set -x - else - args="$args $1" - fi - ;; - --dep-path ) - if [ -z "$args" ]; then - shift - altpath="$altpath $1" - else - args="$args $1" - fi - ;; - --obj-path ) - shift - objpath="$1" - ;; - --obj-suffix ) - shift - suffix="$1" - ;; - --winpaths ) - if [ -z "$args" ]; then - shift - winpaths=y - topdir=$1 - else - args="$args $1" - fi - ;; - --help ) - show_usage - ;; - *) - args="$args $1" - ;; - esac - shift -done -files=$args - -if [ -z "$cc" ]; then - echo "ERROR: No compiler specified" - show_usage - exit 1 -fi - -if [ -z "$files" ]; then - # Don't report an error -- this happens normally in some configurations - echo "# No files specified for dependency generataion" - exit 0 -fi - -# Check if this compiler generates Cygwin/Linux paths or Windows paths - -if [ "X${winpaths}" = "Xy" ]; then - # We will have to parse and modify each dependency (yech) - # Make sure a valid TOPDIR argument was provided - - if [ -z "$topdir" -o ! -d $topdir ]; then - echo " not specified or does not exist: $topdir" - show_usage - exit 1 - fi - - # Get the top dir expressed like the Windows GCC would use it, except - # with forward slashs - - wtopdir=`cygpath -w ${topdir} | sed -e "s,\\\\\\,/,g"` - - # Then get the dependency and perform conversions on it to make it - # palatable to the Cygwin make. This is probably not sufficiently - # general to work on all platforms (like if your disk is not C:). - - for file in $files ; do - dodep $file | sed -e "s,\\\,/,g" -e "s,${wtopdir},${topdir},g" \ - -e "s,/ ,\\\ ,g" -e "s,c:/,/cygdrive/c/,g" \ - -e "s,/$,\\\,g" - done -else - # For normal Cygwin/Linux GCC, the dependency paths are in the - # correct form and can simply be echoed on stdout - - for file in $files ; do - dodep $file - done -fi - From 435b29fa7c5444814590abb1468a88a5d42bd224 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 9 Jan 2016 16:39:30 -0600 Subject: [PATCH 4/6] Update submodules --- Documentation | 2 +- arch | 2 +- configs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation b/Documentation index 8830f8f638..e3d982b2f1 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit 8830f8f6387b287a480b849e02569b881e5cd413 +Subproject commit e3d982b2f1c179747551a015d5a4c11132dbfe47 diff --git a/arch b/arch index 4570fe271a..95a83af6d1 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 4570fe271a034ae7aa23e579064f90c75594f985 +Subproject commit 95a83af6d1ee3d2ecd2cd6a3c3bb4a99c4c06d7a diff --git a/configs b/configs index 57c7e67c4d..7b507f0c3c 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 57c7e67c4d5374ed87a94091deee8ae65eccde64 +Subproject commit 7b507f0c3c812869cb4ec5981b740ac94444b49f From 4d02274d50d9ab8132de1d66537b2dd3d6f920b7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 9 Jan 2016 16:41:18 -0600 Subject: [PATCH 5/6] Update submodules --- Documentation | 2 +- configs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation b/Documentation index e3d982b2f1..8830f8f638 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit e3d982b2f1c179747551a015d5a4c11132dbfe47 +Subproject commit 8830f8f6387b287a480b849e02569b881e5cd413 diff --git a/configs b/configs index 7b507f0c3c..57c7e67c4d 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 7b507f0c3c812869cb4ec5981b740ac94444b49f +Subproject commit 57c7e67c4d5374ed87a94091deee8ae65eccde64 From 51ee01255b65b514adbb58f8f9734120cdece06b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 9 Jan 2016 19:56:47 -0600 Subject: [PATCH 6/6] =?UTF-8?q?ENC28J60:=20Missing=20semicolon=20causes=20?= =?UTF-8?q?error=20in=20some=20configurations.=20=20Noted=20by=20Maciej=20?= =?UTF-8?q?W=C3=B3jcik?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation | 2 +- configs | 2 +- drivers/net/enc28j60.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation b/Documentation index 8830f8f638..e3d982b2f1 160000 --- a/Documentation +++ b/Documentation @@ -1 +1 @@ -Subproject commit 8830f8f6387b287a480b849e02569b881e5cd413 +Subproject commit e3d982b2f1c179747551a015d5a4c11132dbfe47 diff --git a/configs b/configs index 57c7e67c4d..7b507f0c3c 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 57c7e67c4d5374ed87a94091deee8ae65eccde64 +Subproject commit 7b507f0c3c812869cb4ec5981b740ac94444b49f diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 7df9597a82..4a940a71ee 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -381,7 +381,7 @@ static inline void enc_configspi(FAR struct spi_dev_s *spi) SPI_SETMODE(spi, CONFIG_ENC28J60_SPIMODE); SPI_SETBITS(spi, 8); - SPI_SETFREQUENCY(spi, CONFIG_ENC28J60_FREQUENCY) + SPI_SETFREQUENCY(spi, CONFIG_ENC28J60_FREQUENCY); } #endif