Skip to content

Commit d6eebaa

Browse files
committed
[TCPIP] Synchronize LWIP code to 2.2.0
- take code from STABLE-2_2_0_RELEASE commit on https://git.savannah.gnu.org/git/lwip.git - remove lwip/contrib directory - do required changes due to upgrade in * CMakeLists.txt * include/lwip/arch/cc.h * include/lwip/arch/sys_arch.h * include/lwip/lwipopts.h * include/tcpip.h * ip/CMakeLists.txt * ip/lwip_glue/lwip_glue.h * ip/lwip_glue/tcp.c * ip/transport/tcp/if.c * tcpip/icmp.c CORE-13098
1 parent bc94df7 commit d6eebaa

File tree

449 files changed

+132655
-38573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

449 files changed

+132655
-38573
lines changed

drivers/network/tcpip/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ set(LWIP_INCLUDE_DIRS
44
${LWIP_DIR}/src/include
55
${CMAKE_CURRENT_SOURCE_DIR}/include/lwip
66
)
7-
add_subdirectory(lwip)
7+
include(${LWIP_DIR}/src/Filelists.cmake)
8+
add_dependencies(lwipcore xdk)
89
add_subdirectory(ip)
910

1011
add_definitions(

drivers/network/tcpip/include/lwip/arch/cc.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,6 @@ free(void *mem);
1515
void *
1616
realloc(void *mem, size_t size);
1717

18-
/* mem_trim() must trim the buffer without relocating it.
19-
* Since we can't do that, we just return the buffer passed in unchanged */
20-
#define mem_trim(_m_, _s_) (_m_)
21-
22-
/* Unsigned int types */
23-
typedef unsigned char u8_t;
24-
typedef unsigned short u16_t;
25-
typedef unsigned long u32_t;
26-
27-
/* Signed int types */
28-
typedef signed char s8_t;
29-
typedef signed short s16_t;
30-
typedef signed long s32_t;
31-
32-
/* Memory pointer */
33-
typedef ULONG_PTR mem_ptr_t;
34-
3518
/* Printf/DPRINT formatters */
3619
#define U16_F "hu"
3720
#define S16_F "hd"

drivers/network/tcpip/include/lwip/arch/sys_arch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ typedef struct _LWIP_MESSAGE_CONTAINER
2727

2828
#define sys_jiffies() sys_now()
2929

30+
/* There is no such thing as "from ISR" for us */
31+
#define sys_mbox_trypost_fromisr sys_mbox_trypost
32+
3033
/* NULL definitions */
3134
#define SYS_MBOX_NULL NULL
3235
#define SYS_SEM_NULL NULL

drivers/network/tcpip/include/lwip/lwipopts.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
/* Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores
1212
should be used instead */
1313
#define LWIP_COMPAT_MUTEX 1
14+
#define LWIP_COMPAT_MUTEX_ALLOWED 1
1415

1516
#define MEM_ALIGNMENT 4
1617

drivers/network/tcpip/include/tcpip.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ typedef struct {
151151

152152
#ifndef htons
153153
#define htons(x) WH2N(x)
154+
#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
154155
#endif
155156

156157
/* Global variable */

drivers/network/tcpip/ip/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ list(APPEND SOURCE
3232
add_library(ip OBJECT ${SOURCE} ${ip_asm})
3333

3434
target_link_libraries(ip lwipcore)
35+
add_importlibs(lwipcore ntoskrnl)
3536

3637
target_include_directories(ip BEFORE
3738
PRIVATE ${LWIP_INCLUDE_DIRS}

drivers/network/tcpip/ip/lwip_glue/lwip_glue.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#endif
1414

1515
typedef struct tcp_pcb* PTCP_PCB;
16-
typedef struct ip_addr ip4_addr_t;
1716

1817
typedef struct _QUEUE_ENTRY
1918
{

drivers/network/tcpip/ip/lwip_glue/tcp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void
3636
LibTCPDumpPcb(PVOID SocketContext)
3737
{
3838
struct tcp_pcb *pcb = (struct tcp_pcb*)SocketContext;
39-
unsigned int addr = ntohl(pcb->remote_ip.addr);
39+
unsigned int addr = lwip_ntohl(pcb->remote_ip.addr);
4040

4141
DbgPrint("\tState: %s\n", tcp_state_str[pcb->state]);
4242
DbgPrint("\tRemote: (%d.%d.%d.%d, %d)\n",
@@ -405,7 +405,7 @@ LibTCPBindCallback(void *arg)
405405

406406
msg->Output.Bind.Error = tcp_bind(pcb,
407407
msg->Input.Bind.IpAddress,
408-
ntohs(msg->Input.Bind.Port));
408+
lwip_ntohs(msg->Input.Bind.Port));
409409

410410
done:
411411
KeSetEvent(&msg->Event, IO_NO_INCREMENT, FALSE);
@@ -609,7 +609,7 @@ LibTCPConnectCallback(void *arg)
609609
tcp_sent((PTCP_PCB)msg->Input.Connect.Connection->SocketContext, InternalSendEventHandler);
610610

611611
Error = tcp_connect((PTCP_PCB)msg->Input.Connect.Connection->SocketContext,
612-
msg->Input.Connect.IpAddress, ntohs(msg->Input.Connect.Port),
612+
msg->Input.Connect.IpAddress, lwip_ntohs(msg->Input.Connect.Port),
613613
InternalConnectEventHandler);
614614

615615
msg->Output.Connect.Error = Error == ERR_OK ? ERR_INPROGRESS : Error;

drivers/network/tcpip/ip/transport/tcp/if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <ipifcons.h>
1010

1111
err_t
12-
TCPSendDataCallback(struct netif *netif, struct pbuf *p, ip4_addr_t *dest)
12+
TCPSendDataCallback(struct netif *netif, struct pbuf *p, const ip4_addr_t *dest)
1313
{
1414
NDIS_STATUS NdisStatus;
1515
PNEIGHBOR_CACHE_ENTRY NCE;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# These files are text and should be normalized
2+
*.txt text
3+
*.c text
4+
*.h text
5+
6+
# For git archive
7+
.gitignore export-ignore
8+
.gitattributes export-ignore
9+
.github export-ignore
10+
.vscode export-ignore

0 commit comments

Comments
 (0)