Thread (2 messages) flat view 2 messages, 2 authors, 2012-02-22
STALE5327d

[PATCH v2] Bluetooth: Enable timestamps for control channel

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-02-22 12:49:28
Subsystem: bluetooth subsystem, the rest · Maintainers: Marcel Holtmann, Luiz Augusto von Dentz, Linus Torvalds

The control channel can be also monitored, so include timestamps here
as well. And make sure management events get their timestamp when they
are created.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
 net/bluetooth/hci_sock.c |    1 +
 net/bluetooth/mgmt.c     |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index b768393..f0912d8 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -783,6 +783,7 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
 	case HCI_CHANNEL_RAW:
 		hci_sock_cmsg(sk, msg, skb);
 		break;
+	case HCI_CHANNEL_CONTROL:
 	case HCI_CHANNEL_MONITOR:
 		sock_recv_timestamp(msg, sk, skb);
 		break;
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 9fb4490..d650c02 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -817,6 +817,9 @@ static int mgmt_event(u16 event, struct hci_dev *hdev, void *data,
 	if (data)
 		memcpy(skb_put(skb, data_len), data, data_len);
 
+	/* Time stamp */
+	__net_timestamp(skb);
+
 	hci_send_to_control(skb, skip_sk);
 	kfree_skb(skb);
 
-- 
1.7.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help