From c59245ddcc0541edca71769b3153bc13580a5bbb Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Mon, 13 May 2013 12:24:34 +0200 Subject: ring: break out timestamping since not directly related Break out the timestamping part of the ring.h file, since it's not directly related to the {t,r}x_ring. Also inlining doesn't make sense here. Signed-off-by: Daniel Borkmann --- ring.h | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'ring.h') diff --git a/ring.h b/ring.h index e74661c..dea1b6c 100644 --- a/ring.h +++ b/ring.h @@ -131,39 +131,4 @@ static inline void set_sockopt_tpacket(int sock) panic("Cannot set tpacketv2!\n"); } -#ifdef __WITH_HARDWARE_TIMESTAMPING -# include - -static inline 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 -static inline int set_sockopt_hwtimestamp(int sock, const char *dev) -{ - return -1; -} -#endif #endif /* RING_H */ -- cgit v1.2.3-54-g00ecf