Lines Matching refs:resp
220 struct ptp_msg *resp = ptp_msg_alloc(); in port_sync_timestamp_cb() local
222 if (!resp) { in port_sync_timestamp_cb()
226 resp->header.type_major_sdo_id = PTP_MSG_FOLLOW_UP; in port_sync_timestamp_cb()
227 resp->header.version = PTP_VERSION; in port_sync_timestamp_cb()
228 resp->header.msg_length = sizeof(struct ptp_follow_up_msg); in port_sync_timestamp_cb()
229 resp->header.domain_number = dds->domain; in port_sync_timestamp_cb()
230 resp->header.flags[1] = tpds->flags; in port_sync_timestamp_cb()
231 resp->header.src_port_id = port->port_ds.id; in port_sync_timestamp_cb()
232 resp->header.sequence_id = port->seq_id.sync++; in port_sync_timestamp_cb()
233 resp->header.log_msg_interval = port->port_ds.log_sync_interval; in port_sync_timestamp_cb()
235 resp->follow_up.precise_origin_timestamp.seconds_high = pkt->timestamp._sec.high; in port_sync_timestamp_cb()
236 resp->follow_up.precise_origin_timestamp.seconds_low = pkt->timestamp._sec.low; in port_sync_timestamp_cb()
237 resp->follow_up.precise_origin_timestamp.nanoseconds = pkt->timestamp.nanosecond; in port_sync_timestamp_cb()
241 port_msg_send(port, resp, PTP_SOCKET_GENERAL); in port_sync_timestamp_cb()
242 ptp_msg_unref(resp); in port_sync_timestamp_cb()
612 struct ptp_msg *resp; in port_delay_req_msg_process() local
620 resp = ptp_msg_alloc(); in port_delay_req_msg_process()
621 if (!resp) { in port_delay_req_msg_process()
625 resp->header.type_major_sdo_id = PTP_MSG_DELAY_RESP; in port_delay_req_msg_process()
626 resp->header.version = PTP_VERSION; in port_delay_req_msg_process()
627 resp->header.msg_length = sizeof(struct ptp_delay_resp_msg); in port_delay_req_msg_process()
628 resp->header.domain_number = dds->domain; in port_delay_req_msg_process()
629 resp->header.correction = msg->header.correction; in port_delay_req_msg_process()
630 resp->header.src_port_id = port->port_ds.id; in port_delay_req_msg_process()
631 resp->header.sequence_id = msg->header.sequence_id; in port_delay_req_msg_process()
632 resp->header.log_msg_interval = port->port_ds.log_min_delay_req_interval; in port_delay_req_msg_process()
634 resp->delay_resp.receive_timestamp.seconds_high = msg->timestamp.host._sec.high; in port_delay_req_msg_process()
635 resp->delay_resp.receive_timestamp.seconds_low = msg->timestamp.host._sec.low; in port_delay_req_msg_process()
636 resp->delay_resp.receive_timestamp.nanoseconds = msg->timestamp.host.nanosecond; in port_delay_req_msg_process()
637 resp->delay_resp.req_port_id = msg->header.src_port_id; in port_delay_req_msg_process()
641 resp->header.flags[0] |= PTP_MSG_UNICAST_FLAG; in port_delay_req_msg_process()
644 ret = port_msg_send(port, resp, PTP_SOCKET_EVENT); in port_delay_req_msg_process()
645 ptp_msg_unref(resp); in port_delay_req_msg_process()
696 struct ptp_msg *resp = ptp_msg_alloc(); in port_management_resp_prepare() local
699 if (!resp) { in port_management_resp_prepare()
703 resp->header.type_major_sdo_id = PTP_MSG_MANAGEMENT; in port_management_resp_prepare()
704 resp->header.version = PTP_VERSION; in port_management_resp_prepare()
705 resp->header.msg_length = sizeof(struct ptp_management_msg); in port_management_resp_prepare()
706 resp->header.domain_number = dds->domain; in port_management_resp_prepare()
707 resp->header.src_port_id = port->port_ds.id; in port_management_resp_prepare()
708 resp->header.sequence_id = req->header.sequence_id; in port_management_resp_prepare()
709 resp->header.log_msg_interval = port->port_ds.log_min_delay_req_interval; in port_management_resp_prepare()
713 resp->management.action = PTP_MGMT_RESP; in port_management_resp_prepare()
715 resp->management.action = PTP_MGMT_ACK; in port_management_resp_prepare()
718 memcpy(&resp->management.target_port_id, in port_management_resp_prepare()
722 resp->management.starting_boundary_hops = req->management.starting_boundary_hops - in port_management_resp_prepare()
724 resp->management.boundary_hops = resp->management.starting_boundary_hops; in port_management_resp_prepare()
726 return resp; in port_management_resp_prepare()
731 struct ptp_msg *resp, in port_management_resp_tlv_fill() argument
748 container->tlv = (struct ptp_tlv *)resp->management.suffix; in port_management_resp_tlv_fill()
844 resp->header.msg_length += sizeof(*container->tlv) + container->tlv->length; in port_management_resp_tlv_fill()
845 sys_slist_append(&resp->tlvs, &container->node); in port_management_resp_tlv_fill()
1475 struct ptp_msg *resp = port_management_resp_prepare(port, msg); in ptp_port_management_error() local
1477 if (!resp) { in ptp_port_management_error()
1481 tlv = ptp_msg_add_tlv(resp, sizeof(struct ptp_tlv_mgmt_err)); in ptp_port_management_error()
1483 ptp_msg_unref(resp); in ptp_port_management_error()
1494 ret = port_msg_send(port, resp, PTP_SOCKET_GENERAL); in ptp_port_management_error()
1495 ptp_msg_unref(resp); in ptp_port_management_error()
1508 struct ptp_msg *resp = port_management_resp_prepare(port, req); in ptp_port_management_resp() local
1510 if (!resp) { in ptp_port_management_resp()
1514 ret = port_management_resp_tlv_fill(port, req, resp, tlv); in ptp_port_management_resp()
1519 ret = port_msg_send(port, resp, PTP_SOCKET_GENERAL); in ptp_port_management_resp()
1520 ptp_msg_unref(resp); in ptp_port_management_resp()