diff options
Diffstat (limited to 'drivers/net/ethernet/ti/cpts.h')
-rw-r--r-- | drivers/net/ethernet/ti/cpts.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/cpts.h b/drivers/net/ethernet/ti/cpts.h index c96eca2b1b46..01ea82ba9cdc 100644 --- a/drivers/net/ethernet/ti/cpts.h +++ b/drivers/net/ethernet/ti/cpts.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/of.h> | 30 | #include <linux/of.h> |
31 | #include <linux/ptp_clock_kernel.h> | 31 | #include <linux/ptp_clock_kernel.h> |
32 | #include <linux/skbuff.h> | 32 | #include <linux/skbuff.h> |
33 | #include <linux/ptp_classify.h> | ||
33 | #include <linux/timecounter.h> | 34 | #include <linux/timecounter.h> |
34 | 35 | ||
35 | struct cpsw_cpts { | 36 | struct cpsw_cpts { |
@@ -155,6 +156,16 @@ static inline bool cpts_is_tx_enabled(struct cpts *cpts) | |||
155 | return !!cpts->tx_enable; | 156 | return !!cpts->tx_enable; |
156 | } | 157 | } |
157 | 158 | ||
159 | static inline bool cpts_can_timestamp(struct cpts *cpts, struct sk_buff *skb) | ||
160 | { | ||
161 | unsigned int class = ptp_classify_raw(skb); | ||
162 | |||
163 | if (class == PTP_CLASS_NONE) | ||
164 | return false; | ||
165 | |||
166 | return true; | ||
167 | } | ||
168 | |||
158 | #else | 169 | #else |
159 | struct cpts; | 170 | struct cpts; |
160 | 171 | ||
@@ -203,6 +214,11 @@ static inline bool cpts_is_tx_enabled(struct cpts *cpts) | |||
203 | { | 214 | { |
204 | return false; | 215 | return false; |
205 | } | 216 | } |
217 | |||
218 | static inline bool cpts_can_timestamp(struct cpts *cpts, struct sk_buff *skb) | ||
219 | { | ||
220 | return false; | ||
221 | } | ||
206 | #endif | 222 | #endif |
207 | 223 | ||
208 | 224 | ||