1、相关数据结构说明:
数据结构如下:
struct net_buf {
union {
int _unused;
struct net_buf *frags;
};
uint8_t ref;
uint8_t flags;
struct net_buf_pool *pool;
union {
struct {
uint8_t *data;
uint16_t len;
uint16_t size;
};
struct net_buf_simple b;
};
uint8_t __buf[0] __net_buf_align;
};
struct net_buf_pool {
struct k_lifo free; // LIFO to place the buffer into when free
const uint16_t buf_count;
uint16_t uninit_count;
const uint16_t buf_size;
const uint16_t user_data_size;
void (*const destroy)(struct net_buf *buf);
struct net_buf * const __bufs;
};