1 /* SPDX-License-Identifier: GPL-2.0+ */
2 
3 /* Copyright (C) 2023 Linaro Ltd. <maxim.uvarov@linaro.org> */
4 
5 #ifndef LWIP_UBOOT_LWIPOPTS_H
6 #define LWIP_UBOOT_LWIPOPTS_H
7 
8 #include <linux/kconfig.h>
9 
10 #if defined(CONFIG_LWIP_DEBUG)
11 #define LWIP_DEBUG 1
12 #define LWIP_DBG_MIN_LEVEL              LWIP_DBG_LEVEL_ALL
13 #define LWIP_DBG_TYPES_ON               LWIP_DBG_ON
14 #define ETHARP_DEBUG                    LWIP_DBG_ON
15 #define NETIF_DEBUG                     LWIP_DBG_ON
16 #define PBUF_DEBUG                      LWIP_DBG_OFF
17 #define API_LIB_DEBUG                   LWIP_DBG_ON
18 #define API_MSG_DEBUG                   LWIP_DBG_OFF
19 #define SOCKETS_DEBUG                   LWIP_DBG_OFF
20 #define ICMP_DEBUG                      LWIP_DBG_OFF
21 #define IGMP_DEBUG                      LWIP_DBG_OFF
22 #define INET_DEBUG                      LWIP_DBG_OFF
23 #define IP_DEBUG                        LWIP_DBG_ON
24 #define IP_REASS_DEBUG                  LWIP_DBG_OFF
25 #define RAW_DEBUG                       LWIP_DBG_OFF
26 #define MEM_DEBUG                       LWIP_DBG_OFF
27 #define MEMP_DEBUG                      LWIP_DBG_OFF
28 #define SYS_DEBUG                       LWIP_DBG_OFF
29 #define TIMERS_DEBUG                    LWIP_DBG_ON
30 #define TCP_DEBUG                       LWIP_DBG_OFF
31 #define TCP_INPUT_DEBUG                 LWIP_DBG_OFF
32 #define TCP_FR_DEBUG                    LWIP_DBG_OFF
33 #define TCP_RTO_DEBUG                   LWIP_DBG_OFF
34 #define TCP_CWND_DEBUG                  LWIP_DBG_OFF
35 #define TCP_WND_DEBUG                   LWIP_DBG_OFF
36 #define TCP_OUTPUT_DEBUG                LWIP_DBG_OFF
37 #define TCP_RST_DEBUG                   LWIP_DBG_OFF
38 #define TCP_QLEN_DEBUG                  LWIP_DBG_OFF
39 #define UDP_DEBUG                       LWIP_DBG_OFF
40 #define TCPIP_DEBUG                     LWIP_DBG_OFF
41 #define SLIP_DEBUG                      LWIP_DBG_OFF
42 #define DHCP_DEBUG                      LWIP_DBG_ON
43 #define AUTOIP_DEBUG                    LWIP_DBG_ON
44 #define DNS_DEBUG                       LWIP_DBG_ON
45 #define IP6_DEBUG                       LWIP_DBG_OFF
46 #define DHCP6_DEBUG                     LWIP_DBG_OFF
47 #endif
48 
49 #define LWIP_TESTMODE                   0
50 
51 #if !defined(CONFIG_LWIP_ASSERT)
52 #define LWIP_NOASSERT 1
53 #define LWIP_ASSERT(message, assertion)
54 #endif
55 
56 #include "lwip/debug.h"
57 
58 #define SYS_LIGHTWEIGHT_PROT            0
59 #define NO_SYS                          1
60 
61 #define LWIP_IPV4			1
62 #define LWIP_IPV6			0
63 
64 #define MEM_ALIGNMENT                   8
65 
66 #define MEMP_NUM_TCP_SEG                16
67 #define PBUF_POOL_SIZE                  8
68 
69 #define LWIP_ARP                        1
70 #define ARP_TABLE_SIZE                  4
71 #define ARP_QUEUEING                    1
72 
73 #define IP_FORWARD                      0
74 #define IP_OPTIONS_ALLOWED              1
75 #define IP_REASSEMBLY                   1
76 #define IP_FRAG                         1
77 #define IP_REASS_MAXAGE                 3
78 #define IP_REASS_MAX_PBUFS              4
79 #define IP_FRAG_USES_STATIC_BUF         0
80 
81 #define IP_DEFAULT_TTL                  255
82 
83 #if defined(CONFIG_PROT_ICMP_LWIP)
84 #define LWIP_ICMP                       1
85 #else
86 #define LWIP_ICMP                       0
87 #endif
88 
89 #if defined(CONFIG_PROT_RAW_LWIP)
90 #define LWIP_RAW                        1
91 #else
92 #define LWIP_RAW			0
93 #endif
94 
95 #if defined(CONFIG_PROT_DHCP_LWIP)
96 #define LWIP_DHCP                       1
97 #define LWIP_DHCP_BOOTP_FILE		1
98 #else
99 #define LWIP_DHCP			0
100 #endif
101 
102 #define LWIP_DHCP_DOES_ACD_CHECK	0
103 
104 #define LWIP_AUTOIP                     0
105 
106 #define LWIP_SNMP                       0
107 
108 #define LWIP_IGMP                       0
109 
110 #if defined(CONFIG_PROT_DNS_LWIP)
111 #define LWIP_DNS                        1
112 #define DNS_TABLE_SIZE                  1
113 #else
114 #define LWIP_DNS                        0
115 #endif
116 
117 #if defined(CONFIG_PROT_UDP_LWIP)
118 #define LWIP_UDP                        1
119 #else
120 #define LWIP_UDP                        0
121 #endif
122 
123 #if defined(CONFIG_PROT_TCP_LWIP)
124 #define LWIP_TCP                        1
125 #define TCP_MSS                         1460
126 #define TCP_WND                         CONFIG_LWIP_TCP_WND
127 #define LWIP_WND_SCALE                  1
128 #define TCP_RCV_SCALE                   0x7
129 #define TCP_SND_BUF                     (2 * TCP_MSS)
130 #ifdef CONFIG_PROT_TCP_SACK_LWIP
131 #define LWIP_TCP_SACK_OUT               1
132 #endif
133 #else
134 #define LWIP_TCP                        0
135 #endif
136 
137 #define LWIP_LISTEN_BACKLOG             0
138 
139 #define PBUF_LINK_HLEN                  14
140 #define PBUF_POOL_BUFSIZE               LWIP_MEM_ALIGN_SIZE(TCP_MSS + 40 + PBUF_LINK_HLEN)
141 
142 #define LWIP_HAVE_LOOPIF                0
143 
144 #define LWIP_NETCONN                    0
145 #define LWIP_DISABLE_MEMP_SANITY_CHECKS 1
146 
147 #define LWIP_SOCKET                     0
148 #define SO_REUSE                        0
149 
150 #define LWIP_STATS                      0
151 
152 #define PPP_SUPPORT                     0
153 
154 #define LWIP_TCPIP_CORE_LOCKING		0
155 
156 #define LWIP_NETIF_LOOPBACK		0
157 
158 /* use malloc instead of pool */
159 #define MEMP_MEM_MALLOC                 1
160 #define MEMP_MEM_INIT			1
161 #define MEM_LIBC_MALLOC			1
162 
163 #if CONFIG_IS_ENABLED(MBEDTLS_LIB_TLS)
164 #define LWIP_ALTCP                      1
165 #define LWIP_ALTCP_TLS                  1
166 #define LWIP_ALTCP_TLS_MBEDTLS          1
167 #endif
168 
169 #if defined(CONFIG_CMD_SNTP)
170 #define LWIP_DHCP_GET_NTP_SRV 1
171 #endif
172 
173 #endif /* LWIP_UBOOT_LWIPOPTS_H */
174