Skip to content

Commit 51bdf31

Browse files
kmaincentdavem330
authored andcommitted
net: Replace hwtstamp_source by timestamping layer
Replace hwtstamp_source which is only used by the kernel_hwtstamp_config structure by the more widely use timestamp_layer structure. This is done to prepare the support of selectable timestamping source. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent aed5004 commit 51bdf31

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

drivers/net/ethernet/microchip/lan966x/lan966x_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,15 +470,15 @@ static int lan966x_port_hwtstamp_set(struct net_device *dev,
470470
struct lan966x_port *port = netdev_priv(dev);
471471
int err;
472472

473-
if (cfg->source != HWTSTAMP_SOURCE_NETDEV &&
474-
cfg->source != HWTSTAMP_SOURCE_PHYLIB)
473+
if (cfg->source != MAC_TIMESTAMPING &&
474+
cfg->source != PHY_TIMESTAMPING)
475475
return -EOPNOTSUPP;
476476

477477
err = lan966x_ptp_setup_traps(port, cfg);
478478
if (err)
479479
return err;
480480

481-
if (cfg->source == HWTSTAMP_SOURCE_NETDEV) {
481+
if (cfg->source == MAC_TIMESTAMPING) {
482482
if (!port->lan966x->ptp)
483483
return -EOPNOTSUPP;
484484

include/linux/net_tstamp.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55

66
#include <uapi/linux/net_tstamp.h>
77

8-
enum hwtstamp_source {
9-
HWTSTAMP_SOURCE_NETDEV,
10-
HWTSTAMP_SOURCE_PHYLIB,
11-
};
12-
138
/**
149
* struct kernel_hwtstamp_config - Kernel copy of struct hwtstamp_config
1510
*
@@ -20,8 +15,8 @@ enum hwtstamp_source {
2015
* a legacy implementation of a lower driver
2116
* @copied_to_user: request was passed to a legacy implementation which already
2217
* copied the ioctl request back to user space
23-
* @source: indication whether timestamps should come from the netdev or from
24-
* an attached phylib PHY
18+
* @source: indication whether timestamps should come from software, the netdev
19+
* or from an attached phylib PHY
2520
*
2621
* Prefer using this structure for in-kernel processing of hardware
2722
* timestamping configuration, over the inextensible struct hwtstamp_config
@@ -33,7 +28,7 @@ struct kernel_hwtstamp_config {
3328
int rx_filter;
3429
struct ifreq *ifr;
3530
bool copied_to_user;
36-
enum hwtstamp_source source;
31+
enum timestamping_layer source;
3732
};
3833

3934
static inline void hwtstamp_config_to_kernel(struct kernel_hwtstamp_config *kernel_cfg,

net/core/dev_ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ int dev_set_hwtstamp_phylib(struct net_device *dev,
332332
bool changed = false;
333333
int err;
334334

335-
cfg->source = phy_ts ? HWTSTAMP_SOURCE_PHYLIB : HWTSTAMP_SOURCE_NETDEV;
335+
cfg->source = phy_ts ? PHY_TIMESTAMPING : MAC_TIMESTAMPING;
336336

337337
if (phy_ts && (dev->priv_flags & IFF_SEE_ALL_HWTSTAMP_REQUESTS)) {
338338
err = ops->ndo_hwtstamp_get(dev, &old_cfg);

0 commit comments

Comments
 (0)