summaryrefslogtreecommitdiffstats
path: root/carl9170fw/extra/libusb-zeropacket.diff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 08:03:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 08:03:39 +0000
commit64f5f3b05c4e82229c5834a40a640cbd6811f5b5 (patch)
treea56dfe853667ad38d8c8c5aa7fe81b8aff5ee326 /carl9170fw/extra/libusb-zeropacket.diff
parentInitial commit. (diff)
downloadfirmware-free-64f5f3b05c4e82229c5834a40a640cbd6811f5b5.tar.xz
firmware-free-64f5f3b05c4e82229c5834a40a640cbd6811f5b5.zip
Adding upstream version 20200122.upstream/20200122
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'carl9170fw/extra/libusb-zeropacket.diff')
-rw-r--r--carl9170fw/extra/libusb-zeropacket.diff38
1 files changed, 38 insertions, 0 deletions
diff --git a/carl9170fw/extra/libusb-zeropacket.diff b/carl9170fw/extra/libusb-zeropacket.diff
new file mode 100644
index 0000000..9aa73de
--- /dev/null
+++ b/carl9170fw/extra/libusb-zeropacket.diff
@@ -0,0 +1,38 @@
+diff -Nurp libusb-1.0-1.0.2/libusb/libusb.h libusb-1.0-1.0.2-orig/libusb/libusb.h
+--- libusb-1.0-1.0.2/libusb/libusb.h 2009-06-07 23:18:19.000000000 +0200
++++ libusb-1.0-1.0.2-orig/libusb/libusb.h 2009-08-10 22:07:41.000000000 +0200
+@@ -673,6 +673,9 @@ enum libusb_transfer_flags {
+ * from your transfer callback, as this will result in a double-free
+ * when this flag is acted upon. */
+ LIBUSB_TRANSFER_FREE_TRANSFER = 1<<2,
++
++ /** Send an extra termination packet, when needed */
++ LIBUSB_TRANSFER_ZERO_PACKET = 1<<3,
+ };
+
+ /** \ingroup asyncio
+diff -Nurp libusb-1.0-1.0.2/libusb/os/linux_usbfs.c libusb-1.0-1.0.2-orig/libusb/os/linux_usbfs.c
+--- libusb-1.0-1.0.2/libusb/os/linux_usbfs.c 2009-06-10 22:41:26.000000000 +0200
++++ libusb-1.0-1.0.2-orig/libusb/os/linux_usbfs.c 2009-08-10 22:10:14.000000000 +0200
+@@ -1298,6 +1298,8 @@ static int submit_bulk_transfer(struct u
+ urb->type = urb_type;
+ urb->endpoint = transfer->endpoint;
+ urb->buffer = transfer->buffer + (i * MAX_BULK_BUFFER_LENGTH);
++ if (transfer->flags & LIBUSB_TRANSFER_ZERO_PACKET)
++ urb->flags = USBFS_URB_ZERO_PACKET;
+ if (i == num_urbs - 1 && last_urb_partial)
+ urb->buffer_length = transfer->length % MAX_BULK_BUFFER_LENGTH;
+ else
+diff -Nurp libusb-1.0-1.0.2/libusb/os/linux_usbfs.h libusb-1.0-1.0.2-orig/libusb/os/linux_usbfs.h
+--- libusb-1.0-1.0.2/libusb/os/linux_usbfs.h 2008-07-16 16:17:57.000000000 +0200
++++ libusb-1.0-1.0.2-orig/libusb/os/linux_usbfs.h 2009-08-10 22:13:15.000000000 +0200
+@@ -63,6 +63,9 @@ struct usbfs_getdriver {
+ #define USBFS_URB_DISABLE_SPD 1
+ #define USBFS_URB_ISO_ASAP 2
+ #define USBFS_URB_QUEUE_BULK 0x10
++#define USBFS_URB_NO_FSBR 0x20
++#define USBFS_URB_ZERO_PACKET 0x40
++#define USBFS_URB_NO_INTERRUPT 0x80
+
+ enum usbfs_urb_type {
+ USBFS_URB_TYPE_ISO = 0,