diff options
Diffstat (limited to 'uLan/ports/os/lwipopts.h')
-rw-r--r-- | uLan/ports/os/lwipopts.h | 210 |
1 files changed, 209 insertions, 1 deletions
diff --git a/uLan/ports/os/lwipopts.h b/uLan/ports/os/lwipopts.h index 50ac639..6e4287a 100644 --- a/uLan/ports/os/lwipopts.h +++ b/uLan/ports/os/lwipopts.h @@ -1,3 +1,4 @@ +#if 0 /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. * All rights reserved. @@ -43,12 +44,23 @@ #define LWIP_ETHERNET 1 #define LWIP_NETIF_API 1 +#define LWIP_AUTOIP 1 /* Enable DHCP to test it, disable UDP checksum to easier inject packets */ #define LWIP_DHCP 1 #define LWIP_TIMEVAL_PRIVATE 0 -#define LWIP_POSIX_SOCKETS_IO_NAMES 0 +#define LWIP_POSIX_SOCKETS_IO_NAMES 1 +//#define LWIP_COMPAT_SOCKETS 2 +#ifndef FIONREAD +#define FIONREAD 1 +#endif +#ifndef FIONBIO +#define FIONBIO 1 +#endif +#define THREAD_STACK_SIZE 4096 +#define LWIP_TIMERS 1 /* Minimal changes to opt.h required for tcp unit tests: */ + #define MEM_SIZE 16000 #define TCP_SND_QUEUELEN 40 #define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN @@ -62,3 +74,199 @@ #define ETHARP_SUPPORT_STATIC_ENTRIES 1 #endif /* LWIP_HDR_LWIPOPTS_H__ */ + +#endif /* 0 */ + +/** + * \file lwipopts.h - Configuration options for lwIP + * + * Copyright (c) 2010 Texas Instruments Incorporated + */ +/* + * Copyright (c) 2001-2004 Swedish Institute of Computer Science. + * All rights reserved. + * + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels <adam@sics.se> + * + */ + +#ifndef __LWIPOPTS_H__ +#define __LWIPOPTS_H__ + +/***************************************************************************** +** CONFIGURATIONS +*****************************************************************************/ + +/* +** The macro CPSW_DUAL_MAC_MODE shall be defined for using CPSW ports in +** Dual MAC mode. +*/ +#define CPSW_DUAL_MAC_MODE + +/* +** The below macro should be defined for using lwIP with cache. For cache +** enabling, pbuf pool shall be cache line aligned. This is done by using +** separate pool for each memory. The alignment of pbuf pool to cache line +** size is done in /ports/cpsw/include/arch/cc.h. +*/ +/*#define LWIP_CACHE_ENABLED*/ + +#define SOC_CACHELINE_SIZE_BYTES 64 /* Number of bytes in + a cache line */ +/* +** The timeout for DHCP completion. lwIP library will wait for DHCP +** completion for (LWIP_DHCP_TIMEOUT / 100) seconds. +*/ +#define LWIP_DHCP_TIMEOUT 1000 + +/* +** The number of times DHCP is attempted. Each time, the library will wait +** for (LWIP_DHCP_TIMEOUT / 100) seconds for DHCP completion. +*/ +#define NUM_DHCP_TRIES 5 + +#define LWIP_ETHERNET 1 +#define LWIP_ARP 1 +#define LWIP_DNS 1 + +/***************************************************************************** +** lwIP SPECIFIC DEFINITIONS - To be used by lwIP stack +*****************************************************************************/ +#define HOST_TMR_INTERVAL 0 +#define DYNAMIC_HTTP_HEADERS + +/***************************************************************************** +** Platform specific locking +*****************************************************************************/ +#define SYS_LIGHTWEIGHT_PROT 1 +#define NO_SYS 0 +#define NO_SYS_NO_TIMERS 0 + +/***************************************************************************** +** Memory Options +*****************************************************************************/ +#define MEM_ALIGNMENT 4 +#define MEM_SIZE (1024 * 1024) /* 4K */ + +#define MEMP_NUM_PBUF 96 +#define MEMP_NUM_TCP_PCB 32 +#define MEMP_NUM_TCP_SEG 32 +#define PBUF_POOL_SIZE 512 +#define MEMP_MEM_MALLOC 1 +#define MEMP_MEM_INIT 1 +#define MEMP_OVERFLOW_CHECK 0 + +#ifdef LWIP_CACHE_ENABLED +#define MEMP_SEPARATE_POOLS 1 /* We want the pbuf + pool cache line + aligned*/ +#endif + +//#define MEMP_NUM_SYS_TIMEOUT (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_SUPPORT) + +/***************************************************************************** +** IP Options +*****************************************************************************/ +#define IP_REASSEMBLY 0 +#define IP_FRAG 0 +#define LWIP_IPV4 1 +#define LWIP_IPV6 1 + +/***************************************************************************** +** DHCP Options +*****************************************************************************/ +#define LWIP_DHCP 1 +#define DHCP_DOES_ARP_CHECK 0 + +/***************************************************************************** +** Auto IP Options +*****************************************************************************/ +#define LWIP_AUTOIP 1 +#define LWIP_DHCP_AUTOIP_COOP ((LWIP_DHCP) && (LWIP_AUTOIP)) + +/***************************************************************************** +** TCP Options +*****************************************************************************/ +#define TCP_MSS 1500 +#define TCP_WND (8 * TCP_MSS) +#define TCP_SND_BUF (8 * TCP_MSS) +#define TCP_OVERSIZE TCP_MSS +#define LWIP_TCPIP_CORE_LOCKING 1 + +/***************************************************************************** +** PBUF Options +*****************************************************************************/ +#define PBUF_LINK_HLEN 14 +#define PBUF_POOL_BUFSIZE 1520 /* + size of struct pbuf + shall be cache line + aligned be enabled */ +#define ETH_PAD_SIZE 0 +#define LWIP_NETCONN 1 + +/***************************************************************************** +** Socket Options +*****************************************************************************/ +#define LWIP_SOCKET 1 +#define SO_REUSE 1 + +/***************************************************************************** +** Debugging options +*****************************************************************************/ +#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_OFF +#define LWIP_DBG_TYPES_ON (LWIP_DBG_ON | LWIP_DBG_TRACE \ + |LWIP_DBG_STATE | LWIP_DBG_FRESH) +#define DHCP_DEBUG LWIP_DBG_OFF +#define NETIF_DEBUG LWIP_DBG_OFF +#define IP_DEBUG LWIP_DBG_OFF +#define UDP_DEBUG LWIP_DBG_OFF +#define ETHARP_DEBUG LWIP_DBG_OFF +#define SYS_DEBUG LWIP_DBG_OFF +#define RAW_DEBUG LWIP_DBG_OFF +#define MEM_DEBUG LWIP_DBG_OFF +#define MEMP_DEBUG LWIP_DBG_OFF +#define PBUF_DEBUG LWIP_DBG_OFF +#define TCPIP_DEBUG LWIP_DBG_OFF +#define APP_DEBUG LWIP_DBG_OFF +#define SOCKETS_DEBUG LWIP_DBG_OFF +#define LWIP_STATS 0 +#define LWIP_STATS_DISPLAY 0 +#define LWIP_STATS_POSIX 0 +#define LWIP_DNS_API_DEFINE_ERRORS 1 + + + +/** + * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. + * (only used if you use sockets.c) + */ +#define LWIP_COMPAT_SOCKETS 0 + + #define LWIP_TIMEVAL_PRIVATE 0 + + #define LWIP_RAW 0 + +#endif /* __LWIPOPTS_H__ */ |