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:32 +0200
committerJörg Frings-Fürst <debian@jff.email>2025-06-09 14:27:32 +0200
commit1f3f1e7d112f051f22fe7fc82739b483cef09b2a (patch)
tree7e1920e7f69782aec0d4813963c3601d62a757c1 /backend/hp5590_low.c
parenta0fd2a8557d28ec8e7bbf881f78daf7e8e8fbd6b (diff)
parent652efae78c00b812033ea162d76cd13bd40dcab6 (diff)
Update upstream source from tag 'upstream/1.4.0'
Update to upstream version '1.4.0' with Debian dir fd49a717051e127a9bcd8813f3434d8d71ab8a4c
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