Lines Matching full:packet
20 * @brief Multi producer, single consumer packet buffer API
21 * @defgroup mpsc_buf MPSC (Multi producer, single consumer) packet buffer API
27 * Multi producer, single consumer packet buffer allows to allocate variable
28 * length consecutive space for storing a packet. When space is allocated
29 * it can be filled by the user (except for the first 2 bits) and when packet
30 * is ready it is committed. It is allowed to allocate another packet before
33 * If buffer is full and packet cannot be allocated then null is returned unless
37 * packet is dropped and claimed packet is marked as invalid when freeing.
39 * Reading packets is performed in two steps. First packet is claimed. Claiming
40 * returns pointer to the packet within the buffer. Packet is freed when no
44 /**@defgroup MPSC_PBUF_FLAGS MPSC packet buffer flags
72 /** @brief Callback prototype for getting length of a packet.
74 * @param packet User packet.
76 * @return Size of the packet in 32 bit words.
78 typedef uint32_t (*mpsc_pbuf_get_wlen)(const union mpsc_pbuf_generic *packet);
80 /** @brief Callback called when packet is dropped.
82 * @param buffer Packet buffer.
84 * @param packet Packet that is being dropped.
87 const union mpsc_pbuf_generic *packet);
89 /** @brief MPSC packet buffer structure. */
109 /** User callback called whenever packet is dropped.
115 /** Callback for getting packet length. */
130 /** @brief MPSC packet buffer configuration. */
146 /** @brief Initialize a packet buffer.
155 /** @brief Allocate a packet.
166 * timeout if packet cannot be allocated before dropping the oldest or
174 /** @brief Commit a packet.
178 * @param packet Pointer to a packet allocated by @ref mpsc_pbuf_alloc.
181 union mpsc_pbuf_generic *packet);
183 /** @brief Put single word packet into a buffer.
185 * Function is optimized for storing a packet which fit into a single word.
190 * @param word Packet content consisting of MPSC_PBUF_HDR with valid bit set
196 /** @brief Put a packet consisting of a word and a pointer.
198 * Function is optimized for storing packet consisting of a word and a pointer.
203 * @param word First word of a packet consisting of MPSC_PBUF_HDR with valid
212 /** @brief Put a packet into a buffer.
221 * @param wlen Packet size in words.
226 /** @brief Claim the first pending packet.
230 * @return Pointer to the claimed packet or null if none available.
234 /** @brief Free a packet.
238 * @param packet Packet.
241 const union mpsc_pbuf_generic *packet);