Thread (20 messages) 20 messages, 4 authors, 2026-07-21

Re: [PATCH net-next v7 08/15] net: ethernet: oa_tc6: Support for hardware timestamp

flat view

From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Date: 2026-07-09 10:45:27
Also in: linux-devicetree, linux-doc, lkml

On 08/07/2026 18:12, Selvamani Rajagopal via B4 Relay wrote:
From: Selvamani Rajagopal <redacted>

PTP register/unregister calls are implemented in oa_tc6_ptp.c.
The APIs that work with the hardware for timestamp is provided
by vendor code as it may be vendor dependent.

Interface for ndo_hwtstamp_set/get, ioctl, control and status
callback for ethtool are provided to support hardware timestamp
feature.

Besides ioctl interface, hardware timestamp functions that handles
header and footer data are in oa_tc6.c. Helper functions are in
oa_tc6_tstamp.c.

Signed-off-by: Selvamani Rajagopal <redacted>

---
changes in v7
   - Fixed the parameter name mismatch in function protoype and
     definition
   - CONFIG0 is set with 64 bit timestamp support by default.
   - Added information about return value for API documentation.
changes in v6
   - Fixed the issue of function parameter in oa_tc6_get_ts_stats
     not described in comments section for documentation.
   - Avoided typecasting __be32 as u32
changes in v5
   - As subtracting skb len by FCS size is considered bug, changes
     are removed. Will be fixed in stable branch (net repo)
changes in v4
   - Fixed the condition check for subtracting the FCS size
     from skb len.
changes in v3
   - Replaced warning printk with ratelimited printk
   - Checking the hardware register before enabling hardware
     timestamp
changes in v1
   - Added hardware timestamp support to the OA TC6 framework.
---
  MAINTAINERS                                  |   1 +
  drivers/net/ethernet/oa_tc6/Makefile         |   2 +-
  drivers/net/ethernet/oa_tc6/oa_tc6.c         | 218 +++++++++++++++++++++++++--
  drivers/net/ethernet/oa_tc6/oa_tc6_ptp.c     |  70 +++++++++
  drivers/net/ethernet/oa_tc6/oa_tc6_std_def.h |  34 +++++
  drivers/net/ethernet/oa_tc6/oa_tc6_tstamp.c  | 205 +++++++++++++++++++++++++
  include/linux/oa_tc6.h                       |  12 ++
  7 files changed, 527 insertions(+), 15 deletions(-)
[...]
quoted hunk ↗ jump to hunk
+/**
+ * oa_tc6_ioctl - generic ioctl interface for MAC-PHY drivers.
+ * @tc6: oa_tc6 struct.
+ * @rq: request from socket interface
+ * @cmd: value to set/get timestamp configuration
+ *
+ * Return: 0 on success otherwise failed.
+ */
+int oa_tc6_ioctl(struct oa_tc6 *tc6, struct ifreq *rq, int cmd)
+{
+	if (!netif_running(tc6->netdev))
+		return -EINVAL;
+
+	if (cmd == SIOCSHWTSTAMP || cmd == SIOCGHWTSTAMP)
+		return oa_tc6_tstamp_ioctl(tc6, rq, cmd);
ioctl interface for HW timestamp configuration is deprecated, kernel
code was recently cleaned up to aviod these ioctl commands in favor of
ndo_hwtstamp_get/ndo_hwtstamp_set callbacks. New drivers must not use
deprecated ioctl commands.
quoted hunk ↗ jump to hunk
+	else
+		return phy_do_ioctl_running(tc6->netdev, rq, cmd);
+}
+EXPORT_SYMBOL_GPL(oa_tc6_ioctl);
+
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help