summaryrefslogtreecommitdiff
path: root/backend/hp5590_low.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2025-06-09 14:27:29 +0200
committerJörg Frings-Fürst <debian@jff.email>2025-06-09 14:27:29 +0200
commit652efae78c00b812033ea162d76cd13bd40dcab6 (patch)
tree7c139f4d2a28061607cd7e2269693df993e5d60a /backend/hp5590_low.c
parentbfa2ae8e43fcbab696f272fffd164d0637e965c5 (diff)
New upstream version 1.4.0upstream/1.4.0upstream
Diffstat (limited to 'backend/hp5590_low.c')
-rw-r--r--backend/hp5590_low.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/backend/hp5590_low.c b/backend/hp5590_low.c
index 2d19dcf..7038f43 100644
--- a/backend/hp5590_low.c
+++ b/backend/hp5590_low.c
@@ -99,9 +99,15 @@ struct usb_in_usb_ctrl_setup {
#define CORE_FLAG_NOT_READY 1 << 1
/* Bulk transfers are done in pages, below their respective sizes */
+/*
+ * Note that we limit the amount we can supply to sane_read() to avoid
+ * clashes with the size of the internal read buffer.
+ *
+ */
#define BULK_WRITE_PAGE_SIZE 0x0f000
#define BULK_READ_PAGE_SIZE 0x10000
-#define ALLOCATE_BULK_READ_PAGES 16 /* 16 * 65536 = 1Mb */
+#define ALLOCATE_BULK_READ_PAGES 17 /* 16 * 65536 = 1Mb */
+#define MAX_READ_PAGES 16 /* maximum that we will return to sane_read() */
/* Structure describing bulk read state, because bulk reads will be done in
* pages, but function caller uses its own buffer, whose size is certainly