Bluetooth: Enable timestamps for control channel
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 22 Feb 2012 12:49:28 +0000 (13:49 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 23 Feb 2012 11:06:59 +0000 (13:06 +0200)
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>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_sock.c
net/bluetooth/mgmt.c

index dd5635064145ee10d21ac3ae983ebcc88f55ea0a..8a814bca00d71bc9f88601baa72d0517ccf4bc42 100644 (file)
@@ -782,6 +782,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;
index 08c657df7f8c44083a130788b15a78391e9d9ae2..8b4df0473ec3bcc2ff660d934b615f43d9351d20 100644 (file)
@@ -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);