summaryrefslogtreecommitdiff
path: root/include/linux/ptp_classify.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2022-03-07 11:31:34 +0000
committerDavid S. Miller <davem@davemloft.net>2022-03-07 11:31:34 +0000
commitcd0b6277c3aafdf855a7cded10defd7705e6580e (patch)
tree78c6c8f0eee3afb62c390ac91c80267e80b2fb41 /include/linux/ptp_classify.h
parent669b258a793db9f1c3bff29ce2bbd61b810503ad (diff)
parent3914a9c07e8c3a30f178f1c92e2354b9cffdecb5 (diff)
downloadlinux-cd0b6277c3aafdf855a7cded10defd7705e6580e.tar.gz
linux-cd0b6277c3aafdf855a7cded10defd7705e6580e.tar.bz2
linux-cd0b6277c3aafdf855a7cded10defd7705e6580e.zip
Merge branch 'ptp-is_sync'
Kurt Kanzenbach says: ==================== ptp: Add generic is_sync() function as multiple PHY drivers such as micrel or TI dp83640 need to inspect whether a given skb represents a PTP Sync message, provide a generic function for it. This avoids code duplication and can be reused by future PHY IEEE 1588 implementations. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ptp_classify.h')
-rw-r--r--include/linux/ptp_classify.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h
index 9afd34a2d36c..fefa7790dc46 100644
--- a/include/linux/ptp_classify.h
+++ b/include/linux/ptp_classify.h
@@ -126,6 +126,17 @@ static inline u8 ptp_get_msgtype(const struct ptp_header *hdr,
return msgtype;
}
+/**
+ * ptp_msg_is_sync - Evaluates whether the given skb is a PTP Sync message
+ * @skb: packet buffer
+ * @type: type of the packet (see ptp_classify_raw())
+ *
+ * This function evaluates whether the given skb is a PTP Sync message.
+ *
+ * Return: true if sync message, false otherwise
+ */
+bool ptp_msg_is_sync(struct sk_buff *skb, unsigned int type);
+
void __init ptp_classifier_init(void);
#else
static inline void ptp_classifier_init(void)
@@ -148,5 +159,9 @@ static inline u8 ptp_get_msgtype(const struct ptp_header *hdr,
*/
return PTP_MSGTYPE_SYNC;
}
+static inline bool ptp_msg_is_sync(struct sk_buff *skb, unsigned int type)
+{
+ return false;
+}
#endif
#endif /* _PTP_CLASSIFY_H_ */