mirror of
https://github.com/apache/nuttx.git
synced 2026-10-03 04:07:55 +00:00
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:
parent
c6878db031
commit
28402b9b35
10 changed files with 49 additions and 28 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue