Lines Matching refs:packet
60 static void fragment_and_dispatch(BT_HDR* packet) { in fragment_and_dispatch() argument
61 CHECK(packet != NULL); in fragment_and_dispatch()
63 uint16_t event = packet->event & MSG_EVT_MASK; in fragment_and_dispatch()
64 uint8_t* stream = packet->data + packet->offset; in fragment_and_dispatch()
68 callbacks->fragmented(packet, true); in fragment_and_dispatch()
73 SUB_EVENT(packet->event) == LOCAL_BR_EDR_CONTROLLER_ID in fragment_and_dispatch()
78 uint16_t remaining_length = packet->len; in fragment_and_dispatch()
86 stream = packet->data + packet->offset; in fragment_and_dispatch()
90 packet->len = max_packet_size; in fragment_and_dispatch()
91 callbacks->fragmented(packet, false); in fragment_and_dispatch()
93 packet->offset += max_data_size; in fragment_and_dispatch()
95 packet->len = remaining_length; in fragment_and_dispatch()
98 stream = packet->data + packet->offset; in fragment_and_dispatch()
104 if (packet->layer_specific) { in fragment_and_dispatch()
105 packet->layer_specific--; in fragment_and_dispatch()
107 if (packet->layer_specific == 0) { in fragment_and_dispatch()
108 packet->event = MSG_HC_TO_STACK_L2C_SEG_XMIT; in fragment_and_dispatch()
109 callbacks->transmit_finished(packet, false); in fragment_and_dispatch()
115 callbacks->fragmented(packet, true); in fragment_and_dispatch()
122 static void reassemble_and_dispatch(UNUSED_ATTR BT_HDR* packet) { in reassemble_and_dispatch() argument
123 if ((packet->event & MSG_EVT_MASK) == MSG_HC_TO_STACK_HCI_ACL) { in reassemble_and_dispatch()
124 uint8_t* stream = packet->data; in reassemble_and_dispatch()
131 CHECK(acl_length == packet->len - HCI_ACL_PREAMBLE_SIZE); in reassemble_and_dispatch()
139 buffer_allocator->free(packet); in reassemble_and_dispatch()
158 packet->len, L2CAP_HEADER_PDU_LEN_SIZE); in reassemble_and_dispatch()
159 buffer_allocator->free(packet); in reassemble_and_dispatch()
173 buffer_allocator->free(packet); in reassemble_and_dispatch()
177 if (full_length <= packet->len) { in reassemble_and_dispatch()
178 if (full_length < packet->len) in reassemble_and_dispatch()
180 __func__, l2cap_length, packet->len); in reassemble_and_dispatch()
182 callbacks->reassembled(packet); in reassemble_and_dispatch()
188 partial_packet->event = packet->event; in reassemble_and_dispatch()
190 partial_packet->offset = packet->len; in reassemble_and_dispatch()
192 memcpy(partial_packet->data, packet->data, packet->len); in reassemble_and_dispatch()
202 buffer_allocator->free(packet); in reassemble_and_dispatch()
208 buffer_allocator->free(packet); in reassemble_and_dispatch()
213 packet->offset = HCI_ACL_PREAMBLE_SIZE; in reassemble_and_dispatch()
215 partial_packet->offset + (packet->len - HCI_ACL_PREAMBLE_SIZE); in reassemble_and_dispatch()
222 packet->len = (partial_packet->len - partial_packet->offset) + packet->offset; in reassemble_and_dispatch()
227 packet->data + packet->offset, packet->len - packet->offset); in reassemble_and_dispatch()
230 buffer_allocator->free(packet); in reassemble_and_dispatch()
240 callbacks->reassembled(packet); in reassemble_and_dispatch()