aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-11-02 23:16:07 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-11-03 03:13:42 -0500
commit2cbd3f5ccd43ba823e183f98a798d4b23cfb12b8 (patch)
tree4699a93e0a0932208fe2f09a945600411c4d8390 /drivers/bluetooth
parent40f4938aa6bfe2d792c0665c16d9dd15a5c1b119 (diff)
Bluetooth: btusb: Add internal callback for USB bulk rx data
Some vendors require special handling of the rx data from the USB bulk endpoints. For that case provide an internal callback that can overwrite it with a custom receive function. 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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index c85426d6e33d..cd634f3b76d3 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -299,6 +299,8 @@ struct btusb_data {
299 unsigned int sco_num; 299 unsigned int sco_num;
300 int isoc_altsetting; 300 int isoc_altsetting;
301 int suspend_count; 301 int suspend_count;
302
303 int (*recv_bulk)(struct btusb_data *data, void *buffer, int count);
302}; 304};
303 305
304static inline void btusb_free_frags(struct btusb_data *data) 306static inline void btusb_free_frags(struct btusb_data *data)
@@ -590,7 +592,7 @@ static void btusb_bulk_complete(struct urb *urb)
590 if (urb->status == 0) { 592 if (urb->status == 0) {
591 hdev->stat.byte_rx += urb->actual_length; 593 hdev->stat.byte_rx += urb->actual_length;
592 594
593 if (btusb_recv_bulk(data, urb->transfer_buffer, 595 if (data->recv_bulk(data, urb->transfer_buffer,
594 urb->actual_length) < 0) { 596 urb->actual_length) < 0) {
595 BT_ERR("%s corrupted ACL packet", hdev->name); 597 BT_ERR("%s corrupted ACL packet", hdev->name);
596 hdev->stat.err_rx++; 598 hdev->stat.err_rx++;
@@ -2012,6 +2014,8 @@ static int btusb_probe(struct usb_interface *intf,
2012 init_usb_anchor(&data->isoc_anchor); 2014 init_usb_anchor(&data->isoc_anchor);
2013 spin_lock_init(&data->rxlock); 2015 spin_lock_init(&data->rxlock);
2014 2016
2017 data->recv_bulk = btusb_recv_bulk;
2018
2015 hdev = hci_alloc_dev(); 2019 hdev = hci_alloc_dev();
2016 if (!hdev) 2020 if (!hdev)
2017 return -ENOMEM; 2021 return -ENOMEM;