diff options
Diffstat (limited to 'net/bluetooth/hci_sock.c')
-rw-r--r-- | net/bluetooth/hci_sock.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 1dae3dfc66a9..d16ca8e53700 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/skbuff.h> | 37 | #include <linux/skbuff.h> |
38 | #include <linux/workqueue.h> | 38 | #include <linux/workqueue.h> |
39 | #include <linux/interrupt.h> | 39 | #include <linux/interrupt.h> |
40 | #include <linux/compat.h> | ||
40 | #include <linux/socket.h> | 41 | #include <linux/socket.h> |
41 | #include <linux/ioctl.h> | 42 | #include <linux/ioctl.h> |
42 | #include <net/sock.h> | 43 | #include <net/sock.h> |
@@ -70,15 +71,15 @@ static struct hci_sec_filter hci_sec_filter = { | |||
70 | { | 71 | { |
71 | { 0x0 }, | 72 | { 0x0 }, |
72 | /* OGF_LINK_CTL */ | 73 | /* OGF_LINK_CTL */ |
73 | { 0xbe000006, 0x00000001, 0x000000, 0x00 }, | 74 | { 0xbe000006, 0x00000001, 0x00000000, 0x00 }, |
74 | /* OGF_LINK_POLICY */ | 75 | /* OGF_LINK_POLICY */ |
75 | { 0x00005200, 0x00000000, 0x000000, 0x00 }, | 76 | { 0x00005200, 0x00000000, 0x00000000, 0x00 }, |
76 | /* OGF_HOST_CTL */ | 77 | /* OGF_HOST_CTL */ |
77 | { 0xaab00200, 0x2b402aaa, 0x020154, 0x00 }, | 78 | { 0xaab00200, 0x2b402aaa, 0x05220154, 0x00 }, |
78 | /* OGF_INFO_PARAM */ | 79 | /* OGF_INFO_PARAM */ |
79 | { 0x000002be, 0x00000000, 0x000000, 0x00 }, | 80 | { 0x000002be, 0x00000000, 0x00000000, 0x00 }, |
80 | /* OGF_STATUS_PARAM */ | 81 | /* OGF_STATUS_PARAM */ |
81 | { 0x000000ea, 0x00000000, 0x000000, 0x00 } | 82 | { 0x000000ea, 0x00000000, 0x00000000, 0x00 } |
82 | } | 83 | } |
83 | }; | 84 | }; |
84 | 85 | ||
@@ -342,9 +343,23 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_ | |||
342 | 343 | ||
343 | if (mask & HCI_CMSG_TSTAMP) { | 344 | if (mask & HCI_CMSG_TSTAMP) { |
344 | struct timeval tv; | 345 | struct timeval tv; |
346 | void *data; | ||
347 | int len; | ||
345 | 348 | ||
346 | skb_get_timestamp(skb, &tv); | 349 | skb_get_timestamp(skb, &tv); |
347 | put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(tv), &tv); | 350 | |
351 | if (msg->msg_flags & MSG_CMSG_COMPAT) { | ||
352 | struct compat_timeval ctv; | ||
353 | ctv.tv_sec = tv.tv_sec; | ||
354 | ctv.tv_usec = tv.tv_usec; | ||
355 | data = &ctv; | ||
356 | len = sizeof(ctv); | ||
357 | } else { | ||
358 | data = &tv; | ||
359 | len = sizeof(tv); | ||
360 | } | ||
361 | |||
362 | put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data); | ||
348 | } | 363 | } |
349 | } | 364 | } |
350 | 365 | ||