diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-04-02 06:34:31 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-04-04 12:16:04 -0400 |
commit | b6ddb638235d90ed67af9af40e63880fd66a1939 (patch) | |
tree | acb90fd3ac15d2e879a2f1df5a5992b9c3d40afd /net/bluetooth/hci_event.c | |
parent | 1687dfc3dcecd7f22f60461b562b9ae3171eb93e (diff) |
Bluetooth: Track received events in hdev
This patch adds tracking of received HCI events to the hci_dev struct.
This is necessary so that a subsequent patch can implement a function
for sending a single command synchronously and returning the resulting
command complete parameters in the function return value.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 7e7fbca59439..ed0efb7255b0 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -3699,6 +3699,18 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) | |||
3699 | struct hci_event_hdr *hdr = (void *) skb->data; | 3699 | struct hci_event_hdr *hdr = (void *) skb->data; |
3700 | __u8 event = hdr->evt; | 3700 | __u8 event = hdr->evt; |
3701 | 3701 | ||
3702 | hci_dev_lock(hdev); | ||
3703 | |||
3704 | /* Received events are (currently) only needed when a request is | ||
3705 | * ongoing so avoid unnecessary memory allocation. | ||
3706 | */ | ||
3707 | if (hdev->req_status == HCI_REQ_PEND) { | ||
3708 | kfree_skb(hdev->recv_evt); | ||
3709 | hdev->recv_evt = skb_clone(skb, GFP_KERNEL); | ||
3710 | } | ||
3711 | |||
3712 | hci_dev_unlock(hdev); | ||
3713 | |||
3702 | skb_pull(skb, HCI_EVENT_HDR_SIZE); | 3714 | skb_pull(skb, HCI_EVENT_HDR_SIZE); |
3703 | 3715 | ||
3704 | switch (event) { | 3716 | switch (event) { |