aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/input/hid.h
diff options
context:
space:
mode:
authorMichael Haboustak <mike-@cinci.rr.com>2005-09-05 01:12:01 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-09-05 01:12:01 -0400
commitbf0964dcda97e42964d312d0ff73a832171e080a (patch)
tree6435056655586ed66a96fbba03305331f8828a28 /drivers/usb/input/hid.h
parent903b126bffb77dc313b7c2971880df408bf41a9e (diff)
Input: HID - handle multi-transascion reports
Fixes handling of multi-transaction reports for HID devices. New function hid_size_buffers() that calculates the longest report for each endpoint and stores the result in the hid_device object. These lengths are used to allocate buffers that are large enough to store any report on the endpoint. For compatibility, the minimum size for an endpoint buffer set to HID_BUFFER_SIZE rather than the known optimal case (the longest report length). It fixes bug #3063 in bugzilla. Signed-off-by: Michael Haboustak <mike-@cinci.rr.com> I simplified the patch a bit to use just a single buffer size. Signed-off-by: Vojtech Pavlik <vojtech@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb/input/hid.h')
-rw-r--r--drivers/usb/input/hid.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h
index ca3e170ce0b3..d76bbc81f6a8 100644
--- a/drivers/usb/input/hid.h
+++ b/drivers/usb/input/hid.h
@@ -351,7 +351,8 @@ struct hid_report_enum {
351 351
352#define HID_REPORT_TYPES 3 352#define HID_REPORT_TYPES 3
353 353
354#define HID_BUFFER_SIZE 64 /* use 64 for compatibility with all possible packetlen */ 354#define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */
355#define HID_MAX_BUFFER_SIZE 4096 /* 4kb */
355#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */ 356#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */
356#define HID_OUTPUT_FIFO_SIZE 64 357#define HID_OUTPUT_FIFO_SIZE 64
357 358
@@ -389,6 +390,8 @@ struct hid_device { /* device report descriptor */
389 390
390 unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */ 391 unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
391 392
393 unsigned int bufsize; /* URB buffer size */
394
392 struct urb *urbin; /* Input URB */ 395 struct urb *urbin; /* Input URB */
393 char *inbuf; /* Input buffer */ 396 char *inbuf; /* Input buffer */
394 dma_addr_t inbuf_dma; /* Input buffer dma */ 397 dma_addr_t inbuf_dma; /* Input buffer dma */