Lines Matching refs:partial_packet
143 BT_HDR *partial_packet = (BT_HDR *)hash_map_get(partial_packets, (void *)(uintptr_t)handle); in reassemble_and_dispatch() local
146 if (partial_packet) { in reassemble_and_dispatch()
150 buffer_allocator->free(partial_packet); in reassemble_and_dispatch()
178 partial_packet = (BT_HDR *)buffer_allocator->alloc(full_length + sizeof(BT_HDR)); in reassemble_and_dispatch()
179 partial_packet->event = packet->event; in reassemble_and_dispatch()
180 partial_packet->len = full_length; in reassemble_and_dispatch()
181 partial_packet->offset = packet->len; in reassemble_and_dispatch()
183 memcpy(partial_packet->data, packet->data, packet->len); in reassemble_and_dispatch()
186 stream = partial_packet->data; in reassemble_and_dispatch()
190 hash_map_set(partial_packets, (void *)(uintptr_t)handle, partial_packet); in reassemble_and_dispatch()
194 if (!partial_packet) { in reassemble_and_dispatch()
201 uint16_t projected_offset = partial_packet->offset + (packet->len - HCI_ACL_PREAMBLE_SIZE); in reassemble_and_dispatch()
202 if (projected_offset > partial_packet->len) { // len stores the expected length in reassemble_and_dispatch()
203 … got packet which would exceed expected length of %d. Truncating.", __func__, partial_packet->len); in reassemble_and_dispatch()
204 packet->len = partial_packet->len - partial_packet->offset; in reassemble_and_dispatch()
205 projected_offset = partial_packet->len; in reassemble_and_dispatch()
209 partial_packet->data + partial_packet->offset, in reassemble_and_dispatch()
216 partial_packet->offset = projected_offset; in reassemble_and_dispatch()
218 if (partial_packet->offset == partial_packet->len) { in reassemble_and_dispatch()
220 partial_packet->offset = 0; in reassemble_and_dispatch()
221 callbacks->reassembled(partial_packet); in reassemble_and_dispatch()