diff --git a/arch/sim/Kconfig b/arch/sim/Kconfig index b0395968d7..7384d3d723 100644 --- a/arch/sim/Kconfig +++ b/arch/sim/Kconfig @@ -100,6 +100,39 @@ config SIM_WALLTIME correct for the system timer tick rate. With this definition in the configuration, sleep() behavior is more or less normal. +if HOST_LINUX +choice + prompt "Simulation Network Type" + default SIM_NET_HOST_ROUTE + +config SIM_NET_HOST_ROUTE + bool "Use local host route" + ---help--- + Add a host route for the simulation that points to the created tap device. The + simulation will not be able to access the public network unless iptables is + configured to masquerade for it. See configs/sim/NETWORK-LINUX.txt for more + information. + +config SIM_NET_BRIDGE + bool "Attach to Linux bridge" + ---help--- + Add the created tap device to the specified bridge. You will need to manually + configure the bridge IP address (if any) and routes that point to the bridge. + See configs/sim/NETWORK-LINUX.txt for more information. + +endchoice +endif + +if SIM_NET_BRIDGE +config SIM_NET_BRIDGE_DEVICE + string "Bridge device to attach" + default "nuttx0" + ---help--- + The name of the bridge device (as passed to "brctl create") to which the simulation's + TAP interface should be added. + +endif + config SIM_LCDDRIVER bool "Build a simulated LCD driver" default y diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index 1e3f52744a..72401d6c77 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -120,6 +120,13 @@ ifeq ($(CONFIG_NET_ETHERNET),y) HOSTCFLAGS += -DNETDEV_BUFSIZE=$(CONFIG_NET_ETH_MTU) ifneq ($(HOSTOS),Cygwin) HOSTSRCS += up_tapdev.c up_netdev.c +ifeq ($(CONFIG_SIM_NET_BRIDGE),y) + HOSTCFLAGS += -DCONFIG_SIM_NET_BRIDGE + HOSTCFLAGS += -DCONFIG_SIM_NET_BRIDGE_DEVICE=\"$(CONFIG_SIM_NET_BRIDGE_DEVICE)\" +endif +ifeq ($(CONFIG_SIM_NET_HOST_ROUTE),y) + HOSTCFLAGS += -DCONFIG_SIM_NET_HOST_ROUTE +endif else HOSTSRCS += up_wpcap.c up_netdev.c DRVLIB = /lib/w32api/libws2_32.a /lib/w32api/libiphlpapi.a diff --git a/arch/sim/src/up_internal.h b/arch/sim/src/up_internal.h index e1e69dc25b..ddae194a6a 100644 --- a/arch/sim/src/up_internal.h +++ b/arch/sim/src/up_internal.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sim/src/up_internal.h * - * Copyright (C) 2007, 2009, 2011-2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011-2012, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ #ifndef __ASSEMBLY__ # include # include +# include # include # include @@ -308,10 +309,14 @@ int sim_ajoy_initialize(void); void tapdev_init(void); unsigned int tapdev_read(unsigned char *buf, unsigned int buflen); void tapdev_send(unsigned char *buf, unsigned int buflen); +void tapdev_ifup(in_addr_t ifaddr); +void tapdev_ifdown(void); -#define netdev_init() tapdev_init() -#define netdev_read(buf,buflen) tapdev_read(buf,buflen) -#define netdev_send(buf,buflen) tapdev_send(buf,buflen) +# define netdev_init() tapdev_init() +# define netdev_read(buf,buflen) tapdev_read(buf,buflen) +# define netdev_send(buf,buflen) tapdev_send(buf,buflen) +# define netdev_ifup(ifaddr) tapdev_ifup(ifaddr) +# define netdev_ifdown() tapdev_ifdown() #endif /* up_wpcap.c *************************************************************/ @@ -321,9 +326,11 @@ void wpcap_init(void); unsigned int wpcap_read(unsigned char *buf, unsigned int buflen); void wpcap_send(unsigned char *buf, unsigned int buflen); -#define netdev_init() wpcap_init() -#define netdev_read(buf,buflen) wpcap_read(buf,buflen) -#define netdev_send(buf,buflen) wpcap_send(buf,buflen) +# define netdev_init() wpcap_init() +# define netdev_read(buf,buflen) wpcap_read(buf,buflen) +# define netdev_send(buf,buflen) wpcap_send(buf,buflen) +# define netdev_ifup(ifaddr) {} +# define netdev_ifdown() {} #endif /* up_netdriver.c *********************************************************/ diff --git a/arch/sim/src/up_netdriver.c b/arch/sim/src/up_netdriver.c index 346159157f..c785f49746 100644 --- a/arch/sim/src/up_netdriver.c +++ b/arch/sim/src/up_netdriver.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sim/src/up_netdriver.c * - * Copyright (C) 2007, 2009-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009-2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Based on code from uIP which also has a BSD-like license: @@ -186,21 +186,32 @@ void netdriver_loop(void) */ eth = BUF; - if (g_sim_dev.d_len > ETH_HDRLEN && - up_comparemac(eth->dest, &g_sim_dev.d_mac) == 0) + if (g_sim_dev.d_len > ETH_HDRLEN) { + int is_ours; + + /* Figure out if this ethernet frame is addressed to us. This affects + * what we're willing to receive. Note that in promiscuous mode, the + * up_comparemac will always return 0. + */ + + is_ours = (up_comparemac(eth->dest, &g_sim_dev.d_mac) == 0); + #ifdef CONFIG_NET_PKT /* When packet sockets are enabled, feed the frame into the packet * tap. */ - pkt_input(&g_sim_dev); + if (is_ours) + { + pkt_input(&g_sim_dev); + } #endif /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv4 - if (eth->type == HTONS(ETHTYPE_IP)) + if (eth->type == HTONS(ETHTYPE_IP) && is_ours) { nllvdbg("IPv4 frame\n"); @@ -241,7 +252,7 @@ void netdriver_loop(void) else #endif #ifdef CONFIG_NET_IPv6 - if (eth->type == HTONS(ETHTYPE_IP6)) + if (eth->type == HTONS(ETHTYPE_IP6) && is_ours) { nllvdbg("Iv6 frame\n"); @@ -304,9 +315,22 @@ void netdriver_loop(void) timer_reset(&g_periodic_timer); devif_timer(&g_sim_dev, sim_txpoll); } + sched_unlock(); } +int netdriver_ifup(struct net_driver_s *dev) +{ + netdev_ifup(dev->d_ipaddr); + return OK; +} + +int netdriver_ifdown(struct net_driver_s *dev) +{ + netdev_ifdown(); + return OK; +} + int netdriver_init(void) { /* Internal initalization */ @@ -314,6 +338,11 @@ int netdriver_init(void) timer_set(&g_periodic_timer, 500); netdev_init(); + /* Set callbacks */ + + g_sim_dev.d_ifup = netdriver_ifup; + g_sim_dev.d_ifdown = netdriver_ifdown; + /* Register the device with the OS so that socket IOCTLs can be performed */ (void)netdev_register(&g_sim_dev, NET_LL_ETHERNET); diff --git a/arch/sim/src/up_tapdev.c b/arch/sim/src/up_tapdev.c index 4fc1394e37..c3ed52e791 100644 --- a/arch/sim/src/up_tapdev.c +++ b/arch/sim/src/up_tapdev.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sim/src/up_tapdev.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Based on code from uIP which also has a BSD-like license: @@ -56,30 +56,25 @@ #include #include #include +#include -#include +#ifdef CONFIG_SIM_NET_HOST_ROUTE +# include +#endif + +#include +#include #include #include +#include /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -#define TAPDEV_DEBUG 1 +//#define TAPDEV_DEBUG 1 -#define DEVTAP "/dev/net/tun" - -#ifndef CONFIG_EXAMPLES_WEBSERVER_DHCPC -# define TAP_IPADDR0 192 -# define TAP_IPADDR1 168 -# define TAP_IPADDR2 0 -# define TAP_IPADDR3 128 -#else -# define TAP_IPADDR0 0 -# define TAP_IPADDR1 0 -# define TAP_IPADDR2 0 -# define TAP_IPADDR3 0 -#endif +#define DEVTAP "/dev/net/tun" /* Syslog priority (must match definitions in nuttx/include/syslog.h) */ @@ -101,10 +96,6 @@ struct sel_arg_struct struct timeval *tvp; }; -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - /**************************************************************************** * NuttX Domain Public Function Prototypes ****************************************************************************/ @@ -117,9 +108,14 @@ int netdriver_setmacaddr(unsigned char *macaddr); ****************************************************************************/ #ifdef TAPDEV_DEBUG -static int gdrop = 0; +static int gdrop = 0; +#endif +static int gtapdevfd; +static char gdevname[IFNAMSIZ]; + +#ifdef CONFIG_SIM_NET_HOST_ROUTE +static struct rtentry ghostroute; #endif -static int gtapdevfd; /**************************************************************************** * Private Functions @@ -145,32 +141,32 @@ static inline void dump_ethhdr(const char *msg, unsigned char *buf, int buflen) static int up_setmacaddr(void) { - int sockfd; + unsigned char mac[7]; int ret = -1; - /* Get a socket (only so that we get access to the INET subsystem) */ + /* Assign a random locally-created MAC address. + * + * This previously took the address from the TAP interface; that was + * incorrect, as that hardware address belongs to the host system. Packets + * destined for the application aren't guaranteed to reach it if you do + * that, as the host may handle them at its discretion. + * + * With a unique MAC address, we get ALL the packets. + * + * TODO: The generated MAC address should be checked to see if it + * conflicts with something else on the network. + */ - sockfd = socket(PF_INET, SOCK_DGRAM, 0); - if (sockfd >= 0) - { - struct ifreq req; - memset(&req, 0, sizeof(struct ifreq)); - - /* Put the driver name into the request */ - - strncpy(req.ifr_name, "tap0", IFNAMSIZ); - - /* Perform the ioctl to get the MAC address */ - - ret = ioctl(sockfd, SIOCGIFHWADDR, (unsigned long)&req); - if (!ret) - { - /* Set the MAC address */ - - ret = netdriver_setmacaddr((unsigned char *)&req.ifr_hwaddr.sa_data); - } - } + srand(time(NULL)); + mac[0] = 0x42; + mac[1] = rand() % 256; + mac[2] = rand() % 256; + mac[3] = rand() % 256; + mac[4] = rand() % 256; + mac[5] = rand() % 256; + mac[6] = 0; + ret = netdriver_setmacaddr(mac); return ret; } @@ -181,9 +177,12 @@ static int up_setmacaddr(void) void tapdev_init(void) { struct ifreq ifr; - char buf[1024]; int ret; +#ifdef CONFIG_SIM_NET_BRIDGE + int sockfd; +#endif + /* Open the tap device */ gtapdevfd = open(DEVTAP, O_RDWR, 0644); @@ -204,11 +203,37 @@ void tapdev_init(void) return; } - /* Assign an IPv4 address to the tap device */ + /* Save the tap device name */ - snprintf(buf, sizeof(buf), "/sbin/ifconfig tap0 inet %d.%d.%d.%d\n", - TAP_IPADDR0, TAP_IPADDR1, TAP_IPADDR2, TAP_IPADDR3); - system(buf); + strncpy(gdevname, ifr.ifr_name, IFNAMSIZ); + +#ifdef CONFIG_SIM_NET_BRIDGE + /* Get a socket with which to manipulate the tap device; the remaining + * ioctl calls unfortunately won't work on the tap device fd. + */ + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if (sockfd < 0) + { + syslog(LOG_ERR, "TAPDEV: Can't open socket: %d\n", -sockfd); + return; + } + + /* Assign the tap device to a bridge */ + + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, CONFIG_SIM_NET_BRIDGE_DEVICE, IFNAMSIZ); + ifr.ifr_ifindex = if_nametoindex(gdevname); + + ret = ioctl(sockfd, SIOCBRADDIF, &ifr); + if (ret < 0) + { + syslog(LOG_ERR, "TAPDEV: ioctl failed (can't add interface %s to bridge %s): %d\n", + devname, CONFIG_SIM_NET_BRIDGE_DEVICE, -ret); + } + + close(sockfd); +#endif /* Set the MAC address */ @@ -273,9 +298,101 @@ void tapdev_send(unsigned char *buf, unsigned int buflen) syslog(LOG_ERR, "TAPDEV: write failed: %d", -ret); exit(1); } + dump_ethhdr("write", buf, buflen); } +void tapdev_ifup(in_addr_t ifaddr) +{ + struct ifreq ifr; + int sockfd; + int ret; + +#ifdef CONFIG_SIM_NET_HOST_ROUTE + struct sockaddr_in *addr; +#endif + + /* Get a socket with which to manipulate the tap device */ + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if (sockfd < 0) + { + syslog(LOG_ERR, "TAPDEV: Can't open socket: %d\n", -sockfd); + return; + } + + /* Bring the TAP interface up */ + + strncpy(ifr.ifr_name, gdevname, IFNAMSIZ); + + ret = ioctl(sockfd, SIOCGIFFLAGS, (unsigned long)&ifr); + if (ret < 0) + { + syslog(LOG_ERR, "TAPDEV: ioctl failed (can't get interface flags): %d\n", -ret); + close(sockfd); + return; + } + + ifr.ifr_flags |= IFF_UP; + ret = ioctl(sockfd, SIOCSIFFLAGS, (unsigned long)&ifr); + if (ret < 0) + { + syslog(LOG_ERR, "TAPDEV: ioctl failed (can't set interface flags): %d\n", -ret); + close(sockfd); + return; + } + +#ifdef CONFIG_SIM_NET_HOST_ROUTE + /* Add host route */ + + memset(&ghostroute, 0, sizeof(ghostroute)); + + addr = (struct sockaddr_in *)&ghostroute.rt_dst; + addr->sin_family = AF_INET; + addr->sin_addr.s_addr = ifaddr; + + ghostroute.rt_dev = gdevname; + ghostroute.rt_flags = RTF_UP | RTF_HOST; + ghostroute.rt_metric = 0; + + ret = ioctl(sockfd, SIOCADDRT, (unsigned long)&ghostroute); + if (ret < 0) + { + syslog(LOG_ERR, "TAPDEV: ioctl failed (can't add host route): %d\n", -ret); + close(sockfd); + return; + } +#endif + + close(sockfd); +} + +void tapdev_ifdown(void) +{ +#ifdef CONFIG_SIM_NET_HOST_ROUTE + int sockfd; + int ret; + + if (((struct sockaddr_in *)&ghostroute.rt_dst)->sin_addr.s_addr != 0) + { + /* Get a socket with which to manipulate the tap device */ + + sockfd = socket(AF_INET, SOCK_DGRAM, 0); + if (sockfd < 0) + { + syslog(LOG_ERR, "TAPDEV: Can't open socket: %d\n", -sockfd); + return; + } + + ret = ioctl(sockfd, SIOCDELRT, (unsigned long)&ghostroute); + if (ret < 0) + { + syslog(LOG_ERR, "TAPDEV: ioctl failed (can't delete host route): %d\n", -ret); + } + + close(sockfd); + } +#endif +} + #endif /* !__CYGWIN__ */ - - diff --git a/configs/sim/nettest/defconfig b/configs/sim/nettest/defconfig index 80ce9f678f..acfdb50999 100644 --- a/configs/sim/nettest/defconfig +++ b/configs/sim/nettest/defconfig @@ -37,6 +37,7 @@ CONFIG_BUILD_FLAT=y # CONFIG_ARCH_MATH_H is not set # CONFIG_ARCH_FLOAT_H is not set # CONFIG_ARCH_STDARG_H is not set +# CONFIG_ARCH_DEBUG_H is not set # # Debug Options @@ -73,6 +74,8 @@ CONFIG_HOST_X86_64=y CONFIG_SIM_X8664_SYSTEMV=y # CONFIG_SIM_X8664_MICROSOFT is not set # CONFIG_SIM_WALLTIME is not set +CONFIG_SIM_NET_HOST_ROUTE=y +# CONFIG_SIM_NET_BRIDGE is not set # CONFIG_SIM_FRAMEBUFFER is not set # CONFIG_SIM_SPIFLASH is not set @@ -87,6 +90,7 @@ CONFIG_SIM_X8664_SYSTEMV=y # CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set # CONFIG_ARCH_HAVE_ADDRENV is not set # CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set +CONFIG_ARCH_HAVE_MULTICPU=y # CONFIG_ARCH_HAVE_VFORK is not set # CONFIG_ARCH_HAVE_MMU is not set # CONFIG_ARCH_HAVE_MPU is not set @@ -230,9 +234,10 @@ CONFIG_SIG_SIGCONDTIMEDOUT=16 # CONFIG_PREALLOC_MQ_MSGS=32 CONFIG_MQ_MAXMSGSIZE=32 +# CONFIG_MODULE is not set # -# Work Queue Support +# Work queue support # # CONFIG_SCHED_WORKQUEUE is not set # CONFIG_SCHED_HPWORK is not set @@ -281,8 +286,16 @@ CONFIG_DEV_NULL=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set +# CONFIG_IOEXPANDER is not set # CONFIG_LCD is not set + +# +# LED Support +# +# CONFIG_RGBLED is not set +# CONFIG_PCA9635PW is not set # CONFIG_MMCSD is not set +# CONFIG_MODEM is not set # CONFIG_MTD is not set # CONFIG_EEPROM is not set # CONFIG_NETDEVICES is not set @@ -475,7 +488,9 @@ CONFIG_FS_FAT=y # CONFIG_FAT_LCNAMES is not set # CONFIG_FAT_LFN is not set # CONFIG_FS_FATTIME is not set +# CONFIG_FAT_FORCE_INDIRECT is not set # CONFIG_FAT_DMAMEMORY is not set +# CONFIG_FAT_DIRECT_RETRY is not set # CONFIG_FS_NXFFS is not set # CONFIG_FS_ROMFS is not set # CONFIG_FS_TMPFS is not set @@ -508,6 +523,10 @@ CONFIG_MM_REGIONS=1 # # CONFIG_AUDIO is not set +# +# Wireless Support +# + # # Binary Loader # @@ -553,6 +572,8 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set +CONFIG_ARCH_HAVE_TLS=y +# CONFIG_TLS is not set # CONFIG_LIBC_NETDB is not set # CONFIG_NETDB_HOSTFILE is not set @@ -579,6 +600,7 @@ CONFIG_LIB_SENDFILE_BUFSIZE=512 # # Examples # +# CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -620,11 +642,12 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0xc0a8006a # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PCA9635 is not set # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_POLL is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGBLED is not set # CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_SENDMAIL is not set # CONFIG_EXAMPLES_SERIALBLASTER is not set @@ -632,12 +655,12 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0xc0a8006a # CONFIG_EXAMPLES_SERLOOP is not set # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_TIFF is not set # CONFIG_EXAMPLES_TOUCHSCREEN is not set # CONFIG_EXAMPLES_WEBSERVER is not set -# CONFIG_EXAMPLES_USBSERIAL is not set # CONFIG_EXAMPLES_USBTERM is not set # CONFIG_EXAMPLES_WATCHDOG is not set # CONFIG_EXAMPLES_WGET is not set @@ -645,6 +668,13 @@ CONFIG_EXAMPLES_NETTEST_CLIENTIP=0xc0a8006a # # File System Utilities # +# CONFIG_FSUTILS_INIFILE is not set +# CONFIG_FSUTILS_PASSWD is not set + +# +# GPS Utilities +# +# CONFIG_GPSUTILS_MINMEA_LIB is not set # # Graphics Support @@ -700,11 +730,11 @@ CONFIG_NETUTILS_NETLIB=y # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_HEX2BIN is not set -# CONFIG_FSUTILS_INIFILE is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_RAMTEST is not set # CONFIG_READLINE_HAVE_EXTMATCH is not set # CONFIG_SYSTEM_READLINE is not set # CONFIG_SYSTEM_SUDOKU is not set # CONFIG_SYSTEM_VI is not set +# CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sim/udgram/defconfig b/configs/sim/udgram/defconfig index bf678170a0..c46a0d0bdd 100644 --- a/configs/sim/udgram/defconfig +++ b/configs/sim/udgram/defconfig @@ -37,6 +37,7 @@ CONFIG_BUILD_FLAT=y # CONFIG_ARCH_MATH_H is not set # CONFIG_ARCH_FLOAT_H is not set # CONFIG_ARCH_STDARG_H is not set +# CONFIG_ARCH_DEBUG_H is not set # # Debug Options @@ -73,6 +74,8 @@ CONFIG_HOST_X86_64=y CONFIG_SIM_X8664_SYSTEMV=y # CONFIG_SIM_X8664_MICROSOFT is not set CONFIG_SIM_WALLTIME=y +CONFIG_SIM_NET_HOST_ROUTE=y +# CONFIG_SIM_NET_BRIDGE is not set # CONFIG_SIM_FRAMEBUFFER is not set # CONFIG_SIM_SPIFLASH is not set @@ -87,6 +90,7 @@ CONFIG_SIM_WALLTIME=y # CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set # CONFIG_ARCH_HAVE_ADDRENV is not set # CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set +CONFIG_ARCH_HAVE_MULTICPU=y # CONFIG_ARCH_HAVE_VFORK is not set # CONFIG_ARCH_HAVE_MMU is not set # CONFIG_ARCH_HAVE_MPU is not set @@ -242,9 +246,10 @@ CONFIG_SIG_SIGCONDTIMEDOUT=16 # CONFIG_PREALLOC_MQ_MSGS=32 CONFIG_MQ_MAXMSGSIZE=32 +# CONFIG_MODULE is not set # -# Work Queue Support +# Work queue support # # CONFIG_SCHED_WORKQUEUE is not set # CONFIG_SCHED_HPWORK is not set @@ -293,8 +298,16 @@ CONFIG_DEV_NULL=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set +# CONFIG_IOEXPANDER is not set # CONFIG_LCD is not set + +# +# LED Support +# +# CONFIG_RGBLED is not set +# CONFIG_PCA9635PW is not set # CONFIG_MMCSD is not set +# CONFIG_MODEM is not set # CONFIG_MTD is not set # CONFIG_EEPROM is not set # CONFIG_NETDEVICES is not set @@ -464,13 +477,16 @@ CONFIG_FAT_LCNAMES=y CONFIG_FAT_LFN=y CONFIG_FAT_MAXFNAME=32 # CONFIG_FS_FATTIME is not set +# CONFIG_FAT_FORCE_INDIRECT is not set # CONFIG_FAT_DMAMEMORY is not set +# CONFIG_FAT_DIRECT_RETRY is not set # CONFIG_FS_NXFFS is not set CONFIG_FS_ROMFS=y # CONFIG_FS_TMPFS is not set # CONFIG_FS_SMARTFS is not set CONFIG_FS_BINFS=y CONFIG_FS_PROCFS=y +# CONFIG_FS_PROCFS_REGISTER is not set # # Exclude individual procfs entries @@ -506,6 +522,10 @@ CONFIG_MM_REGIONS=1 # # CONFIG_AUDIO is not set +# +# Wireless Support +# + # # Binary Loader # @@ -555,6 +575,8 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set +CONFIG_ARCH_HAVE_TLS=y +# CONFIG_TLS is not set CONFIG_LIBC_NETDB=y # CONFIG_NETDB_HOSTFILE is not set @@ -586,6 +608,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -594,6 +617,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_FTPC is not set # CONFIG_EXAMPLES_FTPD is not set CONFIG_EXAMPLES_HELLO=y +CONFIG_EXAMPLES_HELLO_PRIORITY=100 +CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_JSON is not set # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_KEYPADTEST is not set @@ -613,10 +638,11 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PCA9635 is not set # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGBLED is not set # CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set @@ -626,6 +652,7 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART_TEST is not set # CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_THTTPD is not set @@ -649,6 +676,13 @@ CONFIG_EXAMPLES_UDGRAM_CLIENT_PRIORITY=100 # # File System Utilities # +# CONFIG_FSUTILS_INIFILE is not set +# CONFIG_FSUTILS_PASSWD is not set + +# +# GPS Utilities +# +# CONFIG_GPSUTILS_MINMEA_LIB is not set # # Graphics Support @@ -682,6 +716,7 @@ CONFIG_NETUTILS_NETLIB=y # NSH Library # CONFIG_NSH_LIBRARY=y +# CONFIG_NSH_MOTD is not set # # Command Line Configuration @@ -742,6 +777,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_SET is not set # CONFIG_NSH_DISABLE_SH is not set # CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TIME is not set # CONFIG_NSH_DISABLE_TEST is not set # CONFIG_NSH_DISABLE_UMOUNT is not set # CONFIG_NSH_DISABLE_UNAME is not set @@ -796,6 +832,8 @@ CONFIG_NSH_ARCHINIT=y # # CONFIG_NSH_NOMAC is not set CONFIG_NSH_MAX_ROUNDTRIP=20 +# CONFIG_NSH_LOGIN is not set +# CONFIG_NSH_CONSOLE_LOGIN is not set # # NxWidgets/NxWM @@ -814,7 +852,6 @@ CONFIG_NSH_MAX_ROUNDTRIP=20 # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_HEX2BIN is not set -# CONFIG_FSUTILS_INIFILE is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_NETDB is not set # CONFIG_SYSTEM_RAMTEST is not set @@ -826,4 +863,5 @@ CONFIG_READLINE_ECHO=y # CONFIG_SYSTEM_SUDOKU is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_SYMTAB is not set +# CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/configs/sim/ustream/defconfig b/configs/sim/ustream/defconfig index 31a861a5ac..10b60384dc 100644 --- a/configs/sim/ustream/defconfig +++ b/configs/sim/ustream/defconfig @@ -37,6 +37,7 @@ CONFIG_BUILD_FLAT=y # CONFIG_ARCH_MATH_H is not set # CONFIG_ARCH_FLOAT_H is not set # CONFIG_ARCH_STDARG_H is not set +# CONFIG_ARCH_DEBUG_H is not set # # Debug Options @@ -73,6 +74,8 @@ CONFIG_HOST_X86_64=y CONFIG_SIM_X8664_SYSTEMV=y # CONFIG_SIM_X8664_MICROSOFT is not set CONFIG_SIM_WALLTIME=y +CONFIG_SIM_NET_HOST_ROUTE=y +# CONFIG_SIM_NET_BRIDGE is not set # CONFIG_SIM_FRAMEBUFFER is not set # CONFIG_SIM_SPIFLASH is not set @@ -87,6 +90,7 @@ CONFIG_SIM_WALLTIME=y # CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set # CONFIG_ARCH_HAVE_ADDRENV is not set # CONFIG_ARCH_NEED_ADDRENV_MAPPING is not set +CONFIG_ARCH_HAVE_MULTICPU=y # CONFIG_ARCH_HAVE_VFORK is not set # CONFIG_ARCH_HAVE_MMU is not set # CONFIG_ARCH_HAVE_MPU is not set @@ -242,9 +246,10 @@ CONFIG_SIG_SIGCONDTIMEDOUT=16 # CONFIG_PREALLOC_MQ_MSGS=32 CONFIG_MQ_MAXMSGSIZE=32 +# CONFIG_MODULE is not set # -# Work Queue Support +# Work queue support # # CONFIG_SCHED_WORKQUEUE is not set # CONFIG_SCHED_HPWORK is not set @@ -293,8 +298,16 @@ CONFIG_DEV_NULL=y # CONFIG_VIDEO_DEVICES is not set # CONFIG_BCH is not set # CONFIG_INPUT is not set +# CONFIG_IOEXPANDER is not set # CONFIG_LCD is not set + +# +# LED Support +# +# CONFIG_RGBLED is not set +# CONFIG_PCA9635PW is not set # CONFIG_MMCSD is not set +# CONFIG_MODEM is not set # CONFIG_MTD is not set # CONFIG_EEPROM is not set # CONFIG_NETDEVICES is not set @@ -464,13 +477,16 @@ CONFIG_FAT_LCNAMES=y CONFIG_FAT_LFN=y CONFIG_FAT_MAXFNAME=32 # CONFIG_FS_FATTIME is not set +# CONFIG_FAT_FORCE_INDIRECT is not set # CONFIG_FAT_DMAMEMORY is not set +# CONFIG_FAT_DIRECT_RETRY is not set # CONFIG_FS_NXFFS is not set CONFIG_FS_ROMFS=y # CONFIG_FS_TMPFS is not set # CONFIG_FS_SMARTFS is not set CONFIG_FS_BINFS=y CONFIG_FS_PROCFS=y +# CONFIG_FS_PROCFS_REGISTER is not set # # Exclude individual procfs entries @@ -506,6 +522,10 @@ CONFIG_MM_REGIONS=1 # # CONFIG_AUDIO is not set +# +# Wireless Support +# + # # Binary Loader # @@ -555,6 +575,8 @@ CONFIG_ARCH_LOWPUTC=y CONFIG_LIB_SENDFILE_BUFSIZE=512 # CONFIG_ARCH_ROMGETC is not set # CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set +CONFIG_ARCH_HAVE_TLS=y +# CONFIG_TLS is not set CONFIG_LIBC_NETDB=y # CONFIG_NETDB_HOSTFILE is not set @@ -586,6 +608,7 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # # Examples # +# CONFIG_EXAMPLES_CHAT is not set # CONFIG_EXAMPLES_CONFIGDATA is not set # CONFIG_EXAMPLES_CPUHOG is not set # CONFIG_EXAMPLES_DHCPD is not set @@ -594,6 +617,8 @@ CONFIG_BUILTIN_PROXY_STACKSIZE=1024 # CONFIG_EXAMPLES_FTPC is not set # CONFIG_EXAMPLES_FTPD is not set CONFIG_EXAMPLES_HELLO=y +CONFIG_EXAMPLES_HELLO_PRIORITY=100 +CONFIG_EXAMPLES_HELLO_STACKSIZE=2048 # CONFIG_EXAMPLES_JSON is not set # CONFIG_EXAMPLES_HIDKBD is not set # CONFIG_EXAMPLES_KEYPADTEST is not set @@ -613,10 +638,11 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_NXLINES is not set # CONFIG_EXAMPLES_NXTEXT is not set # CONFIG_EXAMPLES_OSTEST is not set +# CONFIG_EXAMPLES_PCA9635 is not set # CONFIG_EXAMPLES_PIPE is not set # CONFIG_EXAMPLES_PPPD is not set # CONFIG_EXAMPLES_POSIXSPAWN is not set -# CONFIG_EXAMPLES_QENCODER is not set +# CONFIG_EXAMPLES_RGBLED is not set # CONFIG_EXAMPLES_RGMP is not set # CONFIG_EXAMPLES_ROMFS is not set # CONFIG_EXAMPLES_SENDMAIL is not set @@ -626,6 +652,7 @@ CONFIG_EXAMPLES_NSH=y # CONFIG_EXAMPLES_SLCD is not set # CONFIG_EXAMPLES_SMART_TEST is not set # CONFIG_EXAMPLES_SMART is not set +# CONFIG_EXAMPLES_SMP is not set # CONFIG_EXAMPLES_TCPECHO is not set # CONFIG_EXAMPLES_TELNETD is not set # CONFIG_EXAMPLES_THTTPD is not set @@ -644,6 +671,13 @@ CONFIG_EXAMPLES_USTREAM_ADDR="/dev/fifo" # # File System Utilities # +# CONFIG_FSUTILS_INIFILE is not set +# CONFIG_FSUTILS_PASSWD is not set + +# +# GPS Utilities +# +# CONFIG_GPSUTILS_MINMEA_LIB is not set # # Graphics Support @@ -677,6 +711,7 @@ CONFIG_NETUTILS_NETLIB=y # NSH Library # CONFIG_NSH_LIBRARY=y +# CONFIG_NSH_MOTD is not set # # Command Line Configuration @@ -737,6 +772,7 @@ CONFIG_NSH_DISABLE_LOSMART=y # CONFIG_NSH_DISABLE_SET is not set # CONFIG_NSH_DISABLE_SH is not set # CONFIG_NSH_DISABLE_SLEEP is not set +# CONFIG_NSH_DISABLE_TIME is not set # CONFIG_NSH_DISABLE_TEST is not set # CONFIG_NSH_DISABLE_UMOUNT is not set # CONFIG_NSH_DISABLE_UNAME is not set @@ -791,6 +827,8 @@ CONFIG_NSH_ARCHINIT=y # # CONFIG_NSH_NOMAC is not set CONFIG_NSH_MAX_ROUNDTRIP=20 +# CONFIG_NSH_LOGIN is not set +# CONFIG_NSH_CONSOLE_LOGIN is not set # # NxWidgets/NxWM @@ -809,7 +847,6 @@ CONFIG_NSH_MAX_ROUNDTRIP=20 # CONFIG_SYSTEM_CUTERM is not set # CONFIG_SYSTEM_INSTALL is not set # CONFIG_SYSTEM_HEX2BIN is not set -# CONFIG_FSUTILS_INIFILE is not set # CONFIG_SYSTEM_HEXED is not set # CONFIG_SYSTEM_NETDB is not set # CONFIG_SYSTEM_RAMTEST is not set @@ -821,4 +858,5 @@ CONFIG_READLINE_ECHO=y # CONFIG_SYSTEM_SUDOKU is not set # CONFIG_SYSTEM_VI is not set # CONFIG_SYSTEM_SYMTAB is not set +# CONFIG_SYSTEM_UBLOXMODEM is not set # CONFIG_SYSTEM_ZMODEM is not set diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c index b6431582b1..0fff9041c3 100644 --- a/net/arp/arp_send.c +++ b/net/arp/arp_send.c @@ -344,7 +344,10 @@ int arp_send(in_addr_t ipaddr) * its single argument to lookup the network interface. */ - dev->d_txavail(dev); + if (dev->d_txavail) + { + dev->d_txavail(dev); + } /* Wait for the send to complete or an error to occur: NOTES: (1) * net_lockedwait will also terminate if a signal is received, (2)