net: add NETDEV_RX_STAMP flag in d_features

Replace compile-time CONFIG_ARCH_HAVE_NETDEV_TIMESTAMP with
a runtime NETDEV_RX_STAMP bit in net_driver_s.d_features.
Drivers providing hardware RX timestamps set the flag at
probe time; the stack checks it at runtime.


Signed-off-by: OceanfromXiaomi <zhaohaiyang1@xiaomi.com>
This commit is contained in:
OceanfromXiaomi 2025-11-25 17:14:35 +08:00 • committed by Xiang Xiao
parent c6878db031
commit 28402b9b35
10 changed files with 49 additions and 28 deletions

View file

@ -80,8 +80,11 @@ int netdev_input(FAR struct net_driver_s *dev,
return ret;
}
#if defined(CONFIG_NET_TIMESTAMP) && defined(CONFIG_ARCH_HAVE_NETDEV_TIMESTAMP)
dev->d_iob->io_time = dev->d_rxtime;
#if defined(CONFIG_NET_TIMESTAMP)
if ((dev->d_features & NETDEV_RX_STAMP) != 0)
{
dev->d_iob->io_time = dev->d_rxtime;
}
#endif
/* Copy data to iob entry */