summaryrefslogtreecommitdiff
path: root/patches/collateral-evolutions/network/0053-remove_wait_on_bit_timeout/btusb.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/collateral-evolutions/network/0053-remove_wait_on_bit_timeout/btusb.patch')
-rw-r--r--patches/collateral-evolutions/network/0053-remove_wait_on_bit_timeout/btusb.patch40
1 files changed, 28 insertions, 12 deletions
diff --git a/patches/collateral-evolutions/network/0053-remove_wait_on_bit_timeout/btusb.patch b/patches/collateral-evolutions/network/0053-remove_wait_on_bit_timeout/btusb.patch
index e4b5b28e..bd57e827 100644
--- a/patches/collateral-evolutions/network/0053-remove_wait_on_bit_timeout/btusb.patch
+++ b/patches/collateral-evolutions/network/0053-remove_wait_on_bit_timeout/btusb.patch
@@ -1,6 +1,22 @@
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
-@@ -1806,8 +1806,12 @@ static int btusb_recv_event_intel(struct
+@@ -339,6 +339,7 @@
+ int (*recv_bulk)(struct btusb_data *data, void *buffer, int count);
+ };
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+ static int btusb_wait_on_bit_timeout(void *word, int bit, unsigned long timeout,
+ unsigned mode)
+ {
+@@ -348,6 +349,7 @@
+ return out_of_line_wait_on_bit_timeout(word, bit, bit_wait_timeout,
+ mode, timeout);
+ }
++#endif
+
+ static inline void btusb_free_frags(struct btusb_data *data)
+ {
+@@ -1816,8 +1816,12 @@ static int btusb_recv_event_intel(struct
if (test_and_clear_bit(BTUSB_DOWNLOADING,
&data->flags) &&
test_bit(BTUSB_FIRMWARE_LOADED, &data->flags)) {
@@ -13,7 +29,7 @@
}
}
-@@ -1818,8 +1822,12 @@ static int btusb_recv_event_intel(struct
+@@ -1828,8 +1832,12 @@ static int btusb_recv_event_intel(struct
if (skb->len == 9 && hdr->evt == 0xff && hdr->plen == 0x07 &&
skb->data[2] == 0x02) {
if (test_and_clear_bit(BTUSB_BOOTING, &data->flags)) {
@@ -26,15 +42,15 @@
}
}
}
-@@ -2187,6 +2195,7 @@ static int btusb_setup_intel_new(struct
+@@ -2197,6 +2205,7 @@ static int btusb_setup_intel_new(struct
* and thus just timeout if that happens and fail the setup
* of this device.
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
- err = wait_on_bit_timeout(&data->flags, BTUSB_DOWNLOADING,
- TASK_INTERRUPTIBLE,
- msecs_to_jiffies(5000));
-@@ -2201,6 +2210,31 @@ static int btusb_setup_intel_new(struct
+ err = btusb_wait_on_bit_timeout(&data->flags, BTUSB_DOWNLOADING,
+ msecs_to_jiffies(5000),
+ TASK_INTERRUPTIBLE);
+@@ -2211,6 +2220,31 @@ static int btusb_setup_intel_new(struct
err = -ETIMEDOUT;
goto done;
}
@@ -66,15 +82,15 @@
if (test_bit(BTUSB_FIRMWARE_FAILED, &data->flags)) {
BT_ERR("%s: Firmware loading failed", hdev->name);
-@@ -2240,6 +2274,7 @@ done:
+@@ -2250,6 +2284,7 @@ done:
*/
BT_INFO("%s: Waiting for device to boot", hdev->name);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
- err = wait_on_bit_timeout(&data->flags, BTUSB_BOOTING,
- TASK_INTERRUPTIBLE,
- msecs_to_jiffies(1000));
-@@ -2253,6 +2288,33 @@ done:
+ err = btusb_wait_on_bit_timeout(&data->flags, BTUSB_BOOTING,
+ msecs_to_jiffies(1000),
+ TASK_INTERRUPTIBLE);
+@@ -2263,6 +2298,33 @@ done:
BT_ERR("%s: Device boot timeout", hdev->name);
return -ETIMEDOUT;
}