21#ifndef NET_GNRC_TX_SYNC_H
22#define NET_GNRC_TX_SYNC_H
#define assert(cond)
abort the program if assertion is false
void mutex_unlock(mutex_t *mutex)
Unlocks the mutex.
#define MUTEX_INIT_LOCKED
Static initializer for mutex_t with a locked mutex.
static void mutex_lock(mutex_t *mutex)
Locks a mutex, blocking.
#define ENOMEM
Not enough space.
@ GNRC_NETTYPE_TX_SYNC
TX synchronization data for passing up error data or auxiliary data.
static gnrc_pktsnip_t * gnrc_pkt_append(gnrc_pktsnip_t *pkt, gnrc_pktsnip_t *snip)
Appends a snip to a packet.
gnrc_pktsnip_t * gnrc_pktbuf_add(gnrc_pktsnip_t *next, const void *data, size_t size, gnrc_nettype_t type)
Adds a new gnrc_pktsnip_t and its packet to the packet buffer.
static gnrc_tx_sync_t gnrc_tx_sync_init(void)
Helper to initialize a gnrc_tx_sync_t structure.
gnrc_pktsnip_t * gnrc_tx_sync_split(gnrc_pktsnip_t *pkt)
Split off the TX sync snip and return it.
static void gnrc_tx_complete(gnrc_pktsnip_t *pkt)
Signal TX completion via the given tx sync packet snip.
static int gnrc_tx_sync_append(gnrc_pktsnip_t *pkt, gnrc_tx_sync_t *tx_sync)
Appends a newly allocated tx sync pktsnip to the end of the packet.
static gnrc_pktsnip_t * gnrc_tx_sync_build(gnrc_tx_sync_t *tx_sync)
Build a TX sync snip.
static void gnrc_tx_sync(gnrc_tx_sync_t *sync)
Block until transmission of the corresponding packet has completed or failed.
#define IS_USED(module)
Checks whether a module is being used or not.
Mutex for thread synchronization.
Interface definition for the global network buffer.
Type to represent parts (either headers or payload) of a packet, called snips.
void * data
pointer to the data of the snip
gnrc_nettype_t type
protocol of the packet snip
mutex_t signal
Mutex used for synchronization.