浏览代码

Bluetooth: Enable timestamps for control channel

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>
Marcel Holtmann 13 年之前
父节点
当前提交
97e0bdeb93
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 1 0
      net/bluetooth/hci_sock.c
  2. 3 0
      net/bluetooth/mgmt.c

+ 1 - 0
net/bluetooth/hci_sock.c

@@ -782,6 +782,7 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
 	case HCI_CHANNEL_RAW:
 	case HCI_CHANNEL_RAW:
 		hci_sock_cmsg(sk, msg, skb);
 		hci_sock_cmsg(sk, msg, skb);
 		break;
 		break;
+	case HCI_CHANNEL_CONTROL:
 	case HCI_CHANNEL_MONITOR:
 	case HCI_CHANNEL_MONITOR:
 		sock_recv_timestamp(msg, sk, skb);
 		sock_recv_timestamp(msg, sk, skb);
 		break;
 		break;

+ 3 - 0
net/bluetooth/mgmt.c

@@ -817,6 +817,9 @@ static int mgmt_event(u16 event, struct hci_dev *hdev, void *data,
 	if (data)
 	if (data)
 		memcpy(skb_put(skb, data_len), data, data_len);
 		memcpy(skb_put(skb, data_len), data, data_len);
 
 
+	/* Time stamp */
+	__net_timestamp(skb);
+
 	hci_send_to_control(skb, skip_sk);
 	hci_send_to_control(skb, skip_sk);
 	kfree_skb(skb);
 	kfree_skb(skb);