forked from espressif/arduino-esp32
Update IDF to 3.2-3276a13 and esptool.py to 2.5.0 (#1878)
* TX Flow Control and Code cleanup * Use semaphore instead of delay TX functionality is done. * Use single buffer and empty queue on exit * Fix compile issues because of LwIP code relocation * Add temporary header to fix Azure not compiling * Fix AsyncUDP early init * AsyncUDP Multicast fixes * Add source mac address and rework multicast * Allow redefinition of default pins for Serials 1 and 2 * Update IDF to 3276a13 * Update esptool.py to 2.5.0 * Fix sketches * Fix log level in BluetoothSetial
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
/**
|
||||
* @file
|
||||
* pbuf API
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
@ -47,7 +52,7 @@ extern "C" {
|
||||
* Currently, the pbuf_custom code is only needed for one specific configuration
|
||||
* of IP_FRAG, unless required by external driver/application code. */
|
||||
#ifndef LWIP_SUPPORT_CUSTOM_PBUF
|
||||
#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))
|
||||
#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))
|
||||
#endif
|
||||
|
||||
/* @todo: We need a mechanism to prevent wasting memory in every pbuf
|
||||
@ -60,20 +65,46 @@ extern "C" {
|
||||
#define PBUF_IP_HLEN 20
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup pbuf
|
||||
* Enumeration of pbuf layers
|
||||
*/
|
||||
typedef enum {
|
||||
/** Includes spare room for transport layer header, e.g. UDP header.
|
||||
* Use this if you intend to pass the pbuf to functions like udp_send().
|
||||
*/
|
||||
PBUF_TRANSPORT,
|
||||
/** Includes spare room for IP header.
|
||||
* Use this if you intend to pass the pbuf to functions like raw_send().
|
||||
*/
|
||||
PBUF_IP,
|
||||
/** Includes spare room for link layer header (ethernet header).
|
||||
* Use this if you intend to pass the pbuf to functions like ethernet_output().
|
||||
* @see PBUF_LINK_HLEN
|
||||
*/
|
||||
PBUF_LINK,
|
||||
/** Includes spare room for additional encapsulation header before ethernet
|
||||
* headers (e.g. 802.11).
|
||||
* Use this if you intend to pass the pbuf to functions like netif->linkoutput().
|
||||
* @see PBUF_LINK_ENCAPSULATION_HLEN
|
||||
*/
|
||||
PBUF_RAW_TX,
|
||||
/** Use this for input packets in a netif driver when calling netif->input()
|
||||
* in the most common case - ethernet-layer netif driver. */
|
||||
PBUF_RAW
|
||||
} pbuf_layer;
|
||||
|
||||
/**
|
||||
* @ingroup pbuf
|
||||
* Enumeration of pbuf types
|
||||
*/
|
||||
typedef enum {
|
||||
/** pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload
|
||||
are allocated in one piece of contiguous memory (so the first payload byte
|
||||
can be calculated from struct pbuf)
|
||||
can be calculated from struct pbuf).
|
||||
pbuf_alloc() allocates PBUF_RAM pbufs as unchained pbufs (although that might
|
||||
change in future versions) */
|
||||
change in future versions).
|
||||
This should be used for all OUTGOING packets (TX).*/
|
||||
PBUF_RAM,
|
||||
/** pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in
|
||||
totally different memory areas. Since it points to ROM, payload does not
|
||||
@ -86,7 +117,9 @@ typedef enum {
|
||||
/** pbuf payload refers to RAM. This one comes from a pool and should be used
|
||||
for RX. Payload can be chained (scatter-gather RX) but like PBUF_RAM, struct
|
||||
pbuf and its payload are allocated in one piece of contiguous memory (so
|
||||
the first payload byte can be calculated from struct pbuf) */
|
||||
the first payload byte can be calculated from struct pbuf).
|
||||
Don't use this for TX, if the pool becomes empty e.g. because of TCP queuing,
|
||||
you are unable to receive TCP acks! */
|
||||
PBUF_POOL
|
||||
} pbuf_type;
|
||||
|
||||
@ -105,6 +138,7 @@ typedef enum {
|
||||
/** indicates this pbuf includes a TCP FIN flag */
|
||||
#define PBUF_FLAG_TCP_FIN 0x20U
|
||||
|
||||
/** Main packet buffer struct */
|
||||
struct pbuf {
|
||||
/** next pbuf in singly linked pbuf chain */
|
||||
struct pbuf *next;
|
||||
@ -169,12 +203,11 @@ struct pbuf_custom {
|
||||
};
|
||||
#endif /* LWIP_SUPPORT_CUSTOM_PBUF */
|
||||
|
||||
#if LWIP_TCP && TCP_QUEUE_OOSEQ
|
||||
/** Define this to 0 to prevent freeing ooseq pbufs when the PBUF_POOL is empty */
|
||||
#ifndef PBUF_POOL_FREE_OOSEQ
|
||||
#define PBUF_POOL_FREE_OOSEQ 1
|
||||
#endif /* PBUF_POOL_FREE_OOSEQ */
|
||||
#if NO_SYS && PBUF_POOL_FREE_OOSEQ
|
||||
#if LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ
|
||||
extern volatile u8_t pbuf_free_ooseq_pending;
|
||||
void pbuf_free_ooseq(void);
|
||||
/** When not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ()
|
||||
@ -184,8 +217,10 @@ void pbuf_free_ooseq(void);
|
||||
/* pbuf_alloc() reported PBUF_POOL to be empty -> try to free some \
|
||||
ooseq queued pbufs now */ \
|
||||
pbuf_free_ooseq(); }}while(0)
|
||||
#endif /* NO_SYS && PBUF_POOL_FREE_OOSEQ*/
|
||||
#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ */
|
||||
#else /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ */
|
||||
/* Otherwise declare an empty PBUF_CHECK_FREE_OOSEQ */
|
||||
#define PBUF_CHECK_FREE_OOSEQ()
|
||||
#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && NO_SYS && PBUF_POOL_FREE_OOSEQ*/
|
||||
|
||||
/* Initializes the pbuf module. This call is empty for now, but may not be in future. */
|
||||
#define pbuf_init()
|
||||
@ -201,12 +236,12 @@ u8_t pbuf_header(struct pbuf *p, s16_t header_size);
|
||||
u8_t pbuf_header_force(struct pbuf *p, s16_t header_size);
|
||||
void pbuf_ref(struct pbuf *p);
|
||||
u8_t pbuf_free(struct pbuf *p);
|
||||
u8_t pbuf_clen(struct pbuf *p);
|
||||
u16_t pbuf_clen(const struct pbuf *p);
|
||||
void pbuf_cat(struct pbuf *head, struct pbuf *tail);
|
||||
void pbuf_chain(struct pbuf *head, struct pbuf *tail);
|
||||
struct pbuf *pbuf_dechain(struct pbuf *p);
|
||||
err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from);
|
||||
u16_t pbuf_copy_partial(struct pbuf *p, void *dataptr, u16_t len, u16_t offset);
|
||||
err_t pbuf_copy(struct pbuf *p_to, const struct pbuf *p_from);
|
||||
u16_t pbuf_copy_partial(const struct pbuf *p, void *dataptr, u16_t len, u16_t offset);
|
||||
err_t pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len);
|
||||
err_t pbuf_take_at(struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset);
|
||||
struct pbuf *pbuf_skip(struct pbuf* in, u16_t in_offset, u16_t* out_offset);
|
||||
@ -219,11 +254,12 @@ err_t pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr,
|
||||
void pbuf_split_64k(struct pbuf *p, struct pbuf **rest);
|
||||
#endif /* LWIP_TCP && TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
|
||||
|
||||
u8_t pbuf_get_at(struct pbuf* p, u16_t offset);
|
||||
u8_t pbuf_get_at(const struct pbuf* p, u16_t offset);
|
||||
int pbuf_try_get_at(const struct pbuf* p, u16_t offset);
|
||||
void pbuf_put_at(struct pbuf* p, u16_t offset, u8_t data);
|
||||
u16_t pbuf_memcmp(struct pbuf* p, u16_t offset, const void* s2, u16_t n);
|
||||
u16_t pbuf_memfind(struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset);
|
||||
u16_t pbuf_strstr(struct pbuf* p, const char* substr);
|
||||
u16_t pbuf_memcmp(const struct pbuf* p, u16_t offset, const void* s2, u16_t n);
|
||||
u16_t pbuf_memfind(const struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset);
|
||||
u16_t pbuf_strstr(const struct pbuf* p, const char* substr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user