/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ extern int set_sockopt_hwtimestamp(int sock, const char *dev); #ifdef __WITH_HARDWARE_TIMESTAMPING #include #include #include #include #include #include #include #include #include #include "xutils.h" int set_sockopt_hwtimestamp(int sock, const char *dev) { int timesource, ret; struct hwtstamp_config hwconfig; struct ifreq ifr; if (!strncmp("any", dev, strlen("any"))) return -1; memset(&hwconfig, 0, sizeof(hwconfig)); hwconfig.tx_type = HWTSTAMP_TX_OFF; hwconfig.rx_filter = HWTSTAMP_FILTER_ALL; memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name)); ifr.ifr_data = &hwconfig; ret = ioctl(sock, SIOCSHWTSTAMP, &ifr); if (ret < 0) return -1; timesource = SOF_TIMESTAMPING_RAW_HARDWARE; return setsockopt(sock, SOL_PACKET, PACKET_TIMESTAMP, ×ource, sizeof(timesource)); } #else int set_sockopt_hwtimestamp(int sock, const char *dev) { return -1; } #endif ter net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2016-07-30 13:43:19 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2016-07-30 13:43:19 +1000
commit719dbb2df78fc9a40e28392b07cd715bfc5a665c (patch)
tree0bbc3b84b74178d18164f5522ee3715623f94bbe /Documentation
parentfbef66f0adcddf4475e19f3d09df22fb34e633f6 (diff)
parent9f595fd8b54809fed13fc30906ef1e90a3fcfbc9 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux into next
Freescale updates from Scott: "Highlights include more 8xx optimizations, device tree updates, and MVME7100 support."
Diffstat (limited to 'Documentation')