Commit 2111375b authored by Kory Maincent's avatar Kory Maincent Committed by Jakub Kicinski
Browse files

net: Add struct kernel_ethtool_ts_info



In prevision to add new UAPI for hwtstamp we will be limited to the struct
ethtool_ts_info that is currently passed in fixed binary format through the
ETHTOOL_GET_TS_INFO ethtool ioctl. It would be good if new kernel code
already started operating on an extensible kernel variant of that
structure, similar in concept to struct kernel_hwtstamp_config vs struct
hwtstamp_config.

Since struct ethtool_ts_info is in include/uapi/linux/ethtool.h, here
we introduce the kernel-only structure in include/linux/ethtool.h.
The manual copy is then made in the function called by ETHTOOL_GET_TS_INFO.

Acked-by: default avatarShannon Nelson <shannon.nelson@amd.com>
Acked-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Signed-off-by: default avatarKory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20240709-feature_ptp_netnext-v17-6-b5317f50df2a@bootlin.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent bc5a07ed
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5755,10 +5755,10 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
}

static int bond_ethtool_get_ts_info(struct net_device *bond_dev,
				    struct ethtool_ts_info *info)
				    struct kernel_ethtool_ts_info *info)
{
	struct bonding *bond = netdev_priv(bond_dev);
	struct ethtool_ts_info ts_info;
	struct kernel_ethtool_ts_info ts_info;
	struct net_device *real_dev;
	bool sw_tx_support = false;
	struct list_head *iter;
+1 −1
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ EXPORT_SYMBOL(can_eth_ioctl_hwts);
 * supporting hardware timestamps
 */
int can_ethtool_op_get_ts_info_hwts(struct net_device *dev,
				    struct ethtool_ts_info *info)
				    struct kernel_ethtool_ts_info *info)
{
	info->so_timestamping =
		SOF_TIMESTAMPING_TX_SOFTWARE |
+1 −1
Original line number Diff line number Diff line
@@ -777,7 +777,7 @@ static const struct net_device_ops peak_canfd_netdev_ops = {
};

static int peak_get_ts_info(struct net_device *dev,
			    struct ethtool_ts_info *info)
			    struct kernel_ethtool_ts_info *info)
{
	info->so_timestamping =
		SOF_TIMESTAMPING_TX_SOFTWARE |
+1 −1
Original line number Diff line number Diff line
@@ -1148,7 +1148,7 @@ static int gs_usb_set_phys_id(struct net_device *netdev,
}

static int gs_usb_get_ts_info(struct net_device *netdev,
			      struct ethtool_ts_info *info)
			      struct kernel_ethtool_ts_info *info)
{
	struct gs_can *dev = netdev_priv(netdev);

+1 −1
Original line number Diff line number Diff line
@@ -897,7 +897,7 @@ int peak_usb_set_eeprom(struct net_device *netdev,
	return 0;
}

int pcan_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
int pcan_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info)
{
	info->so_timestamping =
		SOF_TIMESTAMPING_TX_SOFTWARE |
Loading