From: Tom Hughes Date: Wed, 11 Jul 2012 14:33:10 +0000 (+0000) Subject: Add support for the SIOCSHWTSTAMP ioctl, based on a patch X-Git-Tag: svn/VALGRIND_3_8_0~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd70fc4248d65d8662f1d6a8f156399cb7c53fae;p=thirdparty%2Fvalgrind.git Add support for the SIOCSHWTSTAMP ioctl, based on a patch from Arseny Solokha. Fixes BZ#296792. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12730 --- diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 24fcb805e4..edbd61c62b 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -4489,6 +4489,13 @@ PRE(sys_ioctl) (Addr)&((struct vki_ifreq *)ARG3)->ifr_map, sizeof(((struct vki_ifreq *)ARG3)->ifr_map) ); break; + case VKI_SIOCSHWTSTAMP: /* Set hardware time stamping */ + PRE_MEM_RASCIIZ( "ioctl(SIOCSHWTSTAMP)", + (Addr)((struct vki_ifreq *)ARG3)->vki_ifr_name ); + PRE_MEM_READ( "ioctl(SIOCSHWTSTAMP)", + (Addr)((struct vki_ifreq *)ARG3)->vki_ifr_data, + sizeof(struct vki_hwtstamp_config) ); + break; case VKI_SIOCSIFTXQLEN: /* Set the tx queue length */ PRE_MEM_RASCIIZ( "ioctl(SIOCSIFTXQLEN)", (Addr)((struct vki_ifreq *)ARG3)->vki_ifr_name ); @@ -5756,6 +5763,7 @@ POST(sys_ioctl) case VKI_SIOCSIFFLAGS: /* set flags */ case VKI_SIOCSIFMAP: /* Set device parameters */ + case VKI_SIOCSHWTSTAMP: /* Set hardware time stamping */ case VKI_SIOCSIFTXQLEN: /* Set the tx queue length */ case VKI_SIOCSIFDSTADDR: /* set remote PA address */ case VKI_SIOCSIFBRDADDR: /* set broadcast PA address */ diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index 5df1b222d4..e90f1e6316 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -1622,6 +1622,8 @@ typedef struct { #define VKI_SIOCGIFMAP 0x8970 /* Get device parameters */ #define VKI_SIOCSIFMAP 0x8971 /* Set device parameters */ +#define VKI_SIOCSHWTSTAMP 0x89B0 /* Set hardware time stamping */ + //---------------------------------------------------------------------- // From linux-2.6.8.1/include/linux/ppdev.h //---------------------------------------------------------------------- @@ -2978,6 +2980,16 @@ struct vki_hci_inquiry_req { #define VKI_KVM_S390_INITIAL_RESET _VKI_IO(KVMIO, 0x97) #define VKI_KVM_NMI _VKI_IO(KVMIO, 0x9a) +//---------------------------------------------------------------------- +// From linux-2.6/include/linux/net_stamp.h +//---------------------------------------------------------------------- + +struct vki_hwtstamp_config { + int flags; + int tx_type; + int rx_filter; +}; + #endif // __VKI_LINUX_H /*--------------------------------------------------------------------*/