mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-19 05:10:40 +00:00
Tried to improve pbuf_type, LWIP_SUPPORT_CUSTOM_PBUF and PBUF_FLAG_IS_CUSTOM documentation
This commit is contained in:
parent
e5e0a21fc6
commit
9352988c44
@ -40,8 +40,12 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Currently, the pbuf_custom code is only needed for one specific configuration
|
/** LWIP_SUPPORT_CUSTOM_PBUF==1: Custom pbufs behave much like their pbuf type
|
||||||
* of IP_FRAG */
|
* but they are allocated by external code (initialised by calling
|
||||||
|
* pbuf_alloced_custom()) and when pbuf_free gives up their last reference, they
|
||||||
|
* are freed by calling pbuf_custom->custom_free_function().
|
||||||
|
* 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
|
#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 && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))
|
||||||
#endif
|
#endif
|
||||||
@ -65,17 +69,32 @@ typedef enum {
|
|||||||
} pbuf_layer;
|
} pbuf_layer;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
PBUF_RAM, /* pbuf data is stored in RAM */
|
/** pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload
|
||||||
PBUF_ROM, /* pbuf data is stored in ROM */
|
are allocated in one piece of contiguous memory (so the first payload byte
|
||||||
PBUF_REF, /* pbuf comes from the pbuf pool */
|
can be calculated from struct pbuf)
|
||||||
PBUF_POOL /* pbuf payload refers to RAM */
|
pbuf_alloc() allocates PBUF_RAM pbufs as unchained pbufs (although that might
|
||||||
|
change in future versions) */
|
||||||
|
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
|
||||||
|
have to be copied when queued for transmission. */
|
||||||
|
PBUF_ROM,
|
||||||
|
/** pbuf comes from the pbuf pool. Much like PBUF_ROM but payload might change
|
||||||
|
so it has to be duplicated when queued before transmitting, depending on
|
||||||
|
who has a 'ref' to it. */
|
||||||
|
PBUF_REF,
|
||||||
|
/** 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) */
|
||||||
|
PBUF_POOL
|
||||||
} pbuf_type;
|
} pbuf_type;
|
||||||
|
|
||||||
|
|
||||||
/** indicates this packet's data should be immediately passed to the application */
|
/** indicates this packet's data should be immediately passed to the application */
|
||||||
#define PBUF_FLAG_PUSH 0x01U
|
#define PBUF_FLAG_PUSH 0x01U
|
||||||
/** indicates this is a custom pbuf: pbuf_free and pbuf_header handle such a
|
/** indicates this is a custom pbuf: pbuf_free calls pbuf_custom->custom_free_function()
|
||||||
a pbuf differently */
|
when the last reference is released (plus custom PBUF_RAM cannot be trimmed) */
|
||||||
#define PBUF_FLAG_IS_CUSTOM 0x02U
|
#define PBUF_FLAG_IS_CUSTOM 0x02U
|
||||||
/** indicates this pbuf is UDP multicast to be looped back */
|
/** indicates this pbuf is UDP multicast to be looped back */
|
||||||
#define PBUF_FLAG_MCASTLOOP 0x04U
|
#define PBUF_FLAG_MCASTLOOP 0x04U
|
||||||
|
Loading…
Reference in New Issue
Block a user