aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-01-12 16:51:10 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2015-01-14 03:01:32 -0500
commit97307f51d7ce676661acef7af8a01eb11b3560c0 (patch)
treed308ac6c0e774eaf0c91ec7a3e3f4bd6774256fb /drivers/bluetooth
parenta93661203641eb5e8aa9bbed8d9689e5d5dbe6b1 (diff)
Bluetooth: btusb: Add internal recv_event callback for event processing
Some new upcoming drivers need to process HCI events or take extra actions based on them before handing the event to the Bluetooth core for processing. The new recv_event callback allows exactly such an internal behavior. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btusb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 1ea63518d130..4a6495ab9726 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -309,6 +309,7 @@ struct btusb_data {
309 int isoc_altsetting; 309 int isoc_altsetting;
310 int suspend_count; 310 int suspend_count;
311 311
312 int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb);
312 int (*recv_bulk)(struct btusb_data *data, void *buffer, int count); 313 int (*recv_bulk)(struct btusb_data *data, void *buffer, int count);
313}; 314};
314 315
@@ -374,7 +375,7 @@ static int btusb_recv_intr(struct btusb_data *data, void *buffer, int count)
374 375
375 if (bt_cb(skb)->expect == 0) { 376 if (bt_cb(skb)->expect == 0) {
376 /* Complete frame */ 377 /* Complete frame */
377 hci_recv_frame(data->hdev, skb); 378 data->recv_event(data->hdev, skb);
378 skb = NULL; 379 skb = NULL;
379 } 380 }
380 } 381 }
@@ -2048,6 +2049,7 @@ static int btusb_probe(struct usb_interface *intf,
2048 init_usb_anchor(&data->isoc_anchor); 2049 init_usb_anchor(&data->isoc_anchor);
2049 spin_lock_init(&data->rxlock); 2050 spin_lock_init(&data->rxlock);
2050 2051
2052 data->recv_event = hci_recv_frame;
2051 data->recv_bulk = btusb_recv_bulk; 2053 data->recv_bulk = btusb_recv_bulk;
2052 2054
2053 hdev = hci_alloc_dev(); 2055 hdev = hci_alloc_dev();