Bluetooth: btusb: urb->interval speed check in btusb_submit_isoc_urb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Gustavo, Marcel,

In drivers/Bluetooth/btusb.c, function btusb_send_frame(), we call

        usb_fill_int_urb(urb, data->udev, pipe,
                        skb->data, skb->len, btusb_isoc_tx_complete,
                        skb, data->isoc_tx_ep->bInterval);

in case HCI_SCODATA_PKT. The inline function usb_fill_int_urb will check USB_SPEED_HIGH or USB_SPEED_SUPER to assign different value to urb->interval.

        if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER)
                urb->interval = 1 << (interval - 1);
        else
                urb->interval = interval;

Shall we do the same check for btusb_submit_isoc_urb()?

---
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index ea5ad1c..27ecf40 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -512,7 +512,11 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev, gfp_
        urb->pipe     = pipe;
        urb->context  = hdev;
        urb->complete = btusb_isoc_complete;
-       urb->interval = data->isoc_rx_ep->bInterval;
+       if (data->udev->speed == USB_SPEED_HIGH
+                               || data->udev->speed == USB_SPEED_SUPER)
+               urb->interval = 1 << (data->isoc_rx_ep->bInterval - 1);
+       else
+               urb->interval = data->isoc_rx_ep->bInterval;

        urb->transfer_flags  = URB_FREE_BUFFER | URB_ISO_ASAP;
        urb->transfer_buffer = buf;
--

Thanks,
Bing

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux