diff options
author | Kurt Kanzenbach <kurt@linutronix.de> | 2022-03-05 12:21:25 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-03-07 11:31:34 +0000 |
commit | f72de02ebece2e962462bc0c1e9efd29eaa029b2 (patch) | |
tree | 5a7102eaf367b9301bf49c8d9d6ca328a016fad5 /include/linux/ptp_classify.h | |
parent | 669b258a793db9f1c3bff29ce2bbd61b810503ad (diff) |
ptp: Add generic PTP is_sync() function
PHY drivers such as micrel or dp83640 need to analyze whether a given
skb is a PTP sync message for one step functionality.
In order to avoid code duplication introduce a generic function and
move it to ptp classify.
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ptp_classify.h')
-rw-r--r-- | include/linux/ptp_classify.h | 15 |
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_ */ |