| Server IP : 54.233.248.239 / Your IP : 172.28.20.13 Web Server : Apache System : Linux ip-172-28-29-189 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 15:27:06 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.2.34-43+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/modules/6.8.0-1042-aws/build/include/linux/dsa/ |
Upload File : |
/* SPDX-License-Identifier: GPL-2.0 */
/* Microchip switch tag common header
*
* Copyright (C) 2022 Microchip Technology Inc.
*/
#ifndef _NET_DSA_KSZ_COMMON_H_
#define _NET_DSA_KSZ_COMMON_H_
#include <net/dsa.h>
/* All time stamps from the KSZ consist of 2 bits for seconds and 30 bits for
* nanoseconds. This is NOT the same as 32 bits for nanoseconds.
*/
#define KSZ_TSTAMP_SEC_MASK GENMASK(31, 30)
#define KSZ_TSTAMP_NSEC_MASK GENMASK(29, 0)
static inline ktime_t ksz_decode_tstamp(u32 tstamp)
{
u64 ns = FIELD_GET(KSZ_TSTAMP_SEC_MASK, tstamp) * NSEC_PER_SEC +
FIELD_GET(KSZ_TSTAMP_NSEC_MASK, tstamp);
return ns_to_ktime(ns);
}
struct ksz_deferred_xmit_work {
struct dsa_port *dp;
struct sk_buff *skb;
struct kthread_work work;
};
struct ksz_tagger_data {
void (*xmit_work_fn)(struct kthread_work *work);
void (*hwtstamp_set_state)(struct dsa_switch *ds, bool on);
};
struct ksz_skb_cb {
struct sk_buff *clone;
unsigned int ptp_type;
bool update_correction;
u32 tstamp;
};
#define KSZ_SKB_CB(skb) \
((struct ksz_skb_cb *)((skb)->cb))
static inline struct ksz_tagger_data *
ksz_tagger_data(struct dsa_switch *ds)
{
return ds->tagger_data;
}
#endif /* _NET_DSA_KSZ_COMMON_H_ */