mirror of
https://github.com/apache/nuttx.git
synced 2026-10-03 12:18:06 +00:00
include/sys/socket.h: give SOF_TIMESTAMPING_* their Linux values
All SOF_TIMESTAMPING_* flags currently alias 1 << SO_TIMESTAMPING, so they cannot tell hardware from software or RX from TX. Give them their distinct Linux values, and add SOF_TIMESTAMPING_RX_HARDWARE, SOF_TIMESTAMPING_RX_SOFTWARE and SOF_TIMESTAMPING_SYS_HARDWARE, so that they can also describe the timestamping capabilities of an interface (so_timestamping of ETHTOOL_GET_TS_INFO). This does not change behaviour: setsockopt(SO_TIMESTAMPING) only checks for a non-zero value and getsockopt() returns 0 or 1, so existing users and binaries built with the previous values keep working. The individual flags are still not honoured. Assisted-by: Claude:claude-sonnet-5 Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com>
This commit is contained in:
parent
68dd87f4df
commit
b7001f2d9f
1 changed files with 13 additions and 4 deletions
|
|
@ -230,15 +230,24 @@
|
|||
|
||||
#define __SO_PROTOCOL 16
|
||||
|
||||
/* SO_TIMESTAMPING flags, with the same values as Linux so that they can
|
||||
* also describe the capabilities of an interface (ETHTOOL_GET_TS_INFO).
|
||||
* setsockopt(SO_TIMESTAMPING) currently treats any non-zero value as
|
||||
* "enabled" and does not honour the individual flags.
|
||||
*/
|
||||
|
||||
/* Timestamp generation */
|
||||
|
||||
#define SOF_TIMESTAMPING_TX_HARDWARE (1 << SO_TIMESTAMPING)
|
||||
#define SOF_TIMESTAMPING_TX_SOFTWARE SOF_TIMESTAMPING_TX_HARDWARE
|
||||
#define SOF_TIMESTAMPING_TX_HARDWARE (1 << 0)
|
||||
#define SOF_TIMESTAMPING_TX_SOFTWARE (1 << 1)
|
||||
#define SOF_TIMESTAMPING_RX_HARDWARE (1 << 2)
|
||||
#define SOF_TIMESTAMPING_RX_SOFTWARE (1 << 3)
|
||||
|
||||
/* Timestamp reporting */
|
||||
|
||||
#define SOF_TIMESTAMPING_SOFTWARE SOF_TIMESTAMPING_TX_SOFTWARE
|
||||
#define SOF_TIMESTAMPING_RAW_HARDWARE SOF_TIMESTAMPING_TX_HARDWARE
|
||||
#define SOF_TIMESTAMPING_SOFTWARE (1 << 4)
|
||||
#define SOF_TIMESTAMPING_SYS_HARDWARE (1 << 5)
|
||||
#define SOF_TIMESTAMPING_RAW_HARDWARE (1 << 6)
|
||||
|
||||
/* The options are unsupported but included for compatibility
|
||||
* and portability
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue