Lines Matching +full:sync +full:- +full:update +full:- +full:mask
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
27 #define PTP_CLASS_PMASK 0x70 /* mask for the packet type field */
57 #define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2)
85 * ptp_classify_raw - classify a PTP packet
97 * ptp_parse_header - Get pointer to the PTP v2 header
112 * ptp_get_msgtype - Extract ptp message type from given header
128 msgtype = hdr->control; in ptp_get_msgtype()
130 msgtype = hdr->tsmt & 0x0f; in ptp_get_msgtype()
137 * ptp_check_diff8 - Computes new checksum (when altering a 64-bit field)
155 * ptp_header_update_correction - Update PTP header's correction field
163 * one-step P2P that does not already modify the correction field of Pdelay_Req
173 /* previous correction value is required for checksum update. */ in ptp_header_update_correction()
174 memcpy(&correction_old, &hdr->correction, sizeof(correction_old)); in ptp_header_update_correction()
177 put_unaligned_be64((u64)correction, &hdr->correction); in ptp_header_update_correction()
183 uhdr = (struct udphdr *)((char *)hdr - sizeof(struct udphdr)); in ptp_header_update_correction()
189 /* update checksum */ in ptp_header_update_correction()
190 uhdr->check = csum_fold(ptp_check_diff8(correction_old, in ptp_header_update_correction()
191 hdr->correction, in ptp_header_update_correction()
192 ~csum_unfold(uhdr->check))); in ptp_header_update_correction()
193 if (!uhdr->check) in ptp_header_update_correction()
194 uhdr->check = CSUM_MANGLED_0; in ptp_header_update_correction()
196 skb->ip_summed = CHECKSUM_NONE; in ptp_header_update_correction()
200 * ptp_msg_is_sync - Evaluates whether the given skb is a PTP Sync message
204 * This function evaluates whether the given skb is a PTP Sync message.
206 * Return: true if sync message, false otherwise