Lines Matching refs:tlv
73 container = CONTAINER_OF((void *)mgmt_tlv, struct ptp_tlv_container, tlv); in tlv_mgmt_post_recv()
185 container = CONTAINER_OF((void *)mgmt_tlv, struct ptp_tlv_container, tlv); in tlv_mgmt_post_recv()
273 container = CONTAINER_OF((void *)mgmt_tlv, struct ptp_tlv_container, tlv); in tlv_mgmt_pre_send()
355 enum ptp_tlv_type ptp_tlv_type(struct ptp_tlv *tlv) in ptp_tlv_type() argument
357 return (enum ptp_tlv_type)tlv->type; in ptp_tlv_type()
360 int ptp_tlv_post_recv(struct ptp_tlv *tlv) in ptp_tlv_post_recv() argument
366 switch (ptp_tlv_type(tlv)) { in ptp_tlv_post_recv()
368 if (tlv->length < (sizeof(struct ptp_tlv_mgmt) - sizeof(struct ptp_tlv))) { in ptp_tlv_post_recv()
371 mgmt = (struct ptp_tlv_mgmt *)tlv; in ptp_tlv_post_recv()
377 if (tlv->length > sizeof(mgmt->id)) { in ptp_tlv_post_recv()
378 ret = tlv_mgmt_post_recv(mgmt, tlv->length - 2); in ptp_tlv_post_recv()
382 if (tlv->length < (sizeof(struct ptp_tlv_mgmt_err) - sizeof(struct ptp_tlv))) { in ptp_tlv_post_recv()
385 mgmt_err = (struct ptp_tlv_mgmt_err *)tlv; in ptp_tlv_post_recv()
396 void ptp_tlv_pre_send(struct ptp_tlv *tlv) in ptp_tlv_pre_send() argument
401 switch (ptp_tlv_type(tlv)) { in ptp_tlv_pre_send()
403 mgmt = (struct ptp_tlv_mgmt *)tlv; in ptp_tlv_pre_send()
406 if (tlv->length > sizeof(mgmt->id)) { in ptp_tlv_pre_send()
412 mgmt_err = (struct ptp_tlv_mgmt_err *)tlv; in ptp_tlv_pre_send()
421 tlv->length = htons(tlv->length); in ptp_tlv_pre_send()
422 tlv->type = htons(tlv->type); in ptp_tlv_pre_send()