Skip to content

Commit

Permalink
runtime: upgrade lwip to release 2.0.0.
Browse files Browse the repository at this point in the history
whitequark committed Dec 5, 2016
1 parent b5a6848 commit 4c94873
Showing 6 changed files with 14 additions and 55 deletions.
10 changes: 5 additions & 5 deletions artiq/runtime/liblwip/Makefile
Original file line number Diff line number Diff line change
@@ -21,17 +21,17 @@ COREFILES=core/mem.c \
core/tcp_out.c \
core/udp.c \
core/inet_chksum.c \
core/timers.c \
core/timeouts.c \
core/init.c

CORE4FILES=core/ipv4/icmp.c \
CORE4FILES=core/ipv4/etharp.c \
core/ipv4/icmp.c \
core/ipv4/ip4.c \
core/ipv4/ip4_addr.c \
core/ipv4/ip_frag.c
core/ipv4/ip4_frag.c

# NETIFFILES: Files implementing various generic network interface functions.
NETIFFILES=netif/etharp.c \
netif/ethernet.c
NETIFFILES=netif/ethernet.c

PPPFILES=netif/ppp/auth.c \
netif/ppp/fsm.c \
25 changes: 0 additions & 25 deletions artiq/runtime/liblwip/arch/cc.h
Original file line number Diff line number Diff line change
@@ -6,33 +6,8 @@
#define __ARCH_CC_H__

/* Include some files for defining library routines */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#define BYTE_ORDER BIG_ENDIAN

/* Define generic types */
typedef unsigned char u8_t;
typedef signed char s8_t;
typedef unsigned short u16_t;
typedef signed short s16_t;
typedef unsigned long u32_t;
typedef signed long s32_t;

typedef u32_t mem_ptr_t;

/* Define (sn)printf formatters for these types */
#define U8_F "c"
#define S8_F "c"
#define X8_F "x"
#define U16_F "u"
#define S16_F "d"
#define X16_F "x"
#define U32_F "u"
#define S32_F "d"
#define X32_F "x"

/* Compiler hints for packing structures */
#define PACK_STRUCT_FIELD(x) x
#define PACK_STRUCT_STRUCT __attribute__((packed))
20 changes: 0 additions & 20 deletions artiq/runtime/liblwip/arch/sys_arch.h

This file was deleted.

2 changes: 2 additions & 0 deletions artiq/runtime/liblwip/lwipopts.h
Original file line number Diff line number Diff line change
@@ -40,6 +40,8 @@

#define LWIP_CALLBACK_API 1

#define SYS_LIGHTWEIGHT_PROT 0

/* -------- TCP Timer Intervals ------- */
#define TCP_TMR_INTERVAL 1 /* The TCP timer interval in
milliseconds. */
2 changes: 1 addition & 1 deletion artiq/runtime/lwip
Submodule lwip updated 378 files
10 changes: 6 additions & 4 deletions artiq/runtime/main.c
Original file line number Diff line number Diff line change
@@ -9,13 +9,10 @@
#include <hw/flags.h>

#include <lwip/init.h>
#include <lwip/memp.h>
#include <lwip/ip4_addr.h>
#include <lwip/ip4.h>
#include <lwip/netif.h>
#include <lwip/sys.h>
#include <lwip/timeouts.h>
#include <lwip/tcp.h>
#include <lwip/timers.h>
#ifdef CSR_ETHMAC_BASE
#include <netif/etharp.h>
#include <liteethif.h>
@@ -32,6 +29,7 @@ static struct netif netif;
static ppp_pcb *ppp;
#endif

void lwip_service(void);

This comment has been minimized.

Copy link
@sbourdeauducq

sbourdeauducq Dec 5, 2016

Member

What is that for?

This comment has been minimized.

Copy link
@whitequark

whitequark Dec 5, 2016

Author Contributor

You have -Wmissing-prototypes enabled somewhere, I'm not sure for what reason. The warnings are useful when upgrading lwip because they remove APIs aggressively, and this missing prototype warning reduces SNR.

This comment has been minimized.

Copy link
@sbourdeauducq

sbourdeauducq Dec 5, 2016

Member

Then shouldn't we have those functions static, or their prototypes moved to a header file?

This comment has been minimized.

Copy link
@whitequark

whitequark Dec 5, 2016

Author Contributor

These functions are only used from Rust. It doesn't make any real sense to declare them in a header file, except to make changing their prototype more noisy.

This comment has been minimized.

Copy link
@sbourdeauducq

sbourdeauducq Dec 5, 2016

Member

OK so this is a Rust problem. In this case we should just drop -Wmissing-prototypes.

void lwip_service(void)
{
sys_check_timeouts();
@@ -107,6 +105,7 @@ static void fsip_or_default(struct ip4_addr *d, char *key, int i1, int i2, int i
#endif
}

void network_init(void);
void network_init(void)
{
struct ip4_addr local_ip;
@@ -169,14 +168,17 @@ extern void _fheap, _eheap;

extern void rust_main();

u16_t tcp_sndbuf_(struct tcp_pcb *pcb);
u16_t tcp_sndbuf_(struct tcp_pcb *pcb) {
return tcp_sndbuf(pcb);
}

u8_t* tcp_so_options_(struct tcp_pcb *pcb);
u8_t* tcp_so_options_(struct tcp_pcb *pcb) {
return &pcb->so_options;
}

void tcp_nagle_disable_(struct tcp_pcb *pcb);
void tcp_nagle_disable_(struct tcp_pcb *pcb) {
tcp_nagle_disable(pcb);
}

0 comments on commit 4c94873

Please sign in to comment.