linux-next/include/linux/net_tstamp.h
Jakub Kicinski 289354f21b net: partial revert of the "Make timestamping selectable: series
Revert following commits:

commit acec05fb78 ("net_tstamp: Add TIMESTAMPING SOFTWARE and HARDWARE mask")
commit 11d55be06d ("net: ethtool: Add a command to expose current time stamping layer")
commit bb8645b00c ("netlink: specs: Introduce new netlink command to get current timestamp")
commit d905f9c753 ("net: ethtool: Add a command to list available time stamping layers")
commit aed5004ee7 ("netlink: specs: Introduce new netlink command to list available time stamping layers")
commit 51bdf3165f ("net: Replace hwtstamp_source by timestamping layer")
commit 0f7f463d48 ("net: Change the API of PHY default timestamp to MAC")
commit 091fab1228 ("net: ethtool: ts: Update GET_TS to reply the current selected timestamp")
commit 152c75e1d0 ("net: ethtool: ts: Let the active time stamping layer be selectable")
commit ee60ea6be0 ("netlink: specs: Introduce time stamping set command")

They need more time for reviews.

Link: https://lore.kernel.org/all/20231118183529.6e67100c@kernel.org/
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-11-18 18:42:37 -08:00

64 lines
1.9 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_NET_TIMESTAMPING_H_
#define _LINUX_NET_TIMESTAMPING_H_
#include <uapi/linux/net_tstamp.h>
enum hwtstamp_source {
HWTSTAMP_SOURCE_NETDEV,
HWTSTAMP_SOURCE_PHYLIB,
};
/**
* struct kernel_hwtstamp_config - Kernel copy of struct hwtstamp_config
*
* @flags: see struct hwtstamp_config
* @tx_type: see struct hwtstamp_config
* @rx_filter: see struct hwtstamp_config
* @ifr: pointer to ifreq structure from the original ioctl request, to pass to
* a legacy implementation of a lower driver
* @copied_to_user: request was passed to a legacy implementation which already
* copied the ioctl request back to user space
* @source: indication whether timestamps should come from the netdev or from
* an attached phylib PHY
*
* Prefer using this structure for in-kernel processing of hardware
* timestamping configuration, over the inextensible struct hwtstamp_config
* exposed to the %SIOCGHWTSTAMP and %SIOCSHWTSTAMP ioctl UAPI.
*/
struct kernel_hwtstamp_config {
int flags;
int tx_type;
int rx_filter;
struct ifreq *ifr;
bool copied_to_user;
enum hwtstamp_source source;
};
static inline void hwtstamp_config_to_kernel(struct kernel_hwtstamp_config *kernel_cfg,
const struct hwtstamp_config *cfg)
{
kernel_cfg->flags = cfg->flags;
kernel_cfg->tx_type = cfg->tx_type;
kernel_cfg->rx_filter = cfg->rx_filter;
}
static inline void hwtstamp_config_from_kernel(struct hwtstamp_config *cfg,
const struct kernel_hwtstamp_config *kernel_cfg)
{
cfg->flags = kernel_cfg->flags;
cfg->tx_type = kernel_cfg->tx_type;
cfg->rx_filter = kernel_cfg->rx_filter;
}
static inline bool kernel_hwtstamp_config_changed(const struct kernel_hwtstamp_config *a,
const struct kernel_hwtstamp_config *b)
{
return a->flags != b->flags ||
a->tx_type != b->tx_type ||
a->rx_filter != b->rx_filter;
}
#endif /* _LINUX_NET_TIMESTAMPING_H_ */