summaryrefslogtreecommitdiff
path: root/tstamping.c
blob: 7c978504e6400d81125081bcc8c7fc9a3c0e2776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/sockios.h>
#include <linux/net_tstamp.h>
#include <linux/net_tstamp.h>
#include <linux/if_packet.h>
#include <linux/if.h>

#include "str.h"
#include "tstamping.h"

#ifdef __WITH_HARDWARE_TIMESTAMPING
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, &timesource,
			  sizeof(timesource));
}
#else
int set_sockopt_hwtimestamp(int sock, const char *dev)
{
	return -1;
}
#endif
el/cpu?h=nds-private-remove&id=24d615a694d649aa2e167c3f97f62bdad07e3f84'>arch/sh/kernel/cpu parent49def1853334396f948dcb4cedb9347abb318df5 (diff)
USB: serial: qcserial: add Dell DW5570 QDL
The Dell DW5570 is a re-branded Sierra Wireless MC8805 which will by default boot with vid 0x413c and pid 0x81a3. When triggered QDL download mode, the device switches to pid 0x81a6 and provides the standard TTY used for firmware upgrade. Cc: <stable@vger.kernel.org> Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'arch/sh/kernel/cpu')