Skip to content

Commit 15165ee

Browse files
committed
Upgrade to mainstream lwip 2.2.1
1 parent 9aa0db2 commit 15165ee

File tree

20 files changed

+165
-29
lines changed

20 files changed

+165
-29
lines changed

download_dependencies.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ if [ "x$1" != "xlocked" ]; then
1414
fi
1515

1616
## Download LWIP
17-
LWIP_REPO_URL="https://github.com/ps2dev/lwip.git"
17+
LWIP_REPO_URL="https://github.com/lwip-tcpip/lwip.git"
1818
LWIP_REPO_FOLDER="common/external_deps/lwip"
19-
LWIP_BRANCH_NAME="ps2-v2.0.3"
19+
LWIP_BRANCH_NAME="STABLE-2_2_1_RELEASE"
2020
if test ! -d "$LWIP_REPO_FOLDER"; then
2121
git clone --depth 1 -b $LWIP_BRANCH_NAME $LWIP_REPO_URL "$LWIP_REPO_FOLDER"_inprogress || exit 1
2222
mv "$LWIP_REPO_FOLDER"_inprogress "$LWIP_REPO_FOLDER"
2323
else
24-
(cd "$LWIP_REPO_FOLDER" && git fetch origin && git reset --hard "origin/${LWIP_BRANCH_NAME}" && git checkout "$LWIP_BRANCH_NAME" && cd - )|| exit 1
24+
(cd "$LWIP_REPO_FOLDER" && git fetch origin --tags && git reset --hard "${LWIP_BRANCH_NAME}" && git checkout "$LWIP_BRANCH_NAME" && cd - )|| exit 1
2525
fi
2626

2727
## Download libsmb2

ee/network/tcpip/Makefile

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,42 @@ endif
3535

3636
EE_INCS += -I$(LWIP)/src/include -I$(LWIP)/src/include/ipv4
3737

38-
ps2api_OBJECTS = api_lib.o api_msg.o api_netbuf.o err.o sockets.o tcpip.o
39-
ps2api_IPV4 = icmp.o ip.o ip4.o ip4_addr.o ip4_frag.o inet_chksum.o
40-
ps2ip_OBJECTS = sys.o lwip_init.o mem.o netif.o pbuf.o stats.o tcp_in.o tcp_out.o udp.o memp.o tcp.o ethernet.o etharp.o raw.o def.o timeouts.o $(ps2api_IPV4) $(ps2api_OBJECTS)
38+
ps2api_OBJECTS = \
39+
api_lib.o \
40+
api_msg.o \
41+
api_netbuf.o \
42+
err.o \
43+
sockets.o \
44+
tcpip.o
45+
46+
ps2api_IPV4 = \
47+
acd.o \
48+
icmp.o \
49+
ip.o \
50+
ip4.o \
51+
ip4_addr.o \
52+
ip4_frag.o \
53+
inet_chksum.o
54+
55+
ps2ip_OBJECTS = \
56+
sys.o \
57+
lwip_init.o \
58+
mem.o \
59+
netif.o \
60+
pbuf.o \
61+
stats.o \
62+
tcp_in.o \
63+
tcp_out.o \
64+
udp.o \
65+
memp.o \
66+
tcp.o \
67+
ethernet.o \
68+
etharp.o \
69+
raw.o \
70+
def.o \
71+
timeouts.o \
72+
$(ps2api_IPV4) \
73+
$(ps2api_OBJECTS)
4174

4275
ifdef PS2IP_DHCP
4376
ps2ip_OBJECTS += dhcp.o
@@ -82,6 +115,9 @@ $(EE_OBJS_DIR)api_msg.o: $(LWIP)/src/api/api_msg.c
82115
$(EE_OBJS_DIR)api_netbuf.o: $(LWIP)/src/api/netbuf.c
83116
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@
84117

118+
$(EE_OBJS_DIR)acd.o: $(LWIP)/src/core/ipv4/acd.c
119+
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@
120+
85121
$(EE_OBJS_DIR)icmp.o: $(LWIP)/src/core/ipv4/icmp.c
86122
$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@
87123

ee/network/tcpip/src/include/arch/cc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <errno.h>
55
#include <stdlib.h>
66
#include <stddef.h>
7+
#include <sys/select.h>
78

89
#define PACK_STRUCT_FIELD(x) x __attribute((packed))
910
#define PACK_STRUCT_STRUCT __attribute((packed))

ee/network/tcpip/src/include/lwipopts.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@
244244
*/
245245
#define LWIP_CHECKSUM_ON_COPY 1
246246

247+
/* Define LWIP_ERRNO_STDINCLUDE if you want to include <errno.h> here */
248+
#define LWIP_ERRNO_STDINCLUDE 1
247249
/*
248250
------------------------------------
249251
---------- Socket options ----------

ee/network/tcpip/src/ps2ip_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef IOP_PS2IP_INTERNAL_H
1212
#define IOP_PS2IP_INTERNAL_H
1313

14+
#include <sys/select.h>
1415
#include "lwip/sockets.h"
1516

1617
typedef struct

ee/network/tcpip/src/sys_arch.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ err_t sys_mbox_trypost(sys_mbox_t *mbox, void *sys_msg)
338338
return result;
339339
}
340340

341+
err_t sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg)
342+
{
343+
// On PS2 EE, ISR and task level are the same, so just call trypost
344+
return sys_mbox_trypost(mbox, msg);
345+
}
346+
341347
void sys_mbox_post(sys_mbox_t *mbox, void *sys_msg)
342348
{
343349
SendMbx(mbox, alloc_msg(), sys_msg);

iop/network/smap/src/imports.lst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ I_inet_addr
6363
I_tcpip_input
6464
I_netif_set_link_up
6565
I_netif_set_link_down
66-
I_tcpip_callback_with_block
66+
I_tcpip_callback
6767
ps2ip_IMPORTS_end
6868
#endif
6969

iop/system/sysclib/include/ctype.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ extern "C" {
6363
/** Blank (space) */
6464
#define _B 0x80
6565

66+
extern unsigned char look_ctype_table(char character);
67+
6668
#define isalpha(c) (look_ctype_table((unsigned int)(c)) & (_U|_L))
6769
#define isupper(c) (look_ctype_table((unsigned int)(c)) & (_U))
6870
#define islower(c) (look_ctype_table((unsigned int)(c)) & (_L))

iop/tcpip/tcpip-base/include/arch/cc.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef __CC_H__
22
#define __CC_H__
33

4-
#include <errno.h>
54
#include <stddef.h>
5+
#include <sys/time.h>
66

77
#define BYTE_ORDER LITTLE_ENDIAN
88

@@ -47,8 +47,6 @@ typedef u32_t mem_ptr_t;
4747
#define LWIP_PLATFORM_ASSERT(args)
4848
#endif
4949

50-
#define atoi(x) strtol(x, NULL, 10)
51-
5250
#define LWIP_NO_STDINT_H 1 //stdint.h does not exist.
5351
#define LWIP_NO_INTTYPES_H 1 //inttypes.h does not exist.
5452

iop/tcpip/tcpip-base/include/lwipopts.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@
236236
*/
237237
#define LWIP_CHECKSUM_ON_COPY 1
238238

239+
/* Use PS2SDK's errno.h instead of lwIP's own errno definitions */
240+
#define LWIP_ERRNO_STDINCLUDE 1
239241
/*
240242
------------------------------------
241243
---------- Socket options ----------

0 commit comments

Comments
 (0)