131#define OS_MBUF_F_MASK(__n) (1 << (__n))
138#define OS_MBUF_IS_PKTHDR(__om) \
139 ((__om)->om_pkthdr_len >= sizeof (struct os_mbuf_pkthdr))
142#define OS_MBUF_PKTHDR(__om) ((struct os_mbuf_pkthdr *) \
143 (void *)((uint8_t *)&(__om)->om_data + sizeof(struct os_mbuf)))
146#define OS_MBUF_PKTHDR_TO_MBUF(__hdr) \
147 (struct os_mbuf *)(void *)((uint8_t *)(__hdr) - sizeof(struct os_mbuf))
153#define OS_MBUF_PKTLEN(__om) (OS_MBUF_PKTHDR(__om)->omp_len)
161#define OS_MBUF_DATA(__om, __type) \
162 (__type) ((__om)->om_data)
169#define OS_MBUF_USRHDR(om) \
170 (void *)((uint8_t *)om + sizeof (struct os_mbuf) + \
171 sizeof (struct os_mbuf_pkthdr))
178#define OS_MBUF_USRHDR_LEN(om) \
179 ((om)->om_pkthdr_len - sizeof (struct os_mbuf_pkthdr))
187static inline uint16_t
188_os_mbuf_leadingspace(
struct os_mbuf *om)
191 uint16_t leadingspace;
194 if (OS_MBUF_IS_PKTHDR(om)) {
198 leadingspace = (uint16_t) (
OS_MBUF_DATA(om, uint8_t *) -
201 return (leadingspace);
216#define OS_MBUF_LEADINGSPACE(__om) _os_mbuf_leadingspace(__om)
222static inline uint16_t
223_os_mbuf_trailingspace(
struct os_mbuf *om)
244#define OS_MBUF_TRAILINGSPACE(__om) _os_mbuf_trailingspace(__om)
247#if SOC_ESP_NIMBLE_CONTROLLER && CONFIG_BT_CONTROLLER_ENABLED
265int r_os_mqueue_init(
struct os_mqueue *mq, ble_npl_event_fn *ev_cb,
void *arg);
266#define os_mqueue_init r_os_mqueue_init
277#define os_mqueue_get r_os_mqueue_get
288int r_os_mqueue_put(
struct os_mqueue *,
struct ble_npl_eventq *,
struct os_mbuf *);
289#define os_mqueue_put r_os_mqueue_put
309#define os_msys_register r_os_msys_register
321struct os_mbuf *r_os_msys_get(uint16_t dsize, uint16_t leadingspace);
322#define os_msys_get r_os_msys_get
326void r_os_msys_reset(
void);
327#define os_msys_reset r_os_msys_reset
339struct os_mbuf *r_os_msys_get_pkthdr(uint16_t dsize, uint16_t user_hdr_len);
340#define os_msys_get_pkthdr r_os_msys_get_pkthdr
346int r_os_msys_count(
void);
347#define os_msys_count r_os_msys_count
355int r_os_msys_num_free(
void);
356#define os_msys_num_free r_os_msys_num_free
371#define os_mbuf_pool_init r_os_mbuf_pool_init
383#define os_mbuf_get r_os_mbuf_get
394#define os_mbuf_get_pkthdr r_os_mbuf_get_pkthdr
404#define os_mbuf_dup r_os_mbuf_dup
420#define os_mbuf_off r_os_mbuf_off
434int r_os_mbuf_copydata(
const struct os_mbuf *m,
int off,
int len,
void *dst);
435#define os_mbuf_copydata r_os_mbuf_copydata
450uint16_t r_os_mbuf_len(
const struct os_mbuf *om);
451#define os_mbuf_len r_os_mbuf_len
463int r_os_mbuf_append(
struct os_mbuf *m,
const void *, uint16_t);
464#define os_mbuf_append r_os_mbuf_append
482int r_os_mbuf_appendfrom(
struct os_mbuf *dst,
const struct os_mbuf *src,
483 uint16_t src_off, uint16_t len);
484#define os_mbuf_appendfrom r_os_mbuf_appendfrom
493int r_os_mbuf_free(
struct os_mbuf *mb);
494#define os_mbuf_free r_os_mbuf_free
505int r_os_mbuf_free_chain(
struct os_mbuf *om);
506#define os_mbuf_free_chain r_os_mbuf_free_chain
518void r_os_mbuf_adj(
struct os_mbuf *mp,
int req_len);
519#define os_mbuf_adj r_os_mbuf_adj
537int r_os_mbuf_cmpf(
const struct os_mbuf *om,
int off,
const void *data,
int len);
538#define os_mbuf_cmpf r_os_mbuf_cmpf
560int r_os_mbuf_cmpm(
const struct os_mbuf *om1, uint16_t offset1,
561 const struct os_mbuf *om2, uint16_t offset2,
563#define os_mbuf_cmpm r_os_mbuf_cmpm
580#define os_mbuf_prepend r_os_mbuf_prepend
592struct os_mbuf *r_os_mbuf_prepend_pullup(
struct os_mbuf *om, uint16_t len);
593#define os_mbuf_prepend_pullup r_os_mbuf_prepend_pullup
608int r_os_mbuf_copyinto(
struct os_mbuf *om,
int off,
const void *src,
int len);
609#define os_mbuf_copyinto r_os_mbuf_copyinto
620void r_os_mbuf_concat(
struct os_mbuf *first,
struct os_mbuf *second);
621#define os_mbuf_concat r_os_mbuf_concat
638void *r_os_mbuf_extend(
struct os_mbuf *om, uint16_t len);
639#define os_mbuf_extend r_os_mbuf_extend
656struct os_mbuf *r_os_mbuf_pullup(
struct os_mbuf *om, uint16_t len);
657#define os_mbuf_pullup r_os_mbuf_pullup
668#define os_mbuf_trim_front r_os_mbuf_trim_front
682int r_os_mbuf_widen(
struct os_mbuf *om, uint16_t off, uint16_t len);
683#define os_mbuf_widen r_os_mbuf_widen
705#define os_mbuf_pack_chains r_os_mbuf_pack_chains
882int os_mbuf_copydata(
const struct os_mbuf *m,
int off,
int len,
void *dst);
925 uint16_t src_off, uint16_t len);
995 const struct os_mbuf *om2, uint16_t offset2,
struct os_mbuf * os_mbuf_trim_front(struct os_mbuf *om)
Definition os_mbuf.c:1044
struct os_mbuf * os_mqueue_get(struct os_mqueue *)
Definition os_mbuf.c:77
struct os_mbuf * os_mbuf_pack_chains(struct os_mbuf *m1, struct os_mbuf *m2)
Definition os_mbuf.c:1176
struct os_mbuf * os_mbuf_off(const struct os_mbuf *om, int off, uint16_t *out_off)
Definition os_mbuf.c:543
int os_mbuf_cmpm(const struct os_mbuf *om1, uint16_t offset1, const struct os_mbuf *om2, uint16_t offset2, uint16_t len)
Definition os_mbuf.c:723
int os_msys_register(struct os_mbuf_pool *)
Definition os_mbuf.c:129
struct os_mbuf * os_mbuf_get(struct os_mbuf_pool *omp, uint16_t)
Definition os_mbuf.c:251
int os_mbuf_pool_init(struct os_mbuf_pool *, struct os_mempool *mp, uint16_t, uint16_t)
Definition os_mbuf.c:241
struct os_mbuf * os_mbuf_dup(struct os_mbuf *m)
Definition os_mbuf.c:499
int os_mbuf_free(struct os_mbuf *mb)
Definition os_mbuf.c:314
void * os_mbuf_extend(struct os_mbuf *om, uint16_t len)
Definition os_mbuf.c:941
#define OS_MBUF_DATA(__om, __type)
Definition os_mbuf.h:161
int os_mqueue_init(struct os_mqueue *mq, ble_npl_event_fn *ev_cb, void *arg)
int os_mbuf_copyinto(struct os_mbuf *om, int off, const void *src, int len)
Definition os_mbuf.c:848
void os_mbuf_concat(struct os_mbuf *first, struct os_mbuf *second)
Definition os_mbuf.c:905
int os_mbuf_appendfrom(struct os_mbuf *dst, const struct os_mbuf *src, uint16_t src_off, uint16_t len)
Definition os_mbuf.c:470
int os_mbuf_free_chain(struct os_mbuf *om)
Definition os_mbuf.c:335
int os_mbuf_append(struct os_mbuf *m, const void *, uint16_t)
Definition os_mbuf.c:395
uint16_t os_mbuf_len(const struct os_mbuf *om)
Calculates the length of an mbuf chain.
Definition os_mbuf.c:379
struct os_mbuf * os_mbuf_prepend_pullup(struct os_mbuf *om, uint16_t len)
Definition os_mbuf.c:832
int os_msys_count(void)
Definition os_mbuf.c:212
struct os_mbuf * os_msys_get(uint16_t dsize, uint16_t leadingspace)
Definition os_mbuf.c:176
int os_mbuf_widen(struct os_mbuf *om, uint16_t off, uint16_t len)
Definition os_mbuf.c:1089
struct os_mbuf * os_mbuf_get_pkthdr(struct os_mbuf_pool *omp, uint8_t pkthdr_len)
Definition os_mbuf.c:281
void os_msys_reset(void)
Definition os_mbuf.c:150
int os_mqueue_put(struct os_mqueue *, struct ble_npl_eventq *, struct os_mbuf *)
Definition os_mbuf.c:100
int os_mbuf_cmpf(const struct os_mbuf *om, int off, const void *data, int len)
Definition os_mbuf.c:681
struct os_mbuf * os_mbuf_pullup(struct os_mbuf *om, uint16_t len)
Definition os_mbuf.c:979
void os_mbuf_adj(struct os_mbuf *mp, int req_len)
Definition os_mbuf.c:605
struct os_mbuf * os_msys_get_pkthdr(uint16_t dsize, uint16_t user_hdr_len)
Definition os_mbuf.c:193
int os_msys_num_free(void)
Definition os_mbuf.c:226
struct os_mbuf * os_mbuf_prepend(struct os_mbuf *om, int len)
Definition os_mbuf.c:779
uint16_t omp_len
Definition os_mbuf.h:74
uint16_t omp_flags
Definition os_mbuf.h:78
uint16_t omp_databuf_len
Definition os_mbuf.h:57
struct os_mempool * omp_pool
Definition os_mbuf.h:61
struct os_mbuf_pool * om_omp
Definition os_mbuf.h:107
uint8_t * om_data
Definition os_mbuf.h:90
uint8_t om_databuf[0]
Definition os_mbuf.h:114
uint8_t om_flags
Definition os_mbuf.h:94
uint16_t om_len
Definition os_mbuf.h:102
uint8_t om_pkthdr_len
Definition os_mbuf.h:98
Definition os_mempool.h:57
struct ble_npl_event mq_ev
Definition os_mbuf.h:123