forked from espressif/arduino-esp32
Update IDF libs
This commit is contained in:
@ -96,7 +96,11 @@ struct dhcp
|
||||
#endif /* LWIP_DHCP_BOOTPFILE */
|
||||
|
||||
/* Espressif add start. */
|
||||
#ifdef ESP_LWIP
|
||||
void (*cb)(struct netif*); /* callback for dhcp, add a parameter to show dhcp status if needed */
|
||||
#else
|
||||
void (*cb)(void); /* callback for dhcp, add a parameter to show dhcp status if needed */
|
||||
#endif
|
||||
/* Espressif add end. */
|
||||
};
|
||||
|
||||
@ -146,7 +150,11 @@ void dhcp_set_struct(struct netif *netif, struct dhcp *dhcp);
|
||||
void dhcp_cleanup(struct netif *netif);
|
||||
/* Espressif add start. */
|
||||
/** set callback for DHCP */
|
||||
#ifdef ESP_LWIP
|
||||
void dhcp_set_cb(struct netif *netif, void (*cb)(struct netif*));
|
||||
#else
|
||||
void dhcp_set_cb(struct netif *netif, void (*cb)(void));
|
||||
#endif
|
||||
/* Espressif add end. */
|
||||
/** start DHCP configuration */
|
||||
err_t dhcp_start(struct netif *netif);
|
||||
|
@ -20,5 +20,6 @@ void dbg_lwip_tcp_pcb_show(void);
|
||||
void dbg_lwip_udp_pcb_show(void);
|
||||
void dbg_lwip_tcp_rxtx_show(void);
|
||||
void dbg_lwip_udp_rxtx_show(void);
|
||||
void dbg_lwip_mem_cnt_show(void);
|
||||
|
||||
#endif
|
||||
|
@ -71,8 +71,25 @@ extern const struct memp_desc* const memp_pools[MEMP_MAX];
|
||||
#include "lwip/mem.h"
|
||||
|
||||
#define memp_init()
|
||||
#if ESP_CNT_DEBUG
|
||||
static inline void* memp_malloc(int type)
|
||||
{
|
||||
ESP_CNT_MEM_MALLOC_INC(type);
|
||||
return mem_malloc(memp_pools[type]->size);
|
||||
}
|
||||
|
||||
static inline void memp_free(int type, void *mem)
|
||||
{
|
||||
ESP_CNT_MEM_FREE_INC(type);
|
||||
mem_free(mem);
|
||||
}
|
||||
|
||||
//#define memp_malloc(type) mem_malloc(memp_pools[type]->size); ESP_CNT_MEM_MALLOC_INC(type)
|
||||
//#define memp_free(type, mem) mem_free(mem); ESP_CNT_MEM_FREE_INC(type)
|
||||
#else
|
||||
#define memp_malloc(type) mem_malloc(memp_pools[type]->size)
|
||||
#define memp_free(type, mem) mem_free(mem)
|
||||
#endif
|
||||
|
||||
#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \
|
||||
const struct memp_desc memp_ ## name = { \
|
||||
|
@ -140,6 +140,16 @@ struct memp_desc {
|
||||
#endif /* MEMP_MEM_MALLOC */
|
||||
};
|
||||
|
||||
#if (ESP_CNT_DEBUG == 1)
|
||||
extern uint32_t g_lwip_mem_cnt[MEMP_MAX][2];
|
||||
#define ESP_CNT_MEM_MALLOC_INC(type) g_lwip_mem_cnt[type][0]++
|
||||
#define ESP_CNT_MEM_FREE_INC(type) g_lwip_mem_cnt[type][1]++
|
||||
#else
|
||||
#define ESP_CNT_MEM_MALLOC_INC(type)
|
||||
#define ESP_CNT_MEM_FREE_INC(type)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef LWIP_DEBUG
|
||||
#define DECLARE_LWIP_MEMPOOL_DESC(desc) (desc),
|
||||
#else
|
||||
|
@ -213,6 +213,23 @@ struct stats_mib2_netif_ctrs {
|
||||
u32_t ifouterrors;
|
||||
};
|
||||
|
||||
struct stats_esp {
|
||||
/* mbox post fail stats */
|
||||
u32_t rx_rawmbox_post_fail;
|
||||
u32_t rx_udpmbox_post_fail;
|
||||
u32_t rx_tcpmbox_post_fail;
|
||||
u32_t err_tcp_rxmbox_post_fail;
|
||||
u32_t err_tcp_acceptmbox_post_fail;
|
||||
u32_t acceptmbox_post_fail;
|
||||
u32_t free_mbox_post_fail;
|
||||
u32_t tcpip_inpkt_post_fail;
|
||||
u32_t tcpip_cb_post_fail;
|
||||
|
||||
/* memory malloc/free/failed stats */
|
||||
u32_t wlanif_input_pbuf_fail;
|
||||
u32_t wlanif_outut_pbuf_fail;
|
||||
};
|
||||
|
||||
struct stats_ {
|
||||
#if LINK_STATS
|
||||
struct stats_proto link;
|
||||
@ -265,6 +282,9 @@ struct stats_ {
|
||||
#if MIB2_STATS
|
||||
struct stats_mib2 mib2;
|
||||
#endif
|
||||
#if ESP_STATS
|
||||
struct stats_esp esp;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern struct stats_ lwip_stats;
|
||||
@ -438,6 +458,14 @@ void stats_init(void);
|
||||
#define MIB2_STATS_INC(x)
|
||||
#endif
|
||||
|
||||
#if ESP_STATS
|
||||
#define ESP_STATS_INC(x) STATS_INC(x)
|
||||
#define ESP_STATS_DISPLAY() stats_display_esp(&lwip_stats.esp);
|
||||
#else
|
||||
#define ESP_STATS_INC(x)
|
||||
#define ESP_STATS_DISPLAY()
|
||||
#endif
|
||||
|
||||
/* Display of statistics */
|
||||
#if LWIP_STATS_DISPLAY
|
||||
void stats_display(void);
|
||||
@ -446,6 +474,7 @@ void stats_display_igmp(struct stats_igmp *igmp, const char *name);
|
||||
void stats_display_mem(struct stats_mem *mem, const char *name);
|
||||
void stats_display_memp(struct stats_mem *mem, int index);
|
||||
void stats_display_sys(struct stats_sys *sys);
|
||||
void stats_display_esp(struct stats_esp *esp);
|
||||
#else /* LWIP_STATS_DISPLAY */
|
||||
#define stats_display()
|
||||
#define stats_display_proto(proto, name)
|
||||
@ -453,6 +482,7 @@ void stats_display_sys(struct stats_sys *sys);
|
||||
#define stats_display_mem(mem, name)
|
||||
#define stats_display_memp(mem, index)
|
||||
#define stats_display_sys(sys)
|
||||
#define stats_display_esp(esp)
|
||||
#endif /* LWIP_STATS_DISPLAY */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user