lwip: Refactor support for L2 pbuf free notification into each driver

Makes it easier to handle different drivers enabled at compile/link time.
This commit is contained in:
Angus Gratton
2017-02-24 14:45:17 +11:00
parent 36b3963efb
commit eb1fbaabce
5 changed files with 32 additions and 32 deletions

View File

@@ -330,6 +330,10 @@ struct netif {
u16_t loop_cnt_current;
#endif /* LWIP_LOOPBACK_MAX_PBUFS */
#endif /* ENABLE_LOOPBACK */
#if ESP_LWIP
void (*l2_buffer_free_notify)(void *user_buf); /* Allows LWIP to notify driver when a L2-supplied pbuf can be freed */
#endif
};
#if LWIP_CHECKSUM_CTRL_PER_NETIF

View File

@@ -105,12 +105,6 @@ typedef enum {
/** indicates this pbuf includes a TCP FIN flag */
#define PBUF_FLAG_TCP_FIN 0x20U
#if ESP_LWIP
#define PBUF_USER_FLAG_OWNER_NULL 0
#define PBUF_USER_FLAG_OWNER_WIFI 1
#define PBUF_USER_FLAG_OWNER_ETH 2
#endif
struct pbuf {
/** next pbuf in singly linked pbuf chain */
struct pbuf *next;
@@ -142,10 +136,10 @@ struct pbuf {
* the stack itself, or pbuf->next pointers from a chain.
*/
u16_t ref;
#if ESP_LWIP
void *user_buf;
u8_t user_flag;
struct netif *l2_owner;
void *l2_buf;
#endif
};