Add note to pbuf_type about correct TX/RX type selection

This commit is contained in:
Dirk Ziegelmeier 2016-08-24 08:09:03 +02:00
parent d9b0236525
commit 831b7fc7d3

View File

@ -102,9 +102,10 @@ typedef enum {
typedef enum { typedef enum {
/** pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload /** 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 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 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_RAM,
/** pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in /** 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 totally different memory areas. Since it points to ROM, payload does not
@ -117,7 +118,9 @@ typedef enum {
/** pbuf payload refers to RAM. This one comes from a pool and should be used /** 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 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 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_POOL
} pbuf_type; } pbuf_type;