#include "terminal.h"
#include "lib.h"
+#ifndef SIOCSHWTSTAMP
+# define SIOCSHWTSTAMP 0x89b0
+#endif
+
#define MAXSOCK 16 /* max. number of CAN interfaces given on the cmdline */
#define MAXIFNAMES 30 /* size of receive name index to omit ioctls */
#define MAXCOL 6 /* number of different colors for colorized output */
return 1;
}
} else {
+ struct ifreq hwtstamp;
+ struct hwtstamp_config hwconfig;
+
+ memset(&hwtstamp, 0, sizeof(hwtstamp));
+ strncpy(hwtstamp.ifr_name, ifr.ifr_name, sizeof(hwtstamp.ifr_name));
+ hwtstamp.ifr_data = (void *)&hwconfig;
+ memset(&hwconfig, 0, sizeof(hwconfig));
+ hwconfig.tx_type = HWTSTAMP_TX_OFF;
+ hwconfig.rx_filter = HWTSTAMP_FILTER_ALL;
+
+ if (ioctl(s[i], SIOCSHWTSTAMP, &hwtstamp) < 0) {
+ perror("SIOCSHWTSTAMP");
+ return 1;
+ }
+
const int so_timestamping_flags = SOF_TIMESTAMPING_RAW_HARDWARE;
if (setsockopt(s[i], SOL_SOCKET, SO_TIMESTAMPING,