Commit 3e398d35 authored by Marcel Holtmann's avatar Marcel Holtmann

[Bluetooth] Always use two ISOC URB's

This patch modifies the USB Bluetooth driver to use two ISOC URB's
per RX and TX transfer paths. This is needed for in time transfer
of SCO audio packets over HCI.
parent 1b206f44
...@@ -303,6 +303,7 @@ static int hci_usb_open(struct hci_dev *hdev) ...@@ -303,6 +303,7 @@ static int hci_usb_open(struct hci_dev *hdev)
#ifdef CONFIG_BT_USB_SCO #ifdef CONFIG_BT_USB_SCO
if (husb->isoc_iface) if (husb->isoc_iface)
for (i = 0; i < HCI_MAX_ISOC_RX; i++)
hci_usb_isoc_rx_submit(husb); hci_usb_isoc_rx_submit(husb);
#endif #endif
} else { } else {
...@@ -520,7 +521,7 @@ static void hci_usb_tx_process(struct hci_usb *husb) ...@@ -520,7 +521,7 @@ static void hci_usb_tx_process(struct hci_usb *husb)
#ifdef CONFIG_BT_USB_SCO #ifdef CONFIG_BT_USB_SCO
/* Process SCO queue */ /* Process SCO queue */
q = __transmit_q(husb, HCI_SCODATA_PKT); q = __transmit_q(husb, HCI_SCODATA_PKT);
if (!atomic_read(__pending_tx(husb, HCI_SCODATA_PKT)) && if (atomic_read(__pending_tx(husb, HCI_SCODATA_PKT)) < HCI_MAX_ISOC_TX &&
(skb = skb_dequeue(q))) { (skb = skb_dequeue(q))) {
if (hci_usb_send_isoc(husb, skb) < 0) if (hci_usb_send_isoc(husb, skb) < 0)
skb_queue_head(q, skb); skb_queue_head(q, skb);
...@@ -828,7 +829,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -828,7 +829,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
#ifdef CONFIG_BT_USB_SCO #ifdef CONFIG_BT_USB_SCO
case USB_ENDPOINT_XFER_ISOC: case USB_ENDPOINT_XFER_ISOC:
if (ep->desc.wMaxPacketSize < size) if (ep->desc.wMaxPacketSize < size || a > 2)
break; break;
size = ep->desc.wMaxPacketSize; size = ep->desc.wMaxPacketSize;
......
...@@ -41,6 +41,9 @@ ...@@ -41,6 +41,9 @@
#define HCI_MAX_BULK_TX 4 #define HCI_MAX_BULK_TX 4
#define HCI_MAX_BULK_RX 1 #define HCI_MAX_BULK_RX 1
#define HCI_MAX_ISOC_RX 2
#define HCI_MAX_ISOC_TX 2
#define HCI_MAX_ISOC_FRAMES 10 #define HCI_MAX_ISOC_FRAMES 10
struct _urb_queue { struct _urb_queue {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment