Lines Matching refs:tlv_container
144 struct ptp_tlv_container *tlv_container; in msg_tlv_post_recv() local
153 tlv_container = ptp_tlv_alloc(); in msg_tlv_post_recv()
154 if (!tlv_container) { in msg_tlv_post_recv()
158 tlv_container->tlv = (struct ptp_tlv *)suffix; in msg_tlv_post_recv()
159 tlv_container->tlv->type = ntohs(tlv_container->tlv->type); in msg_tlv_post_recv()
160 tlv_container->tlv->length = ntohs(tlv_container->tlv->length); in msg_tlv_post_recv()
162 if (tlv_container->tlv->length % 2) { in msg_tlv_post_recv()
165 ptp_tlv_free(tlv_container); in msg_tlv_post_recv()
173 if (tlv_container->tlv->length > length) { in msg_tlv_post_recv()
175 ptp_tlv_free(tlv_container); in msg_tlv_post_recv()
179 length -= tlv_container->tlv->length; in msg_tlv_post_recv()
180 suffix += tlv_container->tlv->length; in msg_tlv_post_recv()
181 suffix_len += tlv_container->tlv->length; in msg_tlv_post_recv()
183 ret = ptp_tlv_post_recv(tlv_container->tlv); in msg_tlv_post_recv()
185 ptp_tlv_free(tlv_container); in msg_tlv_post_recv()
189 sys_slist_append(&msg->tlvs, &tlv_container->node); in msg_tlv_post_recv()
197 struct ptp_tlv_container *tlv_container; in msg_tlv_free() local
202 tlv_container = CONTAINER_OF(iter, struct ptp_tlv_container, node); in msg_tlv_free()
203 ptp_tlv_free(tlv_container); in msg_tlv_free()
209 struct ptp_tlv_container *tlv_container; in msg_tlv_pre_send() local
211 SYS_SLIST_FOR_EACH_CONTAINER(&msg->tlvs, tlv_container, node) { in msg_tlv_pre_send()
212 ptp_tlv_pre_send(tlv_container->tlv); in msg_tlv_pre_send()
446 struct ptp_tlv_container *tlv_container; in ptp_msg_add_tlv() local
453 tlv_container = (struct ptp_tlv_container *)sys_slist_peek_tail(&msg->tlvs); in ptp_msg_add_tlv()
454 if (tlv_container) { in ptp_msg_add_tlv()
455 suffix = (uint8_t *)tlv_container->tlv; in ptp_msg_add_tlv()
456 suffix += sizeof(*tlv_container->tlv); in ptp_msg_add_tlv()
457 suffix += tlv_container->tlv->length; in ptp_msg_add_tlv()
465 tlv_container = ptp_tlv_alloc(); in ptp_msg_add_tlv()
466 if (tlv_container) { in ptp_msg_add_tlv()
467 tlv_container->tlv = (struct ptp_tlv *)suffix; in ptp_msg_add_tlv()
471 return tlv_container ? tlv_container->tlv : NULL; in ptp_msg_add_tlv()