daniel-p-carvalho opened a new pull request, #20346: URL: https://github.com/apache/nuttx/pull/20346
## Summary Follow-up to the discussion in [apache/nuttx-apps#3791](https://github.com/apache/nuttx-apps/pull/3791#discussion_r4088297517): adds a `NETDEV_TX_STAMP` capability flag mirroring the existing `NETDEV_RX_STAMP`, plus a socket ioctl so userspace can query it, instead of userspace having to detect hardware TX timestamp support by trial and error. - `NETDEV_TX_STAMP` (`1 << 4`) in `include/nuttx/net/netdev.h`, next to `NETDEV_RX_STAMP`. A driver sets it in `d_features` to declare that it delivers hardware TX timestamps (the same way Linux drivers statically declare `SOF_TIMESTAMPING_TX_HARDWARE`, read once by userspace via `ethtool`/`SIOCETHTOOL` instead of probed at runtime). - New `SIOCGIFTSCAPS` ioctl (`net/netdev/netdev_ioctl.c`), returning the RX/TX timestamping bits of `d_features` for a named interface via `struct ifreq`, following the same pattern already used by `SIOCGIFFLAGS`. - STM32H7 Ethernet driver (`arch/arm/src/stm32h7/stm32_ethernet.c`) declares `NETDEV_TX_STAMP` when `CONFIG_STM32_ETH_TIMESTAMP_TX` is enabled, mirroring the existing `NETDEV_RX_STAMP` declaration right above it. This is the `nuttx` half of the two-PR sequence agreed on in the #3791 review; a follow-up in `nuttx-apps` switches `ptpd` to query this capability once at startup instead of the current retry-count-based detection. ## Test plan - [x] Clean build of an STM32H7 board (`CONFIG_STM32_ETH_TIMESTAMP_TX=y`) confirming `d_features` includes `NETDEV_TX_STAMP`. - [x] `SIOCGIFTSCAPS` exercised end-to-end via the `nuttx-apps` change below: `ptpd` reads `NETDEV_TX_STAMP` through it at startup on real hardware and enters hardware TX timestamp mode immediately, with no probing/timeout messages. - [x] 10-minute soak against a real PTP Grandmaster on the bench with the corresponding `nuttx-apps` change (next PR) applied, confirming no regression in sync stability (0 ping failures, stable delta/path delay). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
