update IDF libraries and includes

This commit is contained in:
me-no-dev
2016-10-28 01:53:02 +03:00
parent 261bc5ae85
commit 3c071e1d89
74 changed files with 1952 additions and 349 deletions

View File

@ -185,10 +185,6 @@ struct netconn {
/** sem that is used to synchronously execute functions in the core context */
sys_sem_t op_completed;
#ifdef LWIP_ESP8266
sys_sem_t snd_op_completed; //only for snd semphore
#endif
#endif
/** mbox where received packets are stored until they are fetched

View File

@ -249,7 +249,7 @@ void dhcp_fine_tmr(void);
#define DHCP_OPTION_NTP 42
#define DHCP_OPTION_END 255
#ifdef LWIP_ESP8266
#if ESP_LWIP
/**add options for support more router by liuHan**/
#define DHCP_OPTION_DOMAIN_NAME 15
#define DHCP_OPTION_PRD 31

View File

@ -36,7 +36,7 @@
#include "lwip/opt.h"
#ifdef LWIP_ESP8266
#if ESP_DNS
#include "lwip/err.h"
#endif

View File

@ -60,7 +60,7 @@ typedef s8_t err_t;
#define ERR_USE -8 /* Address in use. */
#ifdef LWIP_ESP8266
#if ESP_LWIP
#define ERR_ALREADY -9 /* Already connected. */
#define ERR_ISCONN -10 /* Conn already established.*/
#define ERR_IS_FATAL(e) ((e) < ERR_ISCONN)

View File

@ -51,8 +51,6 @@ typedef size_t mem_size_t;
* allow these defines to be overridden.
*/
#ifndef MEMLEAK_DEBUG
#ifndef mem_free
#define mem_free free
#endif
@ -63,41 +61,6 @@ typedef size_t mem_size_t;
#define mem_calloc calloc
#endif
/* DYC_NEED_TO_DO_LATER
#ifndef mem_realloc
#define mem_realloc
#endif
#ifndef mem_zalloc
#define mem_zalloc
#endif
*/
#else
/*
#ifndef mem_free
#define mem_free(s) \
do{\
const char *file = mem_debug_file;\
vPortFree(s, file, __LINE__);\
}while(0)
#endif
#ifndef mem_malloc
#define mem_malloc(s) ({const char *file = mem_debug_file; pvPortMalloc(s, file, __LINE__);})
#endif
#ifndef mem_calloc
#define mem_calloc(s) ({const char *file = mem_debug_file; pvPortCalloc(s, file, __LINE__);})
#endif
#ifndef mem_realloc
#define mem_realloc(p, s) ({const char *file = mem_debug_file; pvPortRealloc(p, s, file, __LINE__);})
#endif
#ifndef mem_zalloc
#define mem_zalloc(s) ({const char *file = mem_debug_file; pvPortZalloc(s, file, __LINE__);})
#endif
*/
#endif
/* Since there is no C library allocation function to shrink memory without
moving it, define this to nothing. */
#ifndef mem_trim

View File

@ -177,7 +177,7 @@ typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif,
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */
#ifdef LWIP_ESP8266
#if ESP_DHCP
/*add DHCP event processing by LiuHan*/
typedef void (*dhcp_event_fn)(void);
#endif
@ -190,7 +190,7 @@ struct netif {
/** pointer to next in linked list */
struct netif *next;
#ifdef LWIP_ESP8266
#if ESP_LWIP
//ip_addr_t is changed by marco IPV4, IPV6
ip_addr_t link_local_addr;
#endif
@ -248,7 +248,7 @@ struct netif {
/** the DHCP client state information for this netif */
struct dhcp *dhcp;
#ifdef LWIP_ESP8266
#if ESP_LWIP
struct udp_pcb *dhcps_pcb;
dhcp_event_fn dhcp_event;
#endif

View File

@ -986,7 +986,7 @@
* (2 * TCP_MSS) for things to work well
*/
#ifndef TCP_WND
#define TCP_WND (4 * TCP_MSS)
#define TCP_WND(pcb) (4 * TCP_MSS)
#endif
/**
@ -1040,7 +1040,7 @@
* To achieve good performance, this should be at least 2 * TCP_MSS.
*/
#ifndef TCP_SND_BUF
#define TCP_SND_BUF (2 * TCP_MSS)
#define TCP_SND_BUF(pcb) (2 * TCP_MSS)
#endif
/**
@ -1048,7 +1048,7 @@
* as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
*/
#ifndef TCP_SND_QUEUELEN
#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
#define TCP_SND_QUEUELEN(pcb) ((4 * (TCP_SND_BUF((pcb))) + (TCP_MSS - 1))/(TCP_MSS))
#endif
/**
@ -1057,7 +1057,7 @@
* TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).
*/
#ifndef TCP_SNDLOWAT
#define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1)
#define TCP_SNDLOWAT(pcb) LWIP_MIN(LWIP_MAX(((TCP_SND_BUF((pcb)))/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF((pcb))) - 1)
#endif
/**
@ -1066,7 +1066,7 @@
* this number, select returns writable (combined with TCP_SNDLOWAT).
*/
#ifndef TCP_SNDQUEUELOWAT
#define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5)
#define TCP_SNDQUEUELOWAT(pcb) LWIP_MAX(((TCP_SND_QUEUELEN((pcb)))/2), 5)
#endif
/**
@ -1134,7 +1134,7 @@
* explicit window update
*/
#ifndef TCP_WND_UPDATE_THRESHOLD
#define TCP_WND_UPDATE_THRESHOLD LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4))
#define TCP_WND_UPDATE_THRESHOLD(pcb) LWIP_MIN((TCP_WND((pcb)) / 4), (TCP_MSS * 4))
#endif
/**
@ -3008,8 +3008,8 @@
#define LWIP_PERF 0
#endif
#ifndef THREAD_SAFE_DEBUG
#define THREAD_SAFE_DEBUG 0
#ifndef ESP_THREAD_SAFE_DEBUG
#define ESP_THREAD_SAFE_DEBUG 0
#endif
#endif /* LWIP_HDR_OPT_H */

View File

@ -137,7 +137,7 @@ struct pbuf {
*/
u16_t ref;
#ifdef LWIP_ESP8266
#if ESP_LWIP
void *eb;
#endif
};

View File

@ -187,7 +187,7 @@ struct dns_api_msg {
#endif /* LWIP_DNS */
#if LWIP_NETCONN_SEM_PER_THREAD
#ifdef LWIP_ESP8266
#if ESP_THREAD_SAFE
#define LWIP_NETCONN_THREAD_SEM_GET() sys_thread_sem_get()
#define LWIP_NETCONN_THREAD_SEM_ALLOC() sys_thread_sem_init()
#define LWIP_NETCONN_THREAD_SEM_FREE() sys_thread_sem_deinit()
@ -222,10 +222,6 @@ struct dns_api_msg {
#define TCPIP_APIMSG(m,f,e) do { (m)->function = f; (e) = tcpip_apimsg(m); } while(0)
#define TCPIP_APIMSG_ACK(m) do { NETCONN_SET_SAFE_ERR((m)->conn, (m)->err); sys_sem_signal(LWIP_API_MSG_SEM(m)); } while(0)
#ifdef LWIP_ESP8266
#define TCPIP_APIMSG_ACK_SND(m) do { NETCONN_SET_SAFE_ERR((m)->conn, (m)->err); sys_sem_signal(LWIP_API_MSG_SND_SEM(m)); } while(0)
#endif
#endif /* LWIP_TCPIP_CORE_LOCKING */
void lwip_netconn_do_newconn (void *m);

View File

@ -92,7 +92,7 @@ err_t tcp_process_refused_data(struct tcp_pcb *pcb);
((tpcb)->flags & (TF_NODELAY | TF_INFR)) || \
(((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \
((tpcb)->unsent->len >= (tpcb)->mss))) || \
((tcp_sndbuf(tpcb) == 0) || (tcp_sndqueuelen(tpcb) >= TCP_SND_QUEUELEN)) \
((tcp_sndbuf(tpcb) == 0) || (tcp_sndqueuelen(tpcb) >= TCP_SND_QUEUELEN(tpcb))) \
) ? 1 : 0)
#define tcp_output_nagle(tpcb) (tcp_do_output_nagle(tpcb) ? tcp_output(tpcb) : ERR_OK)

View File

@ -190,7 +190,6 @@ struct msghdr {
#define SO_CONTIMEO 0x1009 /* Unimplemented: connect timeout */
#define SO_NO_CHECK 0x100a /* don't create UDP checksum */
/*
* Structure used for manipulating linger option.
*/
@ -250,6 +249,11 @@ struct linger {
#define TCP_KEEPIDLE 0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */
#define TCP_KEEPINTVL 0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */
#define TCP_KEEPCNT 0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */
#if ESP_PER_SOC_TCP_WND
#define TCP_WINDOW 0x06 /* set pcb->per_soc_tcp_wnd */
#define TCP_SNDBUF 0x07 /* set pcb->per_soc_tcp_snd_buf */
#endif
#endif /* LWIP_TCP */
#if LWIP_IPV6
@ -505,7 +509,7 @@ int lwip_fcntl(int s, int cmd, int val);
#if LWIP_COMPAT_SOCKETS
#if LWIP_COMPAT_SOCKETS != 2
#if LWIP_THREAD_SAFE
#if ESP_THREAD_SAFE
int lwip_accept_r(int s, struct sockaddr *addr, socklen_t *addrlen);
int lwip_bind_r(int s, const struct sockaddr *name, socklen_t namelen);
@ -590,7 +594,7 @@ int lwip_fcntl_r(int s, int cmd, int val);
#define fcntl(s,cmd,val) lwip_fcntl(s,cmd,val)
#define ioctl(s,cmd,argp) lwip_ioctl(s,cmd,argp)
#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */
#endif /* LWIP_THREAD_SAFE */
#endif /* ESP_THREAD_SAFE */
#endif /* LWIP_COMPAT_SOCKETS != 2 */

View File

@ -129,14 +129,14 @@ typedef err_t (*tcp_connected_fn)(void *arg, struct tcp_pcb *tpcb, err_t err);
#define RCV_WND_SCALE(pcb, wnd) (((wnd) >> (pcb)->rcv_scale))
#define SND_WND_SCALE(pcb, wnd) (((wnd) << (pcb)->snd_scale))
#define TCPWND16(x) ((u16_t)LWIP_MIN((x), 0xFFFF))
#define TCP_WND_MAX(pcb) ((tcpwnd_size_t)(((pcb)->flags & TF_WND_SCALE) ? TCP_WND : TCPWND16(TCP_WND)))
#define TCP_WND_MAX(pcb) ((tcpwnd_size_t)(((pcb)->flags & TF_WND_SCALE) ? TCP_WND(pcb) : TCPWND16(TCP_WND(pcb))))
typedef u32_t tcpwnd_size_t;
typedef u16_t tcpflags_t;
#else
#define RCV_WND_SCALE(pcb, wnd) (wnd)
#define SND_WND_SCALE(pcb, wnd) (wnd)
#define TCPWND16(x) (x)
#define TCP_WND_MAX(pcb) TCP_WND
#define TCP_WND_MAX(pcb) TCP_WND(pcb)
typedef u16_t tcpwnd_size_t;
typedef u8_t tcpflags_t;
#endif
@ -236,6 +236,11 @@ struct tcp_pcb {
u8_t dupacks;
u32_t lastack; /* Highest acknowledged seqno. */
#if ESP_PER_SOC_TCP_WND
tcpwnd_size_t per_soc_tcp_wnd; /* per tcp socket tcp window size */
tcpwnd_size_t per_soc_tcp_snd_buf; /* per tcp socket tcp send buffer size */
#endif
/* congestion avoidance/control variables */
tcpwnd_size_t cwnd;
tcpwnd_size_t ssthresh;
@ -402,6 +407,10 @@ const char* tcp_debug_state_str(enum tcp_state s);
/* for compatibility with older implementation */
#define tcp_new_ip6() tcp_new_ip_type(IPADDR_TYPE_V6)
#if ESP_PER_SOC_TCP_WND
#define PER_SOC_WND(pcb) (pcb->per_soc_wnd)
#endif
#ifdef __cplusplus
}
#endif

View File

@ -37,7 +37,6 @@
#include "sdkconfig.h"
/* Enable all Espressif-only options */
#define LWIP_ESP8266
/*
-----------------------------------------------
@ -225,18 +224,21 @@ extern unsigned long os_random(void);
* TCP_WND: The size of a TCP window. This must be at least
* (2 * TCP_MSS) for things to work well
*/
#define PERF 1
#define ESP_PER_SOC_TCP_WND 1
#if ESP_PER_SOC_TCP_WND
#define TCP_WND_DEFAULT (4*TCP_MSS)
#define TCP_SND_BUF_DEFAULT (2*TCP_MSS)
#define TCP_WND(pcb) (pcb->per_soc_tcp_wnd)
#define TCP_SND_BUF(pcb) (pcb->per_soc_tcp_snd_buf)
#else
#ifdef PERF
extern unsigned char misc_prof_get_tcpw(void);
extern unsigned char misc_prof_get_tcp_snd_buf(void);
#define TCP_WND (misc_prof_get_tcpw()*TCP_MSS)
#define TCP_SND_BUF (misc_prof_get_tcp_snd_buf()*TCP_MSS)
#else
#define TCP_WND (4 * TCP_MSS)
#define TCP_SND_BUF (2 * TCP_MSS)
#define TCP_WND(pcb) (misc_prof_get_tcpw()*TCP_MSS)
#define TCP_SND_BUF(pcb) (misc_prof_get_tcp_snd_buf()*TCP_MSS)
#endif
#endif
@ -507,14 +509,42 @@ extern unsigned char misc_prof_get_tcp_snd_buf(void);
*/
#define TCPIP_DEBUG LWIP_DBG_OFF
/* Enable all Espressif-only options */
#define ESP_LWIP 1
#define ESP_PER_SOC_TCP_WND 1
#define ESP_THREAD_SAFE 1
#define ESP_THREAD_SAFE_DEBUG LWIP_DBG_OFF
#define ESP_DHCP 1
#define ESP_DNS 1
#define ESP_IPV6_AUTOCONFIG 1
#define ESP_PERF 0
#define ESP_RANDOM_TCP_PORT 1
#define ESP_IP4_ATON 1
#define ESP_LIGHT_SLEEP 1
#if ESP_PER_SOC_TCP_WND
#define TCP_WND_DEFAULT (4*TCP_MSS)
#define TCP_SND_BUF_DEFAULT (2*TCP_MSS)
#define TCP_WND(pcb) (pcb->per_soc_tcp_wnd)
#define TCP_SND_BUF(pcb) (pcb->per_soc_tcp_snd_buf)
#else
#if ESP_PERF
extern unsigned char misc_prof_get_tcpw(void);
extern unsigned char misc_prof_get_tcp_snd_buf(void);
#define TCP_WND(pcb) (misc_prof_get_tcpw()*TCP_MSS)
#define TCP_SND_BUF(pcb) (misc_prof_get_tcp_snd_buf()*TCP_MSS)
#endif
#endif
/**
* DHCP_DEBUG: Enable debugging in dhcp.c.
*/
#define DHCP_DEBUG LWIP_DBG_OFF
#define LWIP_DEBUG 0
#define TCP_DEBUG LWIP_DBG_OFF
#define THREAD_SAFE_DEBUG LWIP_DBG_OFF
#define LWIP_THREAD_SAFE 1
#define ESP_THREAD_SAFE_DEBUG LWIP_DBG_OFF
#define CHECKSUM_CHECK_UDP 0
#define CHECKSUM_CHECK_IP 0

View File

@ -8,6 +8,8 @@
#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "lwip/err.h"
#ifdef __cplusplus
@ -18,8 +20,6 @@ err_t wlanif_init(struct netif *netif);
void wlanif_input(struct netif *netif, void *buffer, u16_t len, void* eb);
bool ieee80211_output(wifi_interface_t wifi_if, void *buffer, u16_t len);
wifi_interface_t wifi_get_interface(void *dev);
void netif_reg_addr_change_cb(void* cb);

View File

@ -37,7 +37,6 @@
#include "sdkconfig.h"
/* Enable all Espressif-only options */
#define LWIP_ESP8266
/*
-----------------------------------------------
@ -225,18 +224,21 @@ extern unsigned long os_random(void);
* TCP_WND: The size of a TCP window. This must be at least
* (2 * TCP_MSS) for things to work well
*/
#define PERF 1
#define ESP_PER_SOC_TCP_WND 1
#if ESP_PER_SOC_TCP_WND
#define TCP_WND_DEFAULT (4*TCP_MSS)
#define TCP_SND_BUF_DEFAULT (2*TCP_MSS)
#define TCP_WND(pcb) (pcb->per_soc_tcp_wnd)
#define TCP_SND_BUF(pcb) (pcb->per_soc_tcp_snd_buf)
#else
#ifdef PERF
extern unsigned char misc_prof_get_tcpw(void);
extern unsigned char misc_prof_get_tcp_snd_buf(void);
#define TCP_WND (misc_prof_get_tcpw()*TCP_MSS)
#define TCP_SND_BUF (misc_prof_get_tcp_snd_buf()*TCP_MSS)
#else
#define TCP_WND (4 * TCP_MSS)
#define TCP_SND_BUF (2 * TCP_MSS)
#define TCP_WND(pcb) (misc_prof_get_tcpw()*TCP_MSS)
#define TCP_SND_BUF(pcb) (misc_prof_get_tcp_snd_buf()*TCP_MSS)
#endif
#endif
@ -507,14 +509,42 @@ extern unsigned char misc_prof_get_tcp_snd_buf(void);
*/
#define TCPIP_DEBUG LWIP_DBG_OFF
/* Enable all Espressif-only options */
#define ESP_LWIP 1
#define ESP_PER_SOC_TCP_WND 1
#define ESP_THREAD_SAFE 1
#define ESP_THREAD_SAFE_DEBUG LWIP_DBG_OFF
#define ESP_DHCP 1
#define ESP_DNS 1
#define ESP_IPV6_AUTOCONFIG 1
#define ESP_PERF 0
#define ESP_RANDOM_TCP_PORT 1
#define ESP_IP4_ATON 1
#define ESP_LIGHT_SLEEP 1
#if ESP_PER_SOC_TCP_WND
#define TCP_WND_DEFAULT (4*TCP_MSS)
#define TCP_SND_BUF_DEFAULT (2*TCP_MSS)
#define TCP_WND(pcb) (pcb->per_soc_tcp_wnd)
#define TCP_SND_BUF(pcb) (pcb->per_soc_tcp_snd_buf)
#else
#if ESP_PERF
extern unsigned char misc_prof_get_tcpw(void);
extern unsigned char misc_prof_get_tcp_snd_buf(void);
#define TCP_WND(pcb) (misc_prof_get_tcpw()*TCP_MSS)
#define TCP_SND_BUF(pcb) (misc_prof_get_tcp_snd_buf()*TCP_MSS)
#endif
#endif
/**
* DHCP_DEBUG: Enable debugging in dhcp.c.
*/
#define DHCP_DEBUG LWIP_DBG_OFF
#define LWIP_DEBUG 0
#define TCP_DEBUG LWIP_DBG_OFF
#define THREAD_SAFE_DEBUG LWIP_DBG_OFF
#define LWIP_THREAD_SAFE 1
#define ESP_THREAD_SAFE_DEBUG LWIP_DBG_OFF
#define CHECKSUM_CHECK_UDP 0
#define CHECKSUM_CHECK_IP 0

View File

@ -8,6 +8,8 @@
#include "esp_wifi.h"
#include "esp_wifi_internal.h"
#include "lwip/err.h"
#ifdef __cplusplus
@ -18,8 +20,6 @@ err_t wlanif_init(struct netif *netif);
void wlanif_input(struct netif *netif, void *buffer, u16_t len, void* eb);
bool ieee80211_output(wifi_interface_t wifi_if, void *buffer, u16_t len);
wifi_interface_t wifi_get_interface(void *dev);
void netif_reg_addr_change_cb(void* cb);