diff mbox series

[V3] Increase HID maximum packet size to 16KB.

Message ID 20201125223934.5861-1-dean@fourwalledcubicle.com
State Accepted
Commit 6a0eaf5123e0e1223252b88cd5775f74105e27bd
Headers show
Series [V3] Increase HID maximum packet size to 16KB. | expand

Commit Message

Dean Camera Nov. 25, 2020, 10:39 p.m. UTC
Currently the maximum HID report size which can be buffered by the
kernel is 8KB. This is sufficient for the vast majority of HID
devices on the market, as most HID reports are fairly small.

However, some unusual devices such as the Elgate Stream Deck exist
which use a report size slightly over 8KB for the image data that
is sent to the device. Reports these large cannot be buffered by
the regular HID subsystem currently, thus the only way to use such
device is to bypass the HID subsystem entirely.

This increases the maximum HID report size to 16KB, which should
cover all sanely designed HID devices.

Signed-off-by: Dean Camera <dean@fourwalledcubicle.com>
---
 include/linux/hid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Kosina Nov. 27, 2020, 2:45 p.m. UTC | #1
On Thu, 26 Nov 2020, Dean Camera wrote:

> Currently the maximum HID report size which can be buffered by the

> kernel is 8KB. This is sufficient for the vast majority of HID

> devices on the market, as most HID reports are fairly small.

> 

> However, some unusual devices such as the Elgate Stream Deck exist

> which use a report size slightly over 8KB for the image data that

> is sent to the device. Reports these large cannot be buffered by

> the regular HID subsystem currently, thus the only way to use such

> device is to bypass the HID subsystem entirely.

> 

> This increases the maximum HID report size to 16KB, which should

> cover all sanely designed HID devices.


Seeing the evolution of this constant over the course of years really 
reminds me of "640KB should be enough for everybody" :)

Applied, thanks Dean.

-- 
Jiri Kosina
SUSE Labs
diff mbox series

Patch

diff --git a/include/linux/hid.h b/include/linux/hid.h
index 58684657960b..2faa7aba67ed 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -494,7 +494,7 @@  struct hid_report_enum {
 };
 
 #define HID_MIN_BUFFER_SIZE	64		/* make sure there is at least a packet size of space */
-#define HID_MAX_BUFFER_SIZE	8192		/* 8kb */
+#define HID_MAX_BUFFER_SIZE	16384		/* 16kb */
 #define HID_CONTROL_FIFO_SIZE	256		/* to init devices with >100 reports */
 #define HID_OUTPUT_FIFO_SIZE	64