Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 41549c0

Browse files
authored
Update Packages' Patches
1 parent 63d4891 commit 41549c0

File tree

5 files changed

+365
-321
lines changed

5 files changed

+365
-321
lines changed

Packages_Patches/arduino/hardware/mbed_portenta/3.0.0/cores/arduino/mbed/connectivity/lwipstack/include/lwipstack/lwipopts.h

+107-107
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
/* Copyright (C) 2012 mbed.org, MIT License
2-
*
3-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4-
* and associated documentation files (the "Software"), to deal in the Software without restriction,
5-
* including without limitation the rights to use, copy, modify, merge, publish, distribute,
6-
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7-
* furnished to do so, subject to the following conditions:
8-
*
9-
* The above copyright notice and this permission notice shall be included in all copies or
10-
* substantial portions of the Software.
11-
*
12-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
13-
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14-
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15-
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17-
*/
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
4+
and associated documentation files (the "Software"), to deal in the Software without restriction,
5+
including without limitation the rights to use, copy, modify, merge, publish, distribute,
6+
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7+
furnished to do so, subject to the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included in all copies or
10+
substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
13+
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
15+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17+
*/
1818

1919
#ifndef LWIPOPTS_H
2020
#define LWIPOPTS_H
2121

2222
// Workaround for Linux timeval
2323
#if defined (TOOLCHAIN_GCC)
24-
#define LWIP_TIMEVAL_PRIVATE 0
25-
#include <sys/time.h>
24+
#define LWIP_TIMEVAL_PRIVATE 0
25+
#include <sys/time.h>
2626
#endif
2727
#include "nsapi_types.h"
2828
#include "mbed_retarget.h"
@@ -35,7 +35,7 @@
3535
#define NO_SYS 0
3636

3737
#if !MBED_CONF_LWIP_IPV4_ENABLED && !MBED_CONF_LWIP_IPV6_ENABLED
38-
#error "Either IPv4 or IPv6 must be enabled."
38+
#error "Either IPv4 or IPv6 must be enabled."
3939
#endif
4040

4141
#define LWIP_IPV4 MBED_CONF_LWIP_IPV4_ENABLED
@@ -47,16 +47,16 @@
4747
// On dual stack configuration how long to wait for both or preferred stack
4848
// addresses before completing bring up.
4949
#if LWIP_IPV4 && LWIP_IPV6
50-
#if MBED_CONF_LWIP_ADDR_TIMEOUT_MODE
51-
#define BOTH_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
52-
#define PREF_ADDR_TIMEOUT 0
53-
#else
54-
#define PREF_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
55-
#define BOTH_ADDR_TIMEOUT 0
56-
#endif
50+
#if MBED_CONF_LWIP_ADDR_TIMEOUT_MODE
51+
#define BOTH_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
52+
#define PREF_ADDR_TIMEOUT 0
53+
#else
54+
#define PREF_ADDR_TIMEOUT MBED_CONF_LWIP_ADDR_TIMEOUT
55+
#define BOTH_ADDR_TIMEOUT 0
56+
#endif
5757
#else
58-
#define PREF_ADDR_TIMEOUT 0
59-
#define BOTH_ADDR_TIMEOUT 0
58+
#define PREF_ADDR_TIMEOUT 0
59+
#define BOTH_ADDR_TIMEOUT 0
6060
#endif
6161

6262

@@ -68,52 +68,52 @@
6868
#define PREF_IPV6 2
6969

7070
#if MBED_CONF_LWIP_IP_VER_PREF == 6
71-
#define IP_VERSION_PREF PREF_IPV6
71+
#define IP_VERSION_PREF PREF_IPV6
7272
#elif MBED_CONF_LWIP_IP_VER_PREF == 4
73-
#define IP_VERSION_PREF PREF_IPV4
73+
#define IP_VERSION_PREF PREF_IPV4
7474
#else
75-
#error "Either IPv4 or IPv6 must be preferred."
75+
#error "Either IPv4 or IPv6 must be preferred."
7676
#endif
7777

7878
#undef LWIP_DEBUG
7979
#if MBED_CONF_LWIP_DEBUG_ENABLED
80-
#define LWIP_DEBUG 1
80+
#define LWIP_DEBUG 1
8181
#endif
8282

8383
#if NO_SYS == 0
84-
#include "cmsis_os2.h"
84+
#include "cmsis_os2.h"
8585

86-
#define SYS_LIGHTWEIGHT_PROT 1
86+
#define SYS_LIGHTWEIGHT_PROT 1
8787

88-
#define LWIP_RAW MBED_CONF_LWIP_RAW_SOCKET_ENABLED
88+
#define LWIP_RAW MBED_CONF_LWIP_RAW_SOCKET_ENABLED
8989

90-
#define MEMP_NUM_TCPIP_MSG_INPKT MBED_CONF_LWIP_MEMP_NUM_TCPIP_MSG_INPKT
90+
#define MEMP_NUM_TCPIP_MSG_INPKT MBED_CONF_LWIP_MEMP_NUM_TCPIP_MSG_INPKT
9191

92-
// Thread stacks use 8-byte alignment
93-
#define LWIP_ALIGN_UP(pos, align) ((pos) % (align) ? (pos) + ((align) - (pos) % (align)) : (pos))
92+
// Thread stacks use 8-byte alignment
93+
#define LWIP_ALIGN_UP(pos, align) ((pos) % (align) ? (pos) + ((align) - (pos) % (align)) : (pos))
9494

95-
#ifdef LWIP_DEBUG
96-
// For LWIP debug, double the stack
97-
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE*2, 8)
98-
#elif MBED_DEBUG
99-
// When debug is enabled on the build increase stack 25 percent
100-
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE + MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE / 4, 8)
101-
#else
102-
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE, 8)
103-
#endif
95+
#ifdef LWIP_DEBUG
96+
// For LWIP debug, double the stack
97+
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE*2, 8)
98+
#elif MBED_DEBUG
99+
// When debug is enabled on the build increase stack 25 percent
100+
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE + MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE / 4, 8)
101+
#else
102+
#define TCPIP_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_TCPIP_THREAD_STACKSIZE, 8)
103+
#endif
104104

105-
// Thread priority (osPriorityNormal by default)
106-
#define TCPIP_THREAD_PRIO (MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY)
105+
// Thread priority (osPriorityNormal by default)
106+
#define TCPIP_THREAD_PRIO (MBED_CONF_LWIP_TCPIP_THREAD_PRIORITY)
107107

108-
#ifdef LWIP_DEBUG
109-
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE*2, 8)
110-
#else
111-
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE, 8)
112-
#endif
108+
#ifdef LWIP_DEBUG
109+
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE*2, 8)
110+
#else
111+
#define DEFAULT_THREAD_STACKSIZE LWIP_ALIGN_UP(MBED_CONF_LWIP_DEFAULT_THREAD_STACKSIZE, 8)
112+
#endif
113113

114-
#define MEMP_NUM_SYS_TIMEOUT 16
114+
#define MEMP_NUM_SYS_TIMEOUT 16
115115

116-
#define sys_msleep(ms) sys_msleep(ms)
116+
#define sys_msleep(ms) sys_msleep(ms)
117117

118118
#endif
119119

@@ -143,16 +143,16 @@
143143
#define PBUF_POOL_SIZE MBED_CONF_LWIP_PBUF_POOL_SIZE
144144

145145
#ifdef MBED_CONF_LWIP_PBUF_POOL_BUFSIZE
146-
#undef PBUF_POOL_BUFSIZE
147-
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(MBED_CONF_LWIP_PBUF_POOL_BUFSIZE)
146+
#undef PBUF_POOL_BUFSIZE
147+
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(MBED_CONF_LWIP_PBUF_POOL_BUFSIZE)
148148
#else
149-
#ifndef PBUF_POOL_BUFSIZE
150-
#if LWIP_IPV6
151-
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
152-
#elif LWIP_IPV4
153-
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+20+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
154-
#endif
155-
#endif
149+
#ifndef PBUF_POOL_BUFSIZE
150+
#if LWIP_IPV6
151+
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
152+
#elif LWIP_IPV4
153+
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+20+20+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
154+
#endif
155+
#endif
156156
#endif
157157

158158
#define MEM_SIZE MBED_CONF_LWIP_MEM_SIZE
@@ -181,14 +181,14 @@
181181
#define MEMP_NUM_NETCONN MBED_CONF_LWIP_SOCKET_MAX
182182

183183
#if MBED_CONF_LWIP_TCP_ENABLED
184-
#define LWIP_TCP 1
185-
#define TCP_OVERSIZE 0
186-
#define LWIP_TCP_KEEPALIVE 1
184+
#define LWIP_TCP 1
185+
#define TCP_OVERSIZE 0
186+
#define LWIP_TCP_KEEPALIVE 1
187187

188-
#define TCP_CLOSE_TIMEOUT MBED_CONF_LWIP_TCP_CLOSE_TIMEOUT
188+
#define TCP_CLOSE_TIMEOUT MBED_CONF_LWIP_TCP_CLOSE_TIMEOUT
189189

190190
#else
191-
#define LWIP_TCP 0
191+
#define LWIP_TCP 0
192192
#endif
193193

194194
#define LWIP_DNS 1
@@ -251,13 +251,13 @@
251251
#define UDP_LPC_EMAC LWIP_DBG_OFF
252252

253253
#ifdef LWIP_DEBUG
254-
#define MEMP_OVERFLOW_CHECK 1
255-
#define MEMP_SANITY_CHECK 1
256-
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
257-
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
254+
#define MEMP_OVERFLOW_CHECK 1
255+
#define MEMP_SANITY_CHECK 1
256+
#define LWIP_DBG_TYPES_ON LWIP_DBG_ON
257+
#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL
258258
#else
259-
#define LWIP_NOASSERT 1
260-
#define LWIP_STATS 0
259+
#define LWIP_NOASSERT 1
260+
#define LWIP_STATS 0
261261
#endif
262262

263263
#define TRACE_TO_ASCII_HEX_DUMP 0
@@ -269,18 +269,18 @@
269269
// Interface type configuration
270270

271271
#if MBED_CONF_LWIP_ETHERNET_ENABLED
272-
#define LWIP_ARP 1
273-
#define LWIP_ETHERNET 1
274-
#define LWIP_DHCP LWIP_IPV4
272+
#define LWIP_ARP 1
273+
#define LWIP_ETHERNET 1
274+
#define LWIP_DHCP LWIP_IPV4
275275
#else
276-
#define LWIP_ARP 0
277-
#define LWIP_ETHERNET 0
276+
#define LWIP_ARP 0
277+
#define LWIP_ETHERNET 0
278278
#endif // MBED_CONF_LWIP_ETHERNET_ENABLED
279279

280280
#if MBED_CONF_LWIP_L3IP_ENABLED
281-
#define LWIP_L3IP 1
281+
#define LWIP_L3IP 1
282282
#else
283-
#define LWIP_L3IP 0
283+
#define LWIP_L3IP 0
284284
#endif
285285

286286
//Maximum size of network interface name
@@ -291,27 +291,27 @@
291291
// Enable PPP for now either from lwIP PPP configuration (obsolete) or from PPP service configuration
292292
#if MBED_CONF_PPP_ENABLED || MBED_CONF_LWIP_PPP_ENABLED
293293

294-
#define PPP_SUPPORT 1
295-
296-
#if MBED_CONF_PPP_IPV4_ENABLED || MBED_CONF_LWIP_IPV4_ENABLED
297-
#define LWIP 0x11991199
298-
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV4_ENABLED
299-
#error LWIP: IPv4 PPP enabled but not IPv4
300-
#endif
301-
#undef LWIP
302-
#define PPP_IPV4_SUPPORT 1
303-
#endif
304-
305-
#if MBED_CONF_PPP_IPV6_ENABLED || MBED_CONF_LWIP_IPV6_ENABLED
306-
#define LWIP 0x11991199
307-
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV6_ENABLED
308-
#error LWIP: IPv6 PPP enabled but not IPv6
309-
#endif
310-
#undef LWIP
311-
#define PPP_IPV6_SUPPORT 1
312-
// Later to be dynamic for use for multiple interfaces
313-
#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0
314-
#endif
294+
#define PPP_SUPPORT 1
295+
296+
#if MBED_CONF_PPP_IPV4_ENABLED || MBED_CONF_LWIP_IPV4_ENABLED
297+
#define LWIP 0x11991199
298+
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV4_ENABLED
299+
#error LWIP: IPv4 PPP enabled but not IPv4
300+
#endif
301+
#undef LWIP
302+
#define PPP_IPV4_SUPPORT 1
303+
#endif
304+
305+
#if MBED_CONF_PPP_IPV6_ENABLED || MBED_CONF_LWIP_IPV6_ENABLED
306+
#define LWIP 0x11991199
307+
#if (MBED_CONF_NSAPI_DEFAULT_STACK == LWIP) && !MBED_CONF_LWIP_IPV6_ENABLED
308+
#error LWIP: IPv6 PPP enabled but not IPv6
309+
#endif
310+
#undef LWIP
311+
#define PPP_IPV6_SUPPORT 1
312+
// Later to be dynamic for use for multiple interfaces
313+
#define LWIP_IPV6_DUP_DETECT_ATTEMPTS 0
314+
#endif
315315

316316
#endif
317317

@@ -320,7 +320,7 @@
320320
// Make sure we default these to off, so
321321
// LWIP doesn't default to on
322322
#ifndef LWIP_ARP
323-
#define LWIP_ARP 0
323+
#define LWIP_ARP 0
324324
#endif
325325

326326
// Checksum-on-copy disabled due to https://savannah.nongnu.org/bugs/?50914
@@ -337,9 +337,9 @@
337337
#include "lwip_tcp_isn.h"
338338
#define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn
339339
#ifdef MBEDTLS_MD5_C
340-
#define LWIP_USE_EXTERNAL_MBEDTLS 1
340+
#define LWIP_USE_EXTERNAL_MBEDTLS 1
341341
#else
342-
#define LWIP_USE_EXTERNAL_MBEDTLS 0
342+
#define LWIP_USE_EXTERNAL_MBEDTLS 0
343343
#endif
344344

345345
#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS MBED_CONF_LWIP_ND6_RDNSS_MAX_DNS_SERVERS

0 commit comments

Comments
 (0)